simplify build
This commit is contained in:
parent
a437a8bc5f
commit
09a52077c3
2 changed files with 13 additions and 29 deletions
|
@ -13,25 +13,10 @@ stages:
|
|||
- .shadow-cljs/
|
||||
- .m2
|
||||
before_script:
|
||||
- echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc
|
||||
- npm install
|
||||
|
||||
.cljs-upload-job: &cljs-upload
|
||||
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
|
||||
- mkdir -p target/npm-build
|
||||
- cp target/k8s-mastodon-bot.js target/npm-build/
|
||||
- cp target/k8s-mastodon-bot.js.sha256 target/npm-build/
|
||||
- cp target/k8s-mastodon-bot.js.sha512 target/npm-build/
|
||||
- cp README.md target/npm-build/
|
||||
|
||||
.clj-uploadjob: &clj-upload
|
||||
.clj-uploadjob: &clj
|
||||
image: clojure:lein-2.7.1-alpine
|
||||
cache:
|
||||
key: ${CI_COMMIT_REF_SLUG}
|
||||
|
@ -50,6 +35,7 @@ report:
|
|||
<<: *cljs
|
||||
stage: build_and_test
|
||||
script:
|
||||
- mkdir -p target
|
||||
- shadow-cljs run shadow.cljs.build-report frontend target/build-report.html
|
||||
artifacts:
|
||||
paths:
|
||||
|
@ -60,14 +46,14 @@ package:
|
|||
stage: package
|
||||
script:
|
||||
- shadow-cljs release app
|
||||
- chmod a+x target/k8s-mastodon-bot.js
|
||||
- sha256sum target/k8s-mastodon-bot.js > target/k8s-mastodon-bot.js.sha256
|
||||
- sha512sum target/k8s-mastodon-bot.js > target/k8s-mastodon-bot.js.sha512
|
||||
- cp README.md target/npm-build/
|
||||
- cp package.json target/npm-build/
|
||||
- chmod a+x target/npm-build/k8s-mastodon-bot.js
|
||||
- sha256sum target/npm-build/k8s-mastodon-bot.js > target/npm-build/k8s-mastodon-bot.js.sha256
|
||||
- sha512sum target/npm-build/k8s-mastodon-bot.js > target/npm-build/k8s-mastodon-bot.js.sha512
|
||||
artifacts:
|
||||
paths:
|
||||
- target/k8s-mastodon-bot.js
|
||||
- target/k8s-mastodon-bot.js.sha256
|
||||
- target/k8s-mastodon-bot.js.sha512
|
||||
- target/npm-build
|
||||
|
||||
sast:
|
||||
variables:
|
||||
|
@ -81,17 +67,16 @@ include:
|
|||
- template: Security/SAST.gitlab-ci.yml
|
||||
|
||||
upload-cljs-prerelease:
|
||||
<<: *cljs-upload
|
||||
<<: *cljs
|
||||
stage: upload
|
||||
rules:
|
||||
- if: '$CI_COMMIT_BRANCH == "master" && $CI_COMMIT_TAG == null'
|
||||
script:
|
||||
- cp package.json target/npm-build/
|
||||
- sed -i 's|SNAPSHOT|'$(date +"%Y%m%d%H%M%S")'|' ./target/npm-build/package.json
|
||||
- npm publish ./target/npm-build --access public
|
||||
|
||||
upload-clj-prerelease:
|
||||
<<: *clj-upload
|
||||
<<: *clj
|
||||
stage: upload
|
||||
rules:
|
||||
- if: '$CI_COMMIT_BRANCH == "master" && $CI_COMMIT_TAG == null'
|
||||
|
@ -99,10 +84,9 @@ upload-clj-prerelease:
|
|||
- lein deploy clojars
|
||||
|
||||
upload-cljs-release:
|
||||
<<: *cljs-upload
|
||||
<<: *cljs
|
||||
stage: upload
|
||||
rules:
|
||||
- if: '$CI_COMMIT_TAG != null'
|
||||
script:
|
||||
- cp package.json target/npm-build/
|
||||
- npm publish ./target/npm-build --access public
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
:release {}
|
||||
:compiler-options {:optimizations :advanced}}
|
||||
:app {:target :node-script
|
||||
:output-to "target/k8s-mastodon-bot.js"
|
||||
:output-to "target/npm-build/k8s-mastodon-bot.js"
|
||||
:main dda.k8s-mastodon-bot.core/main
|
||||
:compiler-options {:optimizations :simple}}
|
||||
:test {:target :node-test
|
||||
|
|
Loading…
Reference in a new issue