Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 687fe7a

Browse files
Merge pull request #4 from topcoder-platform/devverify
Devverify to dev
2 parents 9700493 + 15f23df commit 687fe7a

File tree

10 files changed

+67
-28
lines changed

10 files changed

+67
-28
lines changed

.circleci/config.yml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,17 @@ builddeploy_steps: &builddeploy_steps
2828
- setup_remote_docker
2929
- run: *install_dependency
3030
- run: *install_deploysuite
31-
- restore_cache: *restore_cache_settings_for_build
32-
- run: ./build.sh ${APPNAME}
33-
- save_cache: *save_cache_settings
31+
#- restore_cache: *restore_cache_settings_for_build
32+
- run:
33+
command: |
34+
./awsconfiguration.sh $DEPLOY_ENV
35+
source awsenvconf
36+
./buildenv.sh -e $DEPLOY_ENV -b ${LOGICAL_ENV}-${APPNAME}-buildvar
37+
- run:
38+
command: |
39+
source buildenvvar
40+
./build.sh ${APPNAME}
41+
#- save_cache: *save_cache_settings
3442
- deploy:
3543
name: Running MasterScript.
3644
command: |
@@ -40,6 +48,12 @@ builddeploy_steps: &builddeploy_steps
4048
source buildenvvar
4149
./master_deploy.sh -d ECS -e $DEPLOY_ENV -t latest -s ${LOGICAL_ENV}-global-appvar,${LOGICAL_ENV}-${APPNAME}-appvar -i ${APPNAME}
4250
51+
#For mock server
52+
echo "Running Masterscript - For mock server"
53+
./buildenv.sh -e $DEPLOY_ENV -b ${LOGICAL_ENV}-mock-${APPNAME}-deployvar
54+
source buildenvvar
55+
./master_deploy.sh -d ECS -e $DEPLOY_ENV -t latest -s ${LOGICAL_ENV}-global-appvar,${LOGICAL_ENV}-mock-${APPNAME}-appvar -i mock-${APPNAME}
56+
4357
jobs:
4458
# Build & Deploy against development backend
4559
"build-dev":
@@ -69,6 +83,7 @@ workflows:
6983
branches:
7084
only:
7185
- dev
86+
- devverify
7287

7388
# Production builds are exectuted only on tagged commits to the
7489
# master branch.

build.sh

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,26 @@ set -eo pipefail
33
APP_NAME=$1
44
UPDATE_CACHE=""
55

6-
docker build -f docker/Dockerfile -t $APP_NAME:latest .
6+
docker build -f docker/Dockerfile -t $APP_NAME:latest \
7+
--build-arg APPMODE=$APPMODE \
8+
--build-arg APPENV=$APPENV .
79

8-
docker create --name app $APP_NAME:latest
10+
docker build -f docker/mockDockerfile -t mock-$APP_NAME:latest .
911

10-
if [ -d node_modules ]
11-
then
12-
mv package-lock.json old-package-lock.json
13-
docker cp app:/$APP_NAME/package-lock.json package-lock.json
14-
set +eo pipefail
15-
UPDATE_CACHE=$(cmp package-lock.json old-package-lock.json)
16-
set -eo pipefail
17-
else
18-
UPDATE_CACHE=1
19-
fi
12+
#docker create --name app $APP_NAME:latest
2013

21-
if [ "$UPDATE_CACHE" == 1 ]
22-
then
23-
docker cp app:/$APP_NAME/node_modules .
24-
fi
14+
#if [ -d node_modules ]
15+
#then
16+
# mv package-lock.json old-package-lock.json
17+
# docker cp app:/$APP_NAME/package-lock.json package-lock.json
18+
# set +eo pipefail
19+
# UPDATE_CACHE=$(cmp package-lock.json old-package-lock.json)
20+
# set -eo pipefail
21+
#else
22+
# UPDATE_CACHE=1
23+
#fi
24+
25+
#if [ "$UPDATE_CACHE" == 1 ]
26+
#then
27+
# docker cp app:/$APP_NAME/node_modules .
28+
#fi

config/development.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module.exports = {
77
/**
88
* Topcoder Teams Service base URL
99
*/
10-
TC_TEAMS_SERVICE_URL: "http://localhost:8502",
10+
TC_TEAMS_SERVICE_URL: "https://api.topcoder-dev.com/taasmock",
1111

1212
/**
1313
* URL of Topcoder Community Website

config/production.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module.exports = {
77
/**
88
* Topcoder Teams Service base URL
99
*/
10-
TC_TEAMS_SERVICE_URL: "http://localhost:8502",
10+
TC_TEAMS_SERVICE_URL: "http://localhost:8502/taasmock",
1111

1212
/**
1313
* URL of Topcoder Community Website

docker/Dockerfile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
# Use the base image with Node.js
22
FROM node:latest
33

4+
ARG APPMODE
5+
ARG APPENV
6+
7+
ENV APPMODE=$APPMODE
8+
ENV APPENV=$APPENV
9+
410
# Copy the current directory into the Docker image
5-
COPY . /micro-frontends-teams
11+
COPY . /taas-app
612

713
# Set working directory for future use
8-
WORKDIR /micro-frontends-teams
14+
WORKDIR /taas-app
915

1016
# Install the dependencies from package.json
1117
RUN npm install

docker/docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: '3'
22
services:
3-
micro-frontends-teams:
4-
image: micro-frontends-teams:latest
3+
taas-app:
4+
image: taas-app:latest
55
build:
66
context: ../
77
dockerfile: docker/Dockerfile

docker/mockDockerfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Use the base image with Node.js
2+
FROM node:latest
3+
4+
# Copy the current directory into the Docker image
5+
COPY . /taas-app
6+
7+
# Set working directory for future use
8+
WORKDIR /taas-app/local/mock-server
9+
10+
# Install the dependencies from package.json
11+
12+
RUN npm install
13+
14+
CMD npm start

local/mock-server/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ router.render = (req, res) => {
4545
}
4646
};
4747

48-
server.use(router);
48+
server.use('/taasmock', router);
4949

5050
server.listen(PORT, () => {
5151
console.log(`JSON Server is running on port ${PORT}`); // eslint-disable-line no-console

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"start": "node server.js",
55
"dev": "webpack-dev-server --port 8501 --host 0.0.0.0",
66
"dev-https": "webpack-dev-server --https --port 8501 --host 0.0.0.0",
7-
"build": "webpack --mode=production",
7+
"build": "webpack --mode=${APPMODE:-development} --env.config=${APPENV:-dev}",
88
"analyze": "webpack --mode=production --env.analyze=true",
99
"lint": "eslint src --ext js",
1010
"format": "prettier --write \"./**\"",

server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const express = require("express");
44

55
const app = express();
66

7-
app.use('/react',
7+
app.use('/taas-app',
88
express.static("./dist", {
99
setHeaders: function setHeaders(res) {
1010
res.header("Access-Control-Allow-Origin", "*");

0 commit comments

Comments
 (0)