Commit 64bd53fd authored by Thomas Beermann's avatar Thomas Beermann
Browse files

Automatic deployment of Merge Requests and Master

parent 40f83a09
Pipeline #91548 passed with stages
in 1 minute and 55 seconds
......@@ -3,6 +3,7 @@ stages:
- test
- package
- docker
- deploy
variables:
MAVEN_OPTS: "-Dmaven.repo.local=.m2/repository"
......
......@@ -56,10 +56,32 @@ docker_build_push:
docker build -t $DOCKER_IMAGE_BASE:latest .
docker push $DOCKER_IMAGE_BASE:latest
else
docker build -t $DOCKER_IMAGE_BASE:$CI_COMMIT_REF_NAME .
docker push $DOCKER_IMAGE_BASE:$CI_COMMIT_REF_NAME
tag=$(echo $CI_COMMIT_REF_NAME | tr _ -)
docker build -t $DOCKER_IMAGE_BASE:$tag .
docker push $DOCKER_IMAGE_BASE:$tag
fi
dependencies:
- package
tags:
- "docker"
trigger_deploy_mr:
only:
- merge_requests
stage: deploy
image: alpine:3.14.0
before_script:
- apk add curl
script:
- 'curl -X POST -F token=$GITLAB_DESY_TOKEN -F ref=main --form "variables[CI_COMMIT_REF_NAME]=$CI_COMMIT_REF_NAME" --form "variables[CI_MERGE_REQUEST_IID]=$CI_MERGE_REQUEST_IID" --form "variables[CP_COMPONENT]=cerebrum" $GITLAB_DESY_URL'
trigger_deploy_master:
only:
- master
stage: deploy
image: alpine:3.14.0
before_script:
- apk add curl
script:
- 'curl -X POST -F token=$GITLAB_DESY_TOKEN -F ref=main --form "variables[CP_COMPONENT]=int" $GITLAB_DESY_URL'
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment