Compare commits

...

6 commits

Author SHA1 Message Date
edb7a6697f Updating ddadevops fixed it 2023-01-20 13:04:18 +01:00
295f3893ec Use latest docker:dind 2023-01-20 12:12:41 +01:00
af1bc4a911 Fix path 2023-01-20 11:58:39 +01:00
3a7b12af09 Delete release stage 2023-01-20 11:56:30 +01:00
49a5a41e1b Mod Pipeline for quick failing tests 2023-01-20 11:54:33 +01:00
eb71d980a7 Break the test 2023-01-20 11:43:48 +01:00
2 changed files with 6 additions and 116 deletions

View file

@ -1,121 +1,11 @@
stages:
- build_and_test
- package
- security
- upload
- image
services:
- docker:19.03.12-dind
- docker:dind
.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-uploadjob: &clj
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-cljs:
<<: *cljs
stage: build_and_test
website-image-test-publish:
image: domaindrivenarchitecture/devops-build:latest
stage: image
script:
- shadow-cljs compile test
- node target/node-tests.js
test-clj:
<<: *clj
stage: build_and_test
script:
- lein test
test-schema:
<<: *clj
stage: build_and_test
script:
- lein uberjar
- java -jar target/uberjar/c4k-website-standalone.jar src/test/resources/website-test/valid-config.yaml src/test/resources/website-test/valid-auth.yaml | kubeconform --kubernetes-version 1.23.0 --strict --skip Certificate -
artifacts:
expire_in: 1h
paths:
- target/uberjar
report-frontend:
<<: *cljs
stage: package
script:
- mkdir -p target/frontend-build
- shadow-cljs run shadow.cljs.build-report frontend target/frontend-build/build-report.html
artifacts:
expire_in: 1h
paths:
- target/frontend-build/build-report.html
package-frontend:
<<: *cljs
stage: package
script:
- mkdir -p target/frontend-build
- shadow-cljs release frontend
- cp public/js/main.js target/frontend-build/c4k-website.js
- sha256sum target/frontend-build/c4k-website.js > target/frontend-build/c4k-website.js.sha256
- sha512sum target/frontend-build/c4k-website.js > target/frontend-build/c4k-website.js.sha512
artifacts:
expire_in: 1h
paths:
- target/frontend-build
package-uberjar:
<<: *clj
stage: package
script:
- lein uberjar
- sha256sum target/uberjar/c4k-website-standalone.jar > target/uberjar/c4k-website-standalone.jar.sha256
- sha512sum target/uberjar/c4k-website-standalone.jar > target/uberjar/c4k-website-standalone.jar.sha512
artifacts:
expire_in: 1h
paths:
- target/uberjar
upload-clj-release:
<<: *clj
stage: upload
rules:
- if: '$CI_COMMIT_TAG != null'
script:
- lein deploy
release:
image: registry.gitlab.com/gitlab-org/release-cli:latest
stage: upload
rules:
- if: '$CI_COMMIT_TAG != null'
artifacts:
expire_in: 24h
paths:
- target/uberjar
- target/frontend-build
script:
- apk --no-cache add curl
- |
release-cli create --name "Release $CI_COMMIT_TAG" --tag-name $CI_COMMIT_TAG \
--assets-link "{\"name\":\"c4k-website-standalone.jar\",\"url\":\"https://gitlab.com/domaindrivenarchitecture/c4k-website/-/jobs/${CI_JOB_ID}/artifacts/file/target/uberjar/c4k-website-standalone.jar\"}" \
--assets-link "{\"name\":\"c4k-website-standalone.jar.sha256\",\"url\":\"https://gitlab.com/domaindrivenarchitecture/c4k-website/-/jobs/${CI_JOB_ID}/artifacts/file/target/uberjar/c4k-website-standalone.jar.sha256\"}" \
--assets-link "{\"name\":\"c4k-website-standalone.jar.sha512\",\"url\":\"https://gitlab.com/domaindrivenarchitecture/c4k-website/-/jobs/${CI_JOB_ID}/artifacts/file/target/uberjar/c4k-website-standalone.jar.sha512\"}" \
--assets-link "{\"name\":\"c4k-website.js\",\"url\":\"https://gitlab.com/domaindrivenarchitecture/c4k-website/-/jobs/${CI_JOB_ID}/artifacts/file/target/frontend-build/c4k-website.js\"}" \
--assets-link "{\"name\":\"c4k-website.js.sha256\",\"url\":\"https://gitlab.com/domaindrivenarchitecture/c4k-website/-/jobs/${CI_JOB_ID}/artifacts/file/target/frontend-build/c4k-website.js.sha256\"}" \
--assets-link "{\"name\":\"c4k-website.js.sha512\",\"url\":\"https://gitlab.com/domaindrivenarchitecture/c4k-website/-/jobs/${CI_JOB_ID}/artifacts/file/target/frontend-build/c4k-website.js.sha512\"}" \
- cd infrastructure/c4k-website-build && pyb image test

View file

@ -12,7 +12,7 @@ class MyBuild(DevopsDockerBuild):
@init
def initialize(project):
project.build_depends_on('ddadevops>=0.12.4')
project.build_depends_on('ddadevops>=3.1.3')
stage = 'prod'
dockerhub_user = environ.get('DOCKERHUB_USER')
if not dockerhub_user: