feat: deploy to prod
This commit is contained in:
parent
d7f07ee6c6
commit
ea6297e5e2
@ -11,28 +11,43 @@ stages:
|
|||||||
- deploy
|
- deploy
|
||||||
|
|
||||||
clear-old-images:
|
clear-old-images:
|
||||||
|
tags:
|
||||||
|
- frontbuild
|
||||||
extends: .clean_template
|
extends: .clean_template
|
||||||
variables:
|
variables:
|
||||||
STAGING_BRANCH: "main"
|
STAGING_BRANCH: "without-buttons"
|
||||||
PRODUCTION_BRANCH: "main"
|
PRODUCTION_BRANCH: "main"
|
||||||
image:
|
image:
|
||||||
name: docker/compose:1.28.0
|
name: docker/compose:1.28.0
|
||||||
entrypoint: [""]
|
entrypoint: [""]
|
||||||
before_script:
|
before_script:
|
||||||
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
|
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
|
||||||
- docker images
|
|
||||||
script:
|
script:
|
||||||
- docker system prune -af
|
- docker system prune -af
|
||||||
build-app:
|
build-app:
|
||||||
|
tags:
|
||||||
|
- frontbuild
|
||||||
extends: .build_template
|
extends: .build_template
|
||||||
variables:
|
variables:
|
||||||
DOCKER_BUILD_PATH: "./Dockerfile"
|
BRANCH: "without-buttons"
|
||||||
STAGING_BRANCH: "main"
|
rules:
|
||||||
PRODUCTION_BRANCH: "main"
|
- if: "$CI_COMMIT_BRANCH == $BRANCH"
|
||||||
|
when: on_success
|
||||||
|
before_script:
|
||||||
|
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
|
||||||
|
script:
|
||||||
|
- docker build -t $CI_REGISTRY_IMAGE/main:$CI_COMMIT_REF_SLUG.$CI_PIPELINE_ID --build-arg GITLAB_TOKEN=$GITLAB_TOKEN $CI_PROJECT_DIR
|
||||||
|
- docker push $CI_REGISTRY_IMAGE/main:$CI_COMMIT_REF_SLUG.$CI_PIPELINE_ID
|
||||||
|
|
||||||
deploy-to-staging:
|
deploy-to-staging:
|
||||||
|
tags:
|
||||||
|
- front
|
||||||
|
- prod
|
||||||
extends: .deploy_template
|
extends: .deploy_template
|
||||||
variables:
|
variables:
|
||||||
DEPLOY_TO: "staging"
|
BRANCH: "without-buttons"
|
||||||
BRANCH: "main"
|
rules:
|
||||||
|
- if: "$CI_COMMIT_BRANCH == $BRANCH"
|
||||||
|
script:
|
||||||
|
- docker login -u $REGISTRY_USER -p $REGISTRY_TOKEN $CI_REGISTRY
|
||||||
|
- docker-compose -f deployments/main/docker-compose.yaml up -d
|
||||||
|
8
deployments/main/docker-compose.yaml
Normal file
8
deployments/main/docker-compose.yaml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
services:
|
||||||
|
squiz:
|
||||||
|
container_name: squiz
|
||||||
|
restart: unless-stopped
|
||||||
|
image: $CI_REGISTRY_IMAGE/main:$CI_COMMIT_REF_SLUG.$CI_PIPELINE_ID
|
||||||
|
hostname: squiz
|
||||||
|
tty: true
|
||||||
|
|
Loading…
Reference in New Issue
Block a user