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

Commit 1c7e2fb

Browse files
committed
Adding env vars for appmode and appenv
1 parent 7d08937 commit 1c7e2fb

File tree

4 files changed

+19
-4
lines changed

4 files changed

+19
-4
lines changed

.circleci/config.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,18 @@ builddeploy_steps: &builddeploy_steps
2828
- setup_remote_docker
2929
- run: *install_dependency
3030
- run: *install_deploysuite
31-
- run: ./build.sh ${APPNAME}
31+
- run:
32+
command: |
33+
./awsconfiguration.sh $DEPLOY_ENV
34+
source awsenvconf
35+
./buildenv.sh -e $DEPLOY_ENV -b ${LOGICAL_ENV}-${APPNAME}-buildvar
36+
- run:
37+
command: |
38+
source buildenvvar
39+
./build.sh ${APPNAME}
3240
- deploy:
3341
name: Running MasterScript.
3442
command: |
35-
./awsconfiguration.sh $DEPLOY_ENV
3643
source awsenvconf
3744
./buildenv.sh -e $DEPLOY_ENV -b ${LOGICAL_ENV}-${APPNAME}-deployvar
3845
source buildenvvar

build.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ 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

810
docker create --name app $APP_NAME:latest
911

docker/Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
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
511
COPY . /micro-frontends-navbar-app
612

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",
66
"dev-https": "webpack-dev-server --https",
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 \"./**\"",

0 commit comments

Comments
 (0)