From bf4e8eff74c6ea83d9ba9b6aa40c24fb6541a304 Mon Sep 17 00:00:00 2001 From: Mirco Date: Fri, 5 Jul 2024 08:35:48 +0200 Subject: [PATCH] Added gitlab-ci --- .gitlab-ci.yml | 168 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 168 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..54cdf5d --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,168 @@ +stages: +# - build_and_test + - build + - test +# - package +# - security +# - upload +# - image +# - integrationtest + +.img: &img + image: "domaindrivenarchitecture/ddadevops-dind:4.12.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 + +#.cljs-job: &cljs +# image: "domaindrivenarchitecture/ddadevops-clj-cljs:4.12.1" +# cache: +# key: ${CI_COMMIT_REF_SLUG} +# paths: +# - node_modules/ +# - .shadow-cljs/ +# - .m2 +# before_script: +# - export RELEASE_ARTIFACT_TOKEN=$MEISSA_REPO_BUERO_RW +# - echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc +# - npm install + +#.clj-job: &clj +# image: "domaindrivenarchitecture/ddadevops-clj:4.12.1" +# cache: +# key: ${CI_COMMIT_REF_SLUG} +# paths: +# - .m2 +# before_script: +# - export RELEASE_ARTIFACT_TOKEN=$MEISSA_REPO_BUERO_RW +# - 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: + <<: *img + <<: *tag_only + stage: test + script: + - pyb test + +build-image: + <<: *img + <<: *tag_only + stage: build + script: + - pyb image + +#test-clj: +# <<: *clj +# stage: build_and_test +# script: +# - pyb test_clj + +#test-cljs: +# <<: *cljs +# stage: build_and_test +# script: +# - pyb test_cljs + +#test-schema: +# <<: *clj +# stage: build_and_test +# script: +# - pyb test_schema +# artifacts: +# paths: +# - target/uberjar + +#report-frontend: +# <<: *cljs +# stage: package +# script: +# - pyb report_frontend +# artifacts: +# paths: +# - target/frontend-build/build-report.html + +#package-frontend: +# <<: *cljs +# stage: package +# script: +# - pyb package_frontend +# artifacts: +# paths: +# - target/frontend-build + +#package-uberjar: +# <<: *clj +# stage: package +# script: +# - pyb package_uberjar +# artifacts: +# paths: +# - target/uberjar + +#package-native: +# <<: *clj +# stage: package +# script: +# - pyb package_native +# artifacts: +# paths: +# - target/graalvm + +#release-to-clojars: +# <<: *clj +# <<: *tag_only +# stage: upload +# script: +# - pyb upload_clj + +#release-to-forgejo: +# <<: *clj +# <<: *tag_only +# stage: upload +# script: +# - pyb publish_artifacts + +#backup-image-publish: +# <<: *img +# <<: *tag_only +# stage: image +# script: +# - cd infrastructure/backup && pyb image publish + +#nextcloud-image-publish: +# <<: *img +# <<: *tag_only +# stage: image +# script: +# - cd infrastructure/nextcloud && pyb image publish + +#.nextcloud-integrationtest: +# stage: integrationtest +# image: registry.gitlab.com/gitlab-org/cluster-integration/helm-install-image/releases/3.7.1-kube-1.20.11-alpine-3.14 +# services: +# - name: registry.gitlab.com/gitlab-org/cluster-integration/test-utils/k3s-gitlab-ci/releases/v1.22.2-k3s2 +# alias: k3s +# script: +# - apk add curl sudo bash +# - apk add wget curl bash sudo openjdk8 +# - wget -P /etc/apk/keys/ https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub +# - apk add --no-cache --repository=https://apkproxy.herokuapp.com/sgerrand/alpine-pkg-leiningen leiningen +# +# - mkdir -p ${HOME}/.kube/ +# - curl -f k3s:8081 > ${HOME}/.kube/config +# - kubectl version +# - kubectl cluster-info +# - echo "---------- Integration test -------------" +# - pwd +# - cd ./src/test/resources/local-integration-test/ && ./setup-local-s3-on-k3d.sh \ No newline at end of file