dda-backup/.gitlab-ci.yml
2024-08-22 08:42:51 +02:00

61 lines
1.3 KiB
YAML

stages:
- build_and_test
- package
- upload
- image
.img: &img
image: "domaindrivenarchitecture/ddadevops-dind:4.13.0"
services:
- docker:dind
before_script:
- export RELEASE_ARTIFACT_TOKEN=$MEISSA_REPO_BUERO_RW
- export IMAGE_DOCKERHUB_USER=$DOCKERHUB_USER
- export IMAGE_DOCKERHUB_PASSWORD=$DOCKERHUB_PASSWORD
- export IMAGE_TAG=$CI_COMMIT_TAG
.clj-job: &clj
image: "domaindrivenarchitecture/ddadevops-clj:4.13.0"
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- .m2
before_script:
- export RELEASE_ARTIFACT_TOKEN=$MEISSA_REPO_BUERO_RW
- mkdir -p /root/.lein
- echo "{:auth {:repository-auth {#\"clojars\" {:username \"${CLOJARS_USER}\" :password \"${CLOJARS_TOKEN_DOMAINDRIVENARCHITECTURE}\" }}}}" > ~/.lein/profiles.clj
.tag_only: &tag_only
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
when: never
- if: '$CI_COMMIT_TAG =~ /^[0-9]+\.[0-9]+\.[0-9]+$/'
test:
<<: *clj
stage: build_and_test
script:
- pyb test
package-jar:
<<: *clj
stage: package
script:
- pyb package
artifacts:
paths:
- target/org.domaindrivenarchitecture
release-to-clojars:
<<: *clj
<<: *tag_only
stage: upload
script:
- pyb upload
dda-backup-image-publish:
<<: *img
<<: *tag_only
stage: image
script:
- cd infrastructure/backup && pyb image test publish