64 lines
1.5 KiB
YAML
64 lines
1.5 KiB
YAML
stages:
|
|
- build_and_test
|
|
- package
|
|
- upload
|
|
- image
|
|
|
|
.img: &img
|
|
image: "domaindrivenarchitecture/ddadevops-dind:4.13.1"
|
|
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.1"
|
|
cache:
|
|
key: ${CI_COMMIT_REF_SLUG}
|
|
paths:
|
|
- .m2
|
|
before_script:
|
|
- export RELEASE_ARTIFACT_TOKEN=$MEISSA_REPO_BUERO_RW
|
|
- curl -L -O https://github.com/clojure/brew-install/releases/latest/download/linux-install.sh
|
|
- chmod +x linux-install.sh
|
|
- ./linux-install.sh
|
|
- 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
|