Skip to content

Commit

Permalink
[#1736] Build staging on different script
Browse files Browse the repository at this point in the history
  • Loading branch information
anjarakvo committed Nov 10, 2023
1 parent abf1b8c commit d68802c
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
22 changes: 22 additions & 0 deletions ci/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ backend_build () {

docker build \
--tag "${image_prefix}/backend:latest" \
--tag "${image_prefix}/backend:${CI_COMMIT}-staging" \
--tag "${image_prefix}/backend:${CI_COMMIT}" backend
}

Expand All @@ -66,22 +67,43 @@ frontend_build () {
--tag "${image_prefix}/frontend:${CI_COMMIT}" frontend
}

frontend_build_staging () {

rm -rf frontend/.env
echo 'REACT_APP_AUTH0_CLIENT_ID="dxfYNPO4D9ovQr5NHFkOU3jwJzXhcq5J"' > frontend/.env
echo 'REACT_APP_AUTH0_DOMAIN="unep-gpml-test.eu.auth0.com"' > frontend/.env
echo 'NEXT_PUBLIC_CHAT_API_DOMAIN_URL="https://rocket-chat.akvotest.org"' > frontend/.env
echo 'NEXT_PUBLIC_ENV=staging' > frontend/.env

dc run \
--rm \
--no-deps \
frontend \
bash release.sh

docker build \
--tag "${image_prefix}/frontend:${CI_COMMIT}-staging" frontend
}


nginx_build () {
docker build \
--tag "${image_prefix}/nginx:latest" \
--tag "${image_prefix}/nginx:${CI_COMMIT}-staging" \
--tag "${image_prefix}/nginx:${CI_COMMIT}" nginx
}

strapi_build () {
docker build -f strapi/Dockerfile.prod \
--tag "${image_prefix}/strapi:latest" \
--tag "${image_prefix}/strapi:${CI_COMMIT}-staging" \
--tag "${image_prefix}/strapi:${CI_COMMIT}" strapi
}


backend_build
frontend_build
frontend_build_staging
strapi_build
nginx_build

Expand Down
1 change: 1 addition & 0 deletions ci/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ auth () {
push_image () {
prefix="eu.gcr.io/akvo-lumen/unep-gpml"
docker push "${prefix}/${1}:${CI_COMMIT}"
docker push "${prefix}/${1}:${CI_COMMIT}-staging"
}

prepare_deployment () {
Expand Down

0 comments on commit d68802c

Please # to comment.