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

Commit 90acad4

Browse files
committed
circleci changes
1 parent d62f912 commit 90acad4

File tree

2 files changed

+29
-3
lines changed

2 files changed

+29
-3
lines changed

.circleci/config.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,29 +29,31 @@ builddeploy_steps: &builddeploy_steps
2929
- run: *install_dependency
3030
- run: *install_deploysuite
3131
- restore_cache: *restore_cache_settings_for_build
32-
- run: docker build -t topcoder-x-receiver:latest .
32+
- run: ./builddocker.sh ${APPNAME}
3333
- save_cache: *save_cache_settings
3434
- deploy:
3535
name: Running MasterScript.
3636
command: |
3737
./awsconfiguration.sh $DEPLOY_ENV
3838
source awsenvconf
39-
./buildenv.sh -e $DEPLOY_ENV -b ${DEPLOY_ENV}-topcoder-x-receiver-deployvar
39+
./buildenv.sh -e $DEPLOY_ENV -b ${DEPLOY_ENV}-${APPNAME}-deployvar
4040
source buildenvvar
41-
./master_deploy.sh -d ECS -e $DEPLOY_ENV -t latest -s dev-global-appvar,${DEPLOY_ENV}-topcoder-x-receiver-appvar -i topcoder-x-receiver
41+
./master_deploy.sh -d ECS -e $DEPLOY_ENV -t latest -s ${DEPLOY_ENV}-global-appvar,${DEPLOY_ENV}-${APPNAME}-appvar -i ${APPNAME}
4242
jobs:
4343
# Build & Deploy against development backend
4444
"build-dev":
4545
<<: *defaults
4646
environment:
4747
DEPLOY_ENV: "dev"
48+
APPNAME: "topcoder-x-receiver"
4849
steps: *builddeploy_steps
4950

5051
# Build & Deploy against production backend
5152
"build-prod":
5253
<<: *defaults
5354
environment:
5455
DEPLOY_ENV: "prod"
56+
APPNAME: "topcoder-x-receiver"
5557
steps: *builddeploy_steps
5658

5759
workflows:

builddocker.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash
2+
set -eo pipefail
3+
APP_NAME=$1
4+
UPDATE_CACHE=""
5+
echo "" > docker/api.env
6+
#docker-compose -f docker/docker-compose.yml build $APP_NAME
7+
docker build -t $APP_NAME:latest .
8+
docker create --name app $APP_NAME:latest
9+
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
20+
21+
if [ "$UPDATE_CACHE" == 1 ]
22+
then
23+
docker cp app:/$APP_NAME/node_modules .
24+
fi

0 commit comments

Comments
 (0)