mirror of
https://gitlab.com/megazordpobeda/DataRush.git
synced 2026-05-22 23:17:09 +00:00
feat: added build and push pipeline
This commit is contained in:
@@ -0,0 +1,45 @@
|
|||||||
|
stages:
|
||||||
|
- build
|
||||||
|
- trigger
|
||||||
|
|
||||||
|
variables:
|
||||||
|
DOCKER_TLS_CERTDIR: /certs
|
||||||
|
FRONTEND_IMAGE: $CI_REGISTRY_IMAGE/frontend
|
||||||
|
BACKEND_IMAGE: $CI_REGISTRY_IMAGE/backend
|
||||||
|
|
||||||
|
build_images:
|
||||||
|
stage: build
|
||||||
|
image: docker:27.5.1
|
||||||
|
services:
|
||||||
|
- docker:dind
|
||||||
|
rules:
|
||||||
|
- if: $CI_COMMIT_REF_NAME == "master"
|
||||||
|
script:
|
||||||
|
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
|
||||||
|
|
||||||
|
- |
|
||||||
|
docker buildx build \
|
||||||
|
-t $FRONTEND_IMAGE:$CI_COMMIT_SHORT_SHA \
|
||||||
|
-t $FRONTEND_IMAGE:latest \
|
||||||
|
-f ./services/frontend/Dockerfile \
|
||||||
|
--push .
|
||||||
|
|
||||||
|
- |
|
||||||
|
docker buildx build \
|
||||||
|
-t $BACKEND_IMAGE:$CI_COMMIT_SHORT_SHA \
|
||||||
|
-t $BACKEND_IMAGE:latest \
|
||||||
|
-f ./services/backend/Dockerfile \
|
||||||
|
--push .
|
||||||
|
|
||||||
|
trigger_deployment:
|
||||||
|
stage: trigger
|
||||||
|
image: curlimages/curl:8.5.0
|
||||||
|
rules:
|
||||||
|
- if: $CI_COMMIT_REF_NAME == "master"
|
||||||
|
script:
|
||||||
|
- |
|
||||||
|
curl --request POST \
|
||||||
|
--header "PRIVATE-TOKEN: prod-16cwBKYHzqqZaRzywCCG" \
|
||||||
|
--form "variables[FRONTEND_TAG]=$CI_COMMIT_SHORT_SHA" \
|
||||||
|
--form "variables[BACKEND_TAG]=$CI_COMMIT_SHORT_SHA" \
|
||||||
|
"https://gitlab.com/api/v4/projects/289/trigger/pipeline"
|
||||||
Reference in New Issue
Block a user