Commit 33f76818 authored by Thomas Beermann's avatar Thomas Beermann
Browse files

disable pipeline runs for branches #2

parent c193d1ff
Pipeline #94525 passed with stages
in 4 minutes and 53 seconds
......@@ -8,9 +8,7 @@ stages:
variables:
MAVEN_OPTS: "-Dmaven.repo.local=.m2/repository"
DOCKER_REGISTRY: registry.hzdr.de
DOCKER_IMAGE_BASE: registry.hzdr.de/helmholtz-cloud-portal/cerebrum
DOCKER_IMAGE_TAGGED: helmholtzcloud/cerebrum:$CI_COMMIT_TAG
DOCKER_IMAGE_LATEST: helmholtzcloudserviceuser/cerebrum:latest
DOCKER_IMAGE_BASE: helmholtz-cloud-portal/cerebrum
cache:
key: "$CI_COMMIT_REF_NAME"
......
......@@ -3,7 +3,6 @@ build:
- master
- tags
- merge_requests
- branches
stage: build
image: maven:3-jdk-11
script: mvn compile
......@@ -13,7 +12,6 @@ test:
- master
- tags
- merge_requests
- branches
stage: test
image: maven:3-jdk-11
services:
......@@ -53,15 +51,15 @@ docker_build_push:
- docker login -u $GITLAB_DOCKER_USERNAME -p $GITLAB_DOCKER_PASSWORD $DOCKER_REGISTRY
- |-
if [[ "$CI_COMMIT_BRANCH" == "master" ]]; then
docker build -t $DOCKER_IMAGE_BASE:latest .
docker push $DOCKER_IMAGE_BASE:latest
docker build -t $DOCKER_REGISTRY/$DOCKER_IMAGE_BASE:latest .
docker push $DOCKER_REGISTRY/$DOCKER_IMAGE_BASE:latest
else
tag=$(echo $CI_COMMIT_REF_NAME | tr [:upper:] [:lower:] | tr [:punct:] -)
if [[ -n "$CI_COMMIT_TAG" ]]; then
tag=$CI_COMMIT_TAG
fi
docker build -t $DOCKER_IMAGE_BASE:$tag .
docker push $DOCKER_IMAGE_BASE:$tag
docker build -t $DOCKER_REGISTRY/$DOCKER_IMAGE_BASE:$tag .
docker push $DOCKER_REGISTRY/$DOCKER_IMAGE_BASE:$tag
fi
dependencies:
- package
......@@ -75,10 +73,11 @@ trigger_deploy_mr:
stage: deploy
image: alpine:3.14.0
before_script:
- apk add curl
- apk add curl jq
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'
- echo "Application will be automatically deployed. After a couple of minutes you can find it at http://cerebrum-`echo $CI_COMMIT_REF_NAME | tr [:upper:] [:lower:] | tr [:punct:] -`.beermath-test.131.169.234.105.nip.io"
- '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 > /tmp/out.json'
- pipelineurl=$(jq .web_url /tmp/out.json)
- echo "Application will be automatically deployed." && echo "You can check the deployment status here $pipelineurl" && echo "After a couple of minutes you can check the application at http://cerebrum-`echo $CI_COMMIT_REF_NAME | tr [:upper:] [:lower:] | tr [:punct:] -`.beermath-test.131.169.234.105.nip.io"
trigger_deploy_master:
only:
......@@ -86,6 +85,8 @@ trigger_deploy_master:
stage: deploy
image: alpine:3.14.0
before_script:
- apk add curl
- apk add curl jq
script:
- 'curl -X POST -F token=$GITLAB_DESY_TOKEN -F ref=main --form "variables[CP_COMPONENT]=int" $GITLAB_DESY_URL'
- 'curl -X POST -F token=$GITLAB_DESY_TOKEN -F ref=main --form "variables[CP_COMPONENT]=int" $GITLAB_DESY_URL > /tmp/out.json'
- pipelineurl=$(jq .web_url /tmp/out.json)
- 'echo "Deployment status: $pipelineurl"'
......@@ -6,7 +6,7 @@ Cerebrum is the resources API for Helmholtz Cloud Portal.
### Automatic deployments of Merge Requests
Each Merge Request will be automatically deployed to a Kubernetes test cluster so that you can directly see your changes in a live deployment. It will be set up together with the Webapp frontend with its own database. For the Webapp the code from its current master branch will be taken. A dynamic URL based on the branch name of the MR will be created. You can find the URL in the output of the last job in the CI/CD pipeline (`trigger_deploy_mr`). When you push new commits to the MR the application will be redeployed.
Each Merge Request will be automatically deployed to a Kubernetes test cluster so that you can directly see your changes in a live deployment. It will be set up together with the Webapp frontend and its own database. For the Webapp the code from its current master branch will be taken. The deployment is running in a pipeline at DESY. You can find a link to that pipeline in the output of the last job in the CI/CD pipeline (`trigger_deploy_mr`). There you can also find a url where you access the Cloud Portal when it has been deployed. When you push new commits to the MR the application will be redeployed.
### Building and Running
......
Supports Markdown
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