2021-06-18 14:00:26 +00:00
|
|
|
stages:
|
|
|
|
- build_and_test
|
|
|
|
- package
|
|
|
|
- security
|
|
|
|
- upload
|
|
|
|
|
2021-06-18 14:18:46 +00:00
|
|
|
.cljs-job: &cljs
|
|
|
|
image: domaindrivenarchitecture/shadow-cljs
|
|
|
|
cache:
|
|
|
|
key: ${CI_COMMIT_REF_SLUG}
|
|
|
|
paths:
|
|
|
|
- node_modules/
|
|
|
|
- .shadow-cljs/
|
|
|
|
- .m2
|
|
|
|
before_script:
|
|
|
|
- echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc
|
|
|
|
- npm install
|
|
|
|
|
|
|
|
.clj-job: &clj
|
2021-06-18 14:00:26 +00:00
|
|
|
image: domaindrivenarchitecture/lein
|
|
|
|
cache:
|
|
|
|
key: ${CI_COMMIT_REF_SLUG}
|
|
|
|
paths:
|
|
|
|
- .m2
|
|
|
|
before_script:
|
|
|
|
- mkdir -p /root/.lein
|
|
|
|
- echo "{:auth {:repository-auth {#\"clojars\" {:username \"${CLOJARS_USER}\" :password \"${CLOJARS_TOKEN_DOMAINDRIVENARCHITECTURE}\" }}}}" > ~/.lein/profiles.clj
|
|
|
|
|
|
|
|
test-clj:
|
|
|
|
<<: *clj
|
|
|
|
stage: build_and_test
|
|
|
|
script:
|
|
|
|
- lein test
|
|
|
|
|
2021-06-18 14:18:46 +00:00
|
|
|
test-cljs:
|
|
|
|
<<: *cljs
|
|
|
|
stage: build_and_test
|
|
|
|
script:
|
|
|
|
- shadow-cljs compile test
|
|
|
|
|
2021-07-09 17:50:17 +00:00
|
|
|
upload-clj-prerelease:
|
2021-06-18 14:00:26 +00:00
|
|
|
<<: *clj
|
|
|
|
stage: upload
|
|
|
|
rules:
|
2021-07-09 17:51:17 +00:00
|
|
|
- if: '$CI_COMMIT_BRANCH == "master" && $CI_COMMIT_TAG == null'
|
2021-06-18 14:00:26 +00:00
|
|
|
script:
|
|
|
|
- lein deploy clojars
|
2021-06-18 14:52:59 +00:00
|
|
|
|
2021-07-09 17:50:17 +00:00
|
|
|
upload-cljs-prerelease:
|
2021-06-18 14:52:59 +00:00
|
|
|
<<: *clj
|
|
|
|
stage: upload
|
|
|
|
rules:
|
2021-07-09 17:51:17 +00:00
|
|
|
- if: '$CI_COMMIT_BRANCH == "master" && $CI_COMMIT_TAG == null'
|
2021-06-18 14:52:59 +00:00
|
|
|
script:
|
|
|
|
- mv project.clj project-clj.clj && mv project-cljs.clj project.clj
|
|
|
|
- lein deploy clojars
|
2021-07-09 17:04:43 +00:00
|
|
|
|
|
|
|
upload-clj-release:
|
|
|
|
<<: *clj
|
|
|
|
stage: upload
|
|
|
|
rules:
|
2021-07-09 17:58:42 +00:00
|
|
|
- if: '$CI_COMMIT_TAG != null'
|
2021-07-09 17:04:43 +00:00
|
|
|
script:
|
|
|
|
- lein deploy clojars
|
|
|
|
|
|
|
|
upload-cljs-release:
|
|
|
|
<<: *clj
|
|
|
|
stage: upload
|
|
|
|
rules:
|
2021-07-09 17:58:42 +00:00
|
|
|
- if: '$CI_COMMIT_TAG != null'
|
2021-07-09 17:04:43 +00:00
|
|
|
script:
|
|
|
|
- mv project.clj project-clj.clj && mv project-cljs.clj project.clj
|
|
|
|
- lein deploy clojars
|
|
|
|
|