dda-backup/.gitlab-ci.yml

62 lines
1.3 KiB
YAML
Raw Permalink Normal View History

2024-08-22 06:34:34 +00:00
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:
2024-08-22 06:42:51 +00:00
- pyb package
2024-08-22 06:34:34 +00:00
artifacts:
paths:
- target/org.domaindrivenarchitecture
release-to-clojars:
<<: *clj
<<: *tag_only
stage: upload
script:
2024-08-22 06:42:51 +00:00
- pyb upload
2024-08-22 06:34:34 +00:00
dda-backup-image-publish:
<<: *img
<<: *tag_only
stage: image
script:
- cd infrastructure/backup && pyb image test publish