From a9c69d7aba69de76410dec3841e5890f0f4487f7 Mon Sep 17 00:00:00 2001 From: skeris Date: Tue, 30 Jan 2024 22:03:44 +0300 Subject: [PATCH] ci: production preparations --- .gitlab-ci.yml | 9 +++++++++ Dockerfile | 1 + deployments/main/docker-compose.yaml | 8 ++++++++ deployments/staging/docker-compose.yaml | 5 ----- pub.js | 1 + 5 files changed, 19 insertions(+), 5 deletions(-) create mode 100644 deployments/main/docker-compose.yaml create mode 100644 pub.js diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a749119..2355dbd 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -17,7 +17,16 @@ build-app: deploy-to-staging: extends: .deploy_template + rules: + - if: "$CI_COMMIT_BRANCH == $STAGING_BRANCH" tags: - front - staging +deploy-to-prod: + extends: .deploy_template + rules: + - if: "$CI_COMMIT_BRANCH == $PRODUCTION_BRANCH" + tags: + - front + - prod diff --git a/Dockerfile b/Dockerfile index ac65e91..6426786 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,4 +11,5 @@ RUN yarn build FROM nginx:latest as result WORKDIR /usr/share/nginx/html COPY --from=build /usr/app/dist/ /usr/share/nginx/html +COPY pub.js /usr/share/nginx/html/export/pub.js COPY hub.conf /etc/nginx/conf.d/default.conf diff --git a/deployments/main/docker-compose.yaml b/deployments/main/docker-compose.yaml new file mode 100644 index 0000000..8dacb5e --- /dev/null +++ b/deployments/main/docker-compose.yaml @@ -0,0 +1,8 @@ +services: + respondent: + container_name: respondent + restart: unless-stopped + image: $CI_REGISTRY_IMAGE/main:$CI_COMMIT_REF_SLUG.$CI_PIPELINE_ID + hostname: respondent + tty: true + diff --git a/deployments/staging/docker-compose.yaml b/deployments/staging/docker-compose.yaml index 3ab31f2..d258d2e 100644 --- a/deployments/staging/docker-compose.yaml +++ b/deployments/staging/docker-compose.yaml @@ -3,11 +3,6 @@ services: container_name: respondent restart: unless-stopped image: $CI_REGISTRY_IMAGE/staging:$CI_COMMIT_REF_SLUG.$CI_PIPELINE_ID - networks: - - marketplace_penahub_frontend hostname: respondent tty: true -networks: - marketplace_penahub_frontend: - external: true diff --git a/pub.js b/pub.js new file mode 100644 index 0000000..f192725 --- /dev/null +++ b/pub.js @@ -0,0 +1 @@ +console.log("PEHA NUB")