2021-05-17 07:28:01 +00:00
|
|
|
stages:
|
|
|
|
- build_and_test
|
|
|
|
- package
|
|
|
|
- security
|
|
|
|
- upload
|
|
|
|
|
|
|
|
.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
|
2021-05-28 15:54:59 +00:00
|
|
|
image: domaindrivenarchitecture/lein
|
2021-05-17 07:28:01 +00:00
|
|
|
cache:
|
|
|
|
key: ${CI_COMMIT_REF_SLUG}
|
|
|
|
paths:
|
|
|
|
- .m2
|
|
|
|
before_script:
|
2021-05-28 16:00:18 +00:00
|
|
|
- mkdir -p /root/.lein
|
2021-05-23 10:02:53 +00:00
|
|
|
- echo "{:auth {:repository-auth {#\"clojars\" {:username \"${CLOJARS_USER}\" :password \"${CLOJARS_TOKEN_DOMAINDRIVENARCHITECTURE}\" }}}}" > ~/.lein/profiles.clj
|
2021-05-17 07:28:01 +00:00
|
|
|
|
2021-06-05 15:12:01 +00:00
|
|
|
test-cljs:
|
2021-05-17 07:28:01 +00:00
|
|
|
<<: *cljs
|
|
|
|
stage: build_and_test
|
|
|
|
script:
|
|
|
|
- shadow-cljs compile test
|
|
|
|
|
|
|
|
test-clj:
|
|
|
|
<<: *clj
|
|
|
|
stage: build_and_test
|
|
|
|
script:
|
|
|
|
- lein test
|
|
|
|
|
2021-05-28 15:54:59 +00:00
|
|
|
test-schema:
|
|
|
|
<<: *clj
|
|
|
|
stage: build_and_test
|
|
|
|
script:
|
|
|
|
- lein uberjar
|
2021-06-05 15:25:03 +00:00
|
|
|
- java -jar target/uberjar/c4k-keycloak-standalone.jar valid-config.edn valid-auth.edn | kubeconform --kubernetes-version 1.19.0 --strict --skip Certificate -
|
2021-05-28 15:54:59 +00:00
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- target/uberjar
|
|
|
|
|
2021-06-18 09:50:10 +00:00
|
|
|
report-frontend:
|
2021-05-17 07:28:01 +00:00
|
|
|
<<: *cljs
|
|
|
|
stage: package
|
|
|
|
script:
|
|
|
|
- mkdir -p target/frontend-build
|
|
|
|
- shadow-cljs run shadow.cljs.build-report frontend target/frontend-build/build-report.html
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- target/frontend-build/build-report.html
|
|
|
|
|
2021-06-18 09:50:10 +00:00
|
|
|
package-frontend:
|
2021-05-17 07:28:01 +00:00
|
|
|
<<: *cljs
|
|
|
|
stage: package
|
|
|
|
script:
|
|
|
|
- mkdir -p target/frontend-build
|
|
|
|
- shadow-cljs release frontend
|
2021-06-05 15:25:03 +00:00
|
|
|
- cp public/js/main.js target/frontend-build/c4k-keycloak.js
|
|
|
|
- sha256sum target/frontend-build/c4k-keycloak.js > target/frontend-build/c4k-keycloak.js.sha256
|
|
|
|
- sha512sum target/frontend-build/c4k-keycloak.js > target/frontend-build/c4k-keycloak.js.sha512
|
2021-05-17 07:28:01 +00:00
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- target/frontend-build
|
|
|
|
|
|
|
|
package-uberjar:
|
|
|
|
<<: *clj
|
|
|
|
stage: package
|
|
|
|
script:
|
2021-06-05 15:25:03 +00:00
|
|
|
- sha256sum target/uberjar/c4k-keycloak-standalone.jar > target/uberjar/c4k-keycloak-standalone.jar.sha256
|
|
|
|
- sha512sum target/uberjar/c4k-keycloak-standalone.jar > target/uberjar/c4k-keycloak-standalone.jar.sha512
|
2021-05-17 07:28:01 +00:00
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- target/uberjar
|
|
|
|
|
|
|
|
sast:
|
|
|
|
variables:
|
|
|
|
SAST_EXCLUDED_ANALYZERS:
|
|
|
|
bandit, brakeman, flawfinder, gosec, kubesec, phpcs-security-audit,
|
|
|
|
pmd-apex, security-code-scan, sobelow, spotbugs
|
|
|
|
stage: security
|
|
|
|
before_script:
|
|
|
|
- mkdir -p builds && cp -r target/ builds/
|
|
|
|
include:
|
|
|
|
- template: Security/SAST.gitlab-ci.yml
|
|
|
|
|
2022-02-25 09:38:59 +00:00
|
|
|
upload-clj-release:
|
2021-05-17 07:28:01 +00:00
|
|
|
<<: *clj
|
|
|
|
stage: upload
|
|
|
|
rules:
|
2022-02-25 09:46:46 +00:00
|
|
|
- if: '$CI_COMMIT_TAG != null'
|
2021-05-17 07:28:01 +00:00
|
|
|
script:
|
|
|
|
- lein deploy clojars
|
|
|
|
|
|
|
|
release:
|
|
|
|
image: registry.gitlab.com/gitlab-org/release-cli:latest
|
|
|
|
stage: upload
|
|
|
|
rules:
|
|
|
|
- if: '$CI_COMMIT_TAG != null'
|
|
|
|
artifacts:
|
|
|
|
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 \
|
2021-06-05 15:25:03 +00:00
|
|
|
--assets-link "{\"name\":\"c4k-keycloak-standalone.jar\",\"url\":\"https://gitlab.com/domaindrivenarchitecture/c4k-keycloak/-/jobs/${CI_JOB_ID}/artifacts/file/target/uberjar/c4k-keycloak-standalone.jar\"}" \
|
|
|
|
--assets-link "{\"name\":\"c4k-keycloak-standalone.jar.sha256\",\"url\":\"https://gitlab.com/domaindrivenarchitecture/c4k-keycloak/-/jobs/${CI_JOB_ID}/artifacts/file/target/uberjar/c4k-keycloak-standalone.jar.sha256\"}" \
|
|
|
|
--assets-link "{\"name\":\"c4k-keycloak-standalone.jar.sha512\",\"url\":\"https://gitlab.com/domaindrivenarchitecture/c4k-keycloak/-/jobs/${CI_JOB_ID}/artifacts/file/target/uberjar/c4k-keycloak-standalone.jar.sha512\"}" \
|
|
|
|
--assets-link "{\"name\":\"c4k-keycloak.js\",\"url\":\"https://gitlab.com/domaindrivenarchitecture/c4k-keycloak/-/jobs/${CI_JOB_ID}/artifacts/file/target/frontend-build/c4k-keycloak.js\"}" \
|
|
|
|
--assets-link "{\"name\":\"c4k-keycloak.js.sha256\",\"url\":\"https://gitlab.com/domaindrivenarchitecture/c4k-keycloak/-/jobs/${CI_JOB_ID}/artifacts/file/target/frontend-build/c4k-keycloak.js.sha256\"}" \
|
2021-06-18 09:50:10 +00:00
|
|
|
--assets-link "{\"name\":\"c4k-keycloak.js.sha512\",\"url\":\"https://gitlab.com/domaindrivenarchitecture/c4k-keycloak/-/jobs/${CI_JOB_ID}/artifacts/file/target/frontend-build/c4k-keycloak.js.sha512\"}" \
|