Skip to content

prod release #17

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 25 additions & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
version: 2
defaults: &defaults
docker:
- image: circleci/python:2.7-stretch-browsers
- image: cimg/python:3.11.0-browsers
install_dependency: &install_dependency
name: Installation of build and deployment dependencies.
command: |
sudo apt update
sudo apt install jq
sudo pip install awscli --upgrade
sudo pip install docker-compose
sudo apt install python3-pip
sudo pip3 install awscli --upgrade
sudo pip3 install docker-compose
install_deploysuite: &install_deploysuite
name: Installation of install_deploysuite.
command: |
git clone --branch v1.4.2 https://github.com/topcoder-platform/tc-deploy-scripts ../buildscript
git clone --branch v1.4.15 https://github.com/topcoder-platform/tc-deploy-scripts ../buildscript
cp ./../buildscript/master_deploy.sh .
cp ./../buildscript/buildenv.sh .
cp ./../buildscript/awsconfiguration.sh .
Expand Down Expand Up @@ -56,15 +58,23 @@ jobs:
environment:
DEPLOY_ENV: "DEV"
LOGICAL_ENV: "dev"
APPNAME: "micro-frontends-taas-admin-app"
APPNAME: "micro-frontends-forums-app"
steps: *builddeploy_steps

"build-qa":
<<: *defaults
environment:
DEPLOY_ENV: "QA"
LOGICAL_ENV: "qa"
APPNAME: "micro-frontends-forums-app"
steps: *builddeploy_steps

"build-prod":
<<: *defaults
environment:
DEPLOY_ENV: "PROD"
LOGICAL_ENV: "prod"
APPNAME: "micro-frontends-taas-admin-app"
APPNAME: "micro-frontends-forums-app"
steps: *builddeploy_steps

workflows:
Expand All @@ -77,8 +87,16 @@ workflows:
filters:
branches:
only:
- dev
- develop

# Development builds are executed on "develop" branch only.
- "build-qa":
context: org-global
filters:
branches:
only:
- qa

# Production builds are exectuted only on tagged commits to the
# master branch.
- "build-prod":
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,21 +103,21 @@ Some config files are using domain `local.topcoder-dev.com`. You can change it t
2. Run **Navbar** micro-app:

```sh
git clone https://github.com/topcoder-platform/micro-frontends-navbar-app.git
cd micro-frontends-navbar-app
git clone https://github.com/topcoder-platform/mfe-header.git
cd mfe-header
```

Update in file `micro-frontends-navbar-app/config/dev.js` values for `ACCOUNTS_APP_CONNECTOR` and `AUTH` to `http://localhost:5000` so Navbar app which handles authentication uses our local Authentication service.
Update in file `mfe-header/config/dev.js` values for `ACCOUNTS_APP_CONNECTOR` and `AUTH` to `http://localhost:5000` so Navbar app which handles authentication uses our local Authentication service.

```sh
# inside folder "micro-frontends-navbar-app" run:
# inside folder "mfe-header" run:

nvm use # or make sure to use Node 10
npm i # to install dependencies

npm run dev

# this host navbar app as http://localhost:3001/navbar/topcoder-micro-frontends-navbar-app.js
# this host navbar app as http://localhost:3001/navbar/topcoder-mfe-header.js
```

3. Run **Forums** micro-app:
Expand Down Expand Up @@ -147,4 +147,4 @@ Some config files are using domain `local.topcoder-dev.com`. You can change it t
- If you are not logged-in yet, you should be redirected to the login page.
- If you cannot see the application and redirect doesn't happen, make sure that file "http://local.topcoder-dev.com:8602/forums-app/topcoder-micro-frontends--app.js" is loaded successfully in the Network tab.

Congratulations, you successfully run the project. If you had some issue, please, try to go through README of https://github.com/topcoder-platform/micro-frontends-frame and https://github.com/topcoder-platform/micro-frontends-navbar-app.
Congratulations, you successfully run the project. If you had some issue, please, try to go through README of https://github.com/topcoder-platform/micro-frontends-frame and https://github.com/topcoder-platform/mfe-header.
14 changes: 11 additions & 3 deletions config/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
/* global process */

module.exports = (() => {
const appEnv = process.env.APPENV === "prod" ? "prod" : "dev";
return require(`./${appEnv}`);
})();
const env = process.env.APPENV || "dev";

console.log(`APPENV: "${env}"`);

// for security reason don't let to require any arbitrary file defined in process.env
if (["prod", "dev", "qa"].indexOf(env) < 0) {
return require("./dev");
}

return require("./" + env);
})();
7 changes: 7 additions & 0 deletions config/qa.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
API: {
V3: "https://api.topcoder-qa.com/v3",
V5: "https://api.topcoder-qa.com/v5",
},
VANILLA_EMBED_JS: "https://vanilla.topcoder-qa.com/js/embed.js",
};
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"start": "node server.js",
"dev": "cross-env APPMODE=development webpack-dev-server --port 8602 --host 0.0.0.0",
"dev-https": "cross-env APPMODE=development webpack-dev-server --https --port 8602 --host 0.0.0.0",
"qa": "cross-env APPMODE=development webpack-dev-server --port 8602 --host 0.0.0.0",
"build": "webpack --mode=${APPMODE:-production} --env.config=${APPENV:-prod}",
"analyze": "webpack --mode=production --env.analyze=true",
"lint": "eslint ./src --ext .js,.jsx",
Expand Down
Loading