Commit 812440cf authored by Mathias Goebel's avatar Mathias Goebel 🎠 Committed by Stefan Funk
Browse files

chore: tidy up ci file

parent 876a01ab
# This template uses jdk8 for verifying and deploying images
image: maven:3.8.3-jdk-8
variables:
# This will suppress any download for dependencies and plugins or upload messages which would clutter the console log.
# `showDateTime` will show the passed time in milliseconds. You need to specify `--batch-mode` to make this work.
......@@ -20,6 +17,27 @@ variables:
# FIXME --> Improve CI process: Manage artifacts? Split mvn runs into different stages/jobs?
# FIXME --> Take care of online testing, should NOT be tested in CI/CD!
##################
### TEMPLATES ###
##################
.webapp: &webapp
image: alpine:3.14
stage: deploy_deb
script:
- source $VARIABLES_FILE
- 'apk add --no-cache bash'
- 'apk add --no-cache curl'
- export PLOC="$(ls ./${PPATH}/*.deb)"
- DEB_NAME=$PNAME-$PVERSION.deb
- 'if [[ $PVERSION =~ .*${PKEY}$ ]]; then'
- echo "---A ${PKEY} RELEASE BUILD IS BEING PERFORMED---"
- 'curl -u ${APTLY_USER}:${APTLY_PASSWORD} -X POST --header "Content-Type:multipart/form-data" -F file=@${PLOC} ${APTLY_URL}/files/${DEB_NAME}'
- 'curl -u ${APTLY_USER}:${APTLY_PASSWORD} -X POST ${APTLY_URL}/repos/${APTLY_TARGET}/file/${DEB_NAME}'
- 'curl -u ${APTLY_USER}:${APTLY_PASSWORD} -X PUT -H "Content-Type: application/json" --data "{}" ${APTLY_URL}/publish/:./indy'
- fi
stages:
- build_version
- deploy_java
......@@ -34,6 +52,7 @@ cache:
# Get the project version from main POM file and store it to artifact.
get_version:
image: maven:3.8.3-jdk-8
only:
- develop
- main
......@@ -49,6 +68,7 @@ get_version:
# Build and deploy all the JARs to GWDG Nexus, and build all the DEBs and store DEBs to artifacts.
build_and_deploy:
image: maven:3.8.3-jdk-8
only:
- develop
- main
......@@ -70,151 +90,80 @@ build_and_deploy:
deploy_tgcrud-webapp_dev:
only:
- develop
image: alpine:3.14
stage: deploy_deb
variables:
PNAME: 'tgcrud-webapp'
PPATH: '${PNAME}/target'
script:
- source $VARIABLES_FILE
- 'apk add --no-cache bash'
- 'apk add --no-cache curl'
- export PLOC="$(ls ./${PPATH}/*.deb)"
- DEB_NAME=$PNAME-$PVERSION.deb
- 'if [[ $PVERSION =~ .*SNAPSHOT$ ]]; then echo "---A SNAPSHOT BUILD IS BEING PERFORMED---"; fi'
- 'if [[ $PVERSION =~ .*SNAPSHOT$ ]]; then curl -u ${APTLY_USER}:${APTLY_PASSWORD} -X POST --header "Content-Type:multipart/form-data" -F file=@${PLOC} ${APTLY_URL}/files/${DEB_NAME}; fi'
- 'if [[ $PVERSION =~ .*SNAPSHOT$ ]]; then curl -u ${APTLY_USER}:${APTLY_PASSWORD} -X POST ${APTLY_URL}/repos/indy-snapshots/file/${DEB_NAME}; fi'
- 'if [[ $PVERSION =~ .*SNAPSHOT$ ]]; then curl -u ${APTLY_USER}:${APTLY_PASSWORD} -X PUT -H "Content-Type: application/json" --data "{}" ${APTLY_URL}/publish/:./indy; fi'
PKEY: 'SNAPSHOT'
APTLY_TARGET: 'indy-snapshots'
<<: *webapp
deploy_tgcrud-webapp-public_dev:
only:
- develop
image: alpine:3.14
stage: deploy_deb
variables:
PNAME: 'tgcrud-webapp-public'
PPATH: '${PNAME}/target'
script:
- source $VARIABLES_FILE
- 'apk add --no-cache bash'
- 'apk add --no-cache curl'
- export PLOC="$(ls ./${PPATH}/*.deb)"
- DEB_NAME=$PNAME-$PVERSION.deb
- 'if [[ $PVERSION =~ .*SNAPSHOT$ ]]; then echo "---A SNAPSHOT BUILD IS BEING PERFORMED---"; fi'
- 'if [[ $PVERSION =~ .*SNAPSHOT$ ]]; then curl -u ${APTLY_USER}:${APTLY_PASSWORD} -X POST --header "Content-Type:multipart/form-data" -F file=@${PLOC} ${APTLY_URL}/files/${DEB_NAME}; fi'
- 'if [[ $PVERSION =~ .*SNAPSHOT$ ]]; then curl -u ${APTLY_USER}:${APTLY_PASSWORD} -X POST ${APTLY_URL}/repos/indy-snapshots/file/${DEB_NAME}; fi'
- 'if [[ $PVERSION =~ .*SNAPSHOT$ ]]; then curl -u ${APTLY_USER}:${APTLY_PASSWORD} -X PUT -H "Content-Type: application/json" --data "{}" ${APTLY_URL}/publish/:./indy; fi'
PKEY: 'SNAPSHOT'
APTLY_TARGET: 'indy-snapshots'
<<: *webapp
deploy_dhcrud-webapp_dev:
only:
- develop
image: alpine:3.14
stage: deploy_deb
variables:
PNAME: 'dhcrud-webapp'
PPATH: '${PNAME}/target'
script:
- source $VARIABLES_FILE
- 'apk add --no-cache bash'
- 'apk add --no-cache curl'
- export PLOC="$(ls ./${PPATH}/*.deb)"
- DEB_NAME=$PNAME-$PVERSION.deb
- 'if [[ $PVERSION =~ .*SNAPSHOT$ ]]; then echo "---A SNAPSHOT BUILD IS BEING PERFORMED---"; fi'
- 'if [[ $PVERSION =~ .*SNAPSHOT$ ]]; then curl -u ${APTLY_USER}:${APTLY_PASSWORD} -X POST --header "Content-Type:multipart/form-data" -F file=@${PLOC} ${APTLY_URL}/files/${DEB_NAME}; fi'
- 'if [[ $PVERSION =~ .*SNAPSHOT$ ]]; then curl -u ${APTLY_USER}:${APTLY_PASSWORD} -X POST ${APTLY_URL}/repos/indy-snapshots/file/${DEB_NAME}; fi'
- 'if [[ $PVERSION =~ .*SNAPSHOT$ ]]; then curl -u ${APTLY_USER}:${APTLY_PASSWORD} -X PUT -H "Content-Type: application/json" --data "{}" ${APTLY_URL}/publish/:./indy; fi'
PKEY: 'SNAPSHOT'
APTLY_TARGET: 'indy-snapshots'
<<: *webapp
deploy_dhcrud-webapp-public_dev:
only:
- develop
image: alpine:3.14
stage: deploy_deb
variables:
PNAME: 'dhcrud-webapp-public'
PPATH: '${PNAME}/target'
script:
- source $VARIABLES_FILE
- 'apk add --no-cache bash'
- 'apk add --no-cache curl'
- export PLOC="$(ls ./${PPATH}/*.deb)"
- DEB_NAME=$PNAME-$PVERSION.deb
- 'if [[ $PVERSION =~ .*SNAPSHOT$ ]]; then echo "---A SNAPSHOT BUILD IS BEING PERFORMED---"; fi'
- 'if [[ $PVERSION =~ .*SNAPSHOT$ ]]; then curl -u ${APTLY_USER}:${APTLY_PASSWORD} -X POST --header "Content-Type:multipart/form-data" -F file=@${PLOC} ${APTLY_URL}/files/${DEB_NAME}; fi'
- 'if [[ $PVERSION =~ .*SNAPSHOT$ ]]; then curl -u ${APTLY_USER}:${APTLY_PASSWORD} -X POST ${APTLY_URL}/repos/indy-snapshots/file/${DEB_NAME}; fi'
- 'if [[ $PVERSION =~ .*SNAPSHOT$ ]]; then curl -u ${APTLY_USER}:${APTLY_PASSWORD} -X PUT -H "Content-Type: application/json" --data "{}" ${APTLY_URL}/publish/:./indy; fi'
PKEY: 'SNAPSHOT'
APTLY_TARGET: 'indy-snapshots'
<<: *webapp
deploy_tgcrud-webapp_prd:
only:
- main
image: alpine:3.14
stage: deploy_deb
variables:
PNAME: 'tgcrud-webapp'
PPATH: '${PNAME}/target'
script:
- source $VARIABLES_FILE
- 'apk add --no-cache bash'
- 'apk add --no-cache curl'
- export PLOC="$(ls ./${PPATH}/*.deb)"
- DEB_NAME=$PNAME-$PVERSION.deb
- 'if [[ $PVERSION =~ .*TG-RELEASE$ ]]; then echo "---A TGREP RELEASE BUILD IS BEING PERFORMED---"; fi'
- 'if [[ $PVERSION =~ .*TG-RELEASE$ ]]; then curl -u ${APTLY_USER}:${APTLY_PASSWORD} -X POST --header "Content-Type:multipart/form-data" -F file=@${PLOC} ${APTLY_URL}/files/${DEB_NAME}; fi'
- 'if [[ $PVERSION =~ .*TG-RELEASE$ ]]; then curl -u ${APTLY_USER}:${APTLY_PASSWORD} -X POST ${APTLY_URL}/repos/indy-releases/file/${DEB_NAME}; fi'
- 'if [[ $PVERSION =~ .*TG-RELEASE$ ]]; then curl -u ${APTLY_USER}:${APTLY_PASSWORD} -X PUT -H "Content-Type: application/json" --data "{}" ${APTLY_URL}/publish/:./indy; fi'
PKEY: 'TG-RELEASE'
APTLY_TARGET: 'indy-releases'
<<: *webapp
deploy_tgcrud-webapp-public_prd:
only:
- main
image: alpine:3.14
stage: deploy_deb
variables:
PNAME: 'tgcrud-webapp-public'
PPATH: '${PNAME}/target'
script:
- source $VARIABLES_FILE
- 'apk add --no-cache bash'
- 'apk add --no-cache curl'
- export PLOC="$(ls ./${PPATH}/*.deb)"
- DEB_NAME=$PNAME-$PVERSION.deb
- 'if [[ $PVERSION =~ .*TG-RELEASE$ ]]; then echo "---A TGREP RELEASE BUILD IS BEING PERFORMED---"; fi'
- 'if [[ $PVERSION =~ .*TG-RELEASE$ ]]; then curl -u ${APTLY_USER}:${APTLY_PASSWORD} -X POST --header "Content-Type:multipart/form-data" -F file=@${PLOC} ${APTLY_URL}/files/${DEB_NAME}; fi'
- 'if [[ $PVERSION =~ .*TG-RELEASE$ ]]; then curl -u ${APTLY_USER}:${APTLY_PASSWORD} -X POST ${APTLY_URL}/repos/indy-releases/file/${DEB_NAME}; fi'
- 'if [[ $PVERSION =~ .*TG-RELEASE$ ]]; then curl -u ${APTLY_USER}:${APTLY_PASSWORD} -X PUT -H "Content-Type: application/json" --data "{}" ${APTLY_URL}/publish/:./indy; fi'
PKEY: 'TG-RELEASE'
APTLY_TARGET: 'indy-releases'
<<: *webapp
deploy_dhcrud-webapp_prd:
only:
- main
image: alpine:3.14
stage: deploy_deb
variables:
PNAME: 'dhcrud-webapp'
PPATH: '${PNAME}/target'
script:
- source $VARIABLES_FILE
- 'apk add --no-cache bash'
- 'apk add --no-cache curl'
- export PLOC="$(ls ./${PPATH}/*.deb)"
- DEB_NAME=$PNAME-$PVERSION.deb
- 'if [[ $PVERSION =~ .*DH-RELEASE$ ]]; then echo "---A DHREP RELEASE BUILD IS BEING PERFORMED---"; fi'
- 'if [[ $PVERSION =~ .*DH-RELEASE$ ]]; then curl -u ${APTLY_USER}:${APTLY_PASSWORD} -X POST --header "Content-Type:multipart/form-data" -F file=@${PLOC} ${APTLY_URL}/files/${DEB_NAME}; fi'
- 'if [[ $PVERSION =~ .*DH-RELEASE$ ]]; then curl -u ${APTLY_USER}:${APTLY_PASSWORD} -X POST ${APTLY_URL}/repos/indy-releases/file/${DEB_NAME}; fi'
- 'if [[ $PVERSION =~ .*DH-RELEASE$ ]]; then curl -u ${APTLY_USER}:${APTLY_PASSWORD} -X PUT -H "Content-Type: application/json" --data "{}" ${APTLY_URL}/publish/:./indy; fi'
PKEY: 'DH-RELEASE'
APTLY_TARGET: 'indy-releases'
<<: *webapp
deploy_dhcrud-webapp-public_prd:
only:
- main
image: alpine:3.14
stage: deploy_deb
variables:
PNAME: 'dhcrud-webapp-public'
PPATH: '${PNAME}/target'
script:
- source $VARIABLES_FILE
- 'apk add --no-cache bash'
- 'apk add --no-cache curl'
- export PLOC="$(ls ./${PPATH}/*.deb)"
- DEB_NAME=$PNAME-$PVERSION.deb
- 'if [[ $PVERSION =~ .*DH-RELEASE$ ]]; then echo "---A DHREP RELEASE BUILD IS BEING PERFORMED---"; fi'
- 'if [[ $PVERSION =~ .*DH-RELEASE$ ]]; then curl -u ${APTLY_USER}:${APTLY_PASSWORD} -X POST --header "Content-Type:multipart/form-data" -F file=@${PLOC} ${APTLY_URL}/files/${DEB_NAME}; fi'
- 'if [[ $PVERSION =~ .*DH-RELEASE$ ]]; then curl -u ${APTLY_USER}:${APTLY_PASSWORD} -X POST ${APTLY_URL}/repos/indy-releases/file/${DEB_NAME}; fi'
- 'if [[ $PVERSION =~ .*DH-RELEASE$ ]]; then curl -u ${APTLY_USER}:${APTLY_PASSWORD} -X PUT -H "Content-Type: application/json" --data "{}" ${APTLY_URL}/publish/:./indy; fi'
PKEY: 'DH-RELEASE'
APTLY_TARGET: 'indy-releases'
<<: *webapp
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