Loading .ci-settings.xml 0 → 100644 +17 −0 Original line number Diff line number Diff line <settings xmlns="http://maven.apache.org/SETTINGS/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd"> <servers> <server> <id>gitlab-maven</id> <configuration> <httpHeaders> <property> <name>Job-Token</name> <value>${env.CI_JOB_TOKEN}</value> </property> </httpHeaders> </configuration> </server> </servers> </settings> .dockerignore 0 → 100644 +5 −0 Original line number Diff line number Diff line * !target/*-runner !target/*-runner.jar !target/lib/* !target/quarkus-app/* No newline at end of file .gitignore 0 → 100644 +45 −0 Original line number Diff line number Diff line #Maven target/ pom.xml.tag pom.xml.releaseBackup pom.xml.versionsBackup release.properties .flattened-pom.xml # Eclipse .project .classpath .settings/ bin/ # IntelliJ .idea *.ipr *.iml *.iws # NetBeans nb-configuration.xml # Visual Studio Code .vscode .factorypath # OSX .DS_Store # Vim *.swp *.swo # patch *.orig *.rej # Local environment .env # Plugin directory /.quarkus/cli/plugins/ # TLS Certificates .certs/ .gitlab-ci.yml 0 → 100644 +341 −0 Original line number Diff line number Diff line stages: - dev_test - dev_verify - dev_measure_quality - dev_package - dev_image_build - dev_deploy - dev_workflows - prod_extract_next_release - prod_package - prod_release - prod_image_build_release default: image: registry.ubitech.eu/nsit/maestro-apps/maven:3.8.3-openjdk-17 variables: DOCKER_HOST: tcp://docker:2375 DOCKER_TLS_CERTDIR: "" DOCKER_DRIVER: overlay2 #DEPLOYMENT_SERVER_USER: "nsit" #DEPLOYMENT_SERVER_IP: "192.168.5.44" TESTCONTAINERS_HUB_IMAGE_NAME_PREFIX: "registry.ubitech.eu/nsit/maestro-apps/" DEPLOYMENT_SERVER_IP: "192.168.5.185" DEPLOYMENT_SERVER_USER: "ubuntu" IMAGE_NAME: "maestro-portal-jvm" MAVEN_REPO: "${CI_PROJECT_ROOT_NAMESPACE}/.m2/repository" MAVEN_OPTS: "-Dmaven.repo.local=${CI_PROJECT_ROOT_NAMESPACE}/.m2/repository" COVERAGE_CONSOLIDATED_JACOCO_XML: "target/site/jacoco/jacoco.xml" SONAR_USER_HOME: "${CI_PROJECT_ROOT_NAMESPACE}/${CI_PROJECT_NAME}/.sonar" MAVEN_CLI_OPTS_SONAR: "-s .ci-settings.xml --no-transfer-progress" MAVEN_CLI_OPTS: "-s .ci-settings.xml --no-transfer-progress" HELM_INSTALLER_REPO: "gitlab.ubitech.eu/maestro-v2/installer/io.maestro.installer.orchestrator.helm.git" DEV_TMF_APIS_IMAGE: "registry.ubitech.eu/maestro-v2/api/io.maestro.api.tmf.api/tmf-api-jvm:latest" DEV_SONATA_CORE_IMAGE: "registry.ubitech.eu/maestro-v2/sonata/io.maestro.sonata.core/sonata-core-jvm:latest" DEV_SONATA_HELM_IMAGE: "registry.ubitech.eu/maestro-v2/sonata/sonata.engine.helm/helm-engine:latest" DEV_ZTC_CLIENT_IMAGE: "registry.ubitech.eu/maestro-v2/io.maestro.ztc/io.maestro.ztc.client/ztc-client:latest" DEV_SONATA_OSS_IMAGE: "registry.ubitech.eu/maestro-v2/sonata/io.maestro.sonata.oss.client/oss-client-jvm:latest" DEV_TELEMETRY_IMAGE: "registry.ubitech.eu/maestro-v2/api/io.maestro.api.telemetry/telemetry-api-jvm:latest" DEV_PEERING_IMAGE: "registry.ubitech.eu/maestro-v2/api/io.maestro.api.peering/peering-api-jvm:latest" DEV_REGISTRY_IMAGE: "registry.ubitech.eu/maestro-v2/api/io.maestro.api.registry/registry-api-jvm:latest" DEV_FABRIC_IMAGE: "registry.ubitech.eu/maestro-v2/api/io.maestro.api.fabric/fabric-api-jvm:latest" DEV_PORTAL: "registry.ubitech.eu/maestro-v2/io.maestro.portal/maestro-portal/maestro-portal:latest" cache: key: "${CI_PROJECT_ROOT_NAMESPACE}" paths: - .m2/repository/ - ${SONAR_USER_HOME}/cache dev_tests_job: stage: dev_test image: registry.ubitech.eu/nsit/maestro-apps/maven:3.8.3-openjdk-17-slim services: - name: registry.ubitech.eu/nsit/maestro-apps/docker:20.10.16-dind command: [ "--tls=false" ] alias: docker before_script: - curl -fsSL https://get.docker.com -o get-docker.sh - chmod +x ./get-docker.sh - ./get-docker.sh - docker info - echo "$MAESTRO_APPS_TOKEN" | docker login $MAESTRO_APPS_REGISTRY -u $MAESTRO_APPS_USER --password-stdin - touch ~/.testcontainers.properties - echo "ryuk.container.privileged=true" > ~/.testcontainers.properties script: - chmod +x ./mvnw - ./mvnw ${MAVEN_CLI_OPTS} test ${MAVEN_OPTS} artifacts: # Upload artifacts even if job fails. when: always paths: - target/jacoco.exec expire_in: 1 hour reports: junit: - target/surefire-reports/TEST-*.xml except: - main - tags dev_verify_job: stage: dev_verify image: registry.ubitech.eu/nsit/maestro-apps/maven:3.8.3-openjdk-17 services: - name: registry.ubitech.eu/nsit/maestro-apps/docker:20.10.16-dind command: [ "--tls=false" ] alias: docker script: - chmod +x ./mvnw - ./mvnw ${MAVEN_CLI_OPTS} post-integration-test failsafe:verify -DskipUTs ${MAVEN_OPTS} artifacts: paths: - target/** dependencies: - dev_tests_job except: - main - tags dev_measure_quality_job: stage: dev_measure_quality # Needs init_job to retrieve ENV variables. needs: - dev_tests_job - dev_verify_job dependencies: - dev_tests_job - dev_verify_job # As per https://docs.sonarqube.org/8.8/analysis/gitlab-integration/ variables: GIT_DEPTH: "0" # Tells git to fetch all the branches of the project, required by the analysis task script: # -Dsonar.qualitygate.wait=true fails the build if SonarQube quality gate fails - mvn ${MAVEN_CLI_OPTS_SONAR} verify sonar:sonar -Pgenerate-consolidated-coverage -DskipUTs -DskipITs -Dsonar.qualitygate.wait=true - cat target/site/jacoco/index.html | grep -o 'Total[^%]*%' | sed 's/<.*>/ /; s/Total/JaCoCo Coverage Total:/' allow_failure: true coverage: '/JaCoCo Coverage Total: ([0-9]{1,3})%/' artifacts: when: always paths: - ${COVERAGE_CONSOLIDATED_JACOCO_XML} expire_in: 1 day except: - tags - main dev_package_job: stage: dev_package script: - chmod +x ./mvnw - ./mvnw ${MAVEN_CLI_OPTS} clean package -DskipITs -DskipUTs -DskipTests ${MAVEN_OPTS} artifacts: paths: - target/** rules: - if: ' $CI_PIPELINE_SOURCE == "merge_request_event"' dev_image_build_job: stage: dev_image_build image: name: registry.ubitech.eu/nsit/maestro-apps/docker:20.10.16 services: - name: registry.ubitech.eu/nsit/maestro-apps/docker:20.10.16-dind command: [ "--tls=false" ] alias: docker before_script: - docker info > /dev/null script: - echo -n $CI_REGISTRY_PASSWORD | docker login -u $CI_REGISTRY_USER --password-stdin $CI_REGISTRY - docker build -t $CI_REGISTRY/$CI_PROJECT_PATH/$IMAGE_NAME:$CI_COMMIT_SHORT_SHA -f src/main/docker/Dockerfile.jvm . - IMAGE_ID=$(docker images | grep $CI_REGISTRY/$CI_PROJECT_PATH\/$IMAGE_NAME | awk '{print $3}') - docker push $CI_REGISTRY/$CI_PROJECT_PATH/$IMAGE_NAME:$CI_COMMIT_SHORT_SHA dependencies: - dev_package_job rules: - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' dev_deploy_job: stage: dev_deploy image: name: registry.ubitech.eu/nsit/maestro-apps/python:3.9 before_script: - apt-get update && apt-get install -y curl && apt-get install -y jq - python3 -m pip install ruamel.yaml - curl -sSL -o argocd-linux-amd64 https://github.com/argoproj/argo-cd/releases/download/v2.13.5/argocd-linux-amd64 - install -m 555 argocd-linux-amd64 /usr/local/bin/argocd - git clone https://oauth2:$INSTALLER_TOKEN@gitlab.ubitech.eu/maestro-v2/installer/io.maestro.installer.orchestrator.helm.git - cd io.maestro.installer.orchestrator.helm - git checkout gitops-cd - git pull origin gitops-cd script: - python3 scripts/helm_update.py $CI_REGISTRY/$CI_PROJECT_PATH/$IMAGE_NAME:$CI_COMMIT_SHORT_SHA $DEV_TMF_APIS_IMAGE $DEV_SONATA_CORE_IMAGE $DEV_SONATA_HELM_IMAGE $DEV_ZTC_CLIENT_IMAGE $DEV_SONATA_OSS_IMAGE $DEV_TELEMETRY_IMAGE $DEV_PEERING_IMAGE $DEV_REGISTRY_IMAGE $DEV_FABRIC_IMAGE $DEV_PORTAL - git add . - git config --global user.email "avalantasis@ubitech.eu" - git config --global user.name "avalantasis" - | if git commit -m "Update values.yaml for GitOps CD [skip ci]"; then git push origin gitops-cd else echo "No changes to commit." fi - | argocd login $ARGOCD_SERVER --username $ARGOCD_USERNAME --password $ARGOCD_PASSWORD --insecure argocd app sync maestro --timeout 300 APP_STATUS=$(argocd app get maestro -o json | jq -r '.status.health.status') if [ "$APP_STATUS" != "Healthy" ]; then echo "Argo CD application 'maestro' is not healthy. Current status: $APP_STATUS" exit 1 fi echo "Argo CD application 'maestro' is healthy." dependencies: - dev_image_build_job rules: - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' dev_workflows_job: stage: dev_workflows image: name: registry.ubitech.eu/nsit/maestro-apps/docker:20.10.16 services: - name: registry.ubitech.eu/nsit/maestro-apps/docker:20.10.16-dind command: [ "--tls=false" ] alias: docker before_script: - docker info > /dev/null - apk update && apk add git - git clone https://oauth2:$COLLECTION_TOKEN@gitlab.ubitech.eu/maestro-v2/io.maestro.cd/io.maestro.cd.collections.git - cp io.maestro.cd.collections/files/collection.json . - cp io.maestro.cd.collections/files/env.json . - echo "$MAESTRO_APPS_TOKEN" | docker login $MAESTRO_APPS_REGISTRY -u $MAESTRO_APPS_USER --password-stdin script: #- sleep 120 - ls -l - docker run -v $(pwd):/etc/newman -t registry.ubitech.eu/nsit/maestro-apps/postman/newman:latest run /etc/newman/collection.json --environment /etc/newman/env.json dependencies: - dev_deploy_job rules: - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' prod_extract_next_release_job: image: registry.ubitech.eu/nsit/maestro-apps/node:lts stage: prod_extract_next_release variables: GITLAB_TOKEN: $GITLAB_TOKEN_SEMANTIC_VERSIONING script: - DEV_RELEASE_VERSION=$(npx -y -p @semantic-release/commit-analyzer@9.0.2 -p @semantic-release/git@10.0.1 -p @semantic-release/gitlab@9.5.0 -p @semantic-release/release-notes-generator@10.0.3 -p @semantic-release/exec@6.0.3 -p @semantic-release/changelog@6.0.2 -p conventional-changelog-conventionalcommits@5.0.0 -p semantic-release@19.0.5 semantic-release --dry-run | grep -oP '(?<=Published release ).*' | awk '{print $1}' || echo "no-release" ) - echo "$DEV_RELEASE_VERSION" > dev_release_version.txt - cat dev_release_version.txt artifacts: paths: - dev_release_version.txt only: - main prod_package_job: stage: prod_package dependencies: - prod_extract_next_release_job script: - DEV_RELEASE_VERSION=$(cat dev_release_version.txt) - echo $DEV_RELEASE_VERSION - if [ "$DEV_RELEASE_VERSION" = "no-release" ]; then exit 0; fi - chmod +x ./mvnw - ./mvnw ${MAVEN_CLI_OPTS} -q versions:set -DnewVersion=$DEV_RELEASE_VERSION - ./mvnw ${MAVEN_CLI_OPTS} -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive exec:exec - ./mvnw ${MAVEN_CLI_OPTS} clean package -DskipITs -DskipUTs -DskipTests ${MAVEN_OPTS} - git add pom.xml - git status - git config --global user.email $GITLAB_USER_EMAIL - git config --global user.name $GITLAB_USER_NAME - | if git commit -m "Release $DEV_RELEASE_VERSION: Update project version [skip ci]"; then git push -f "https://$GITLAB_USER_NAME:$GITLAB_TOKEN_SEMANTIC_VERSIONING@gitlab.ubitech.eu/maestro-v2/mdg-hypo/org.etsi.osl.hypo.portal/org.etsi.osl.hypo.portal.cart" HEAD:main else echo "No changes to commit." fi artifacts: paths: - target/** only: - main prod_semantic_versioning_job: image: registry.ubitech.eu/nsit/maestro-apps/node:lts stage: prod_release variables: GITLAB_TOKEN: $GITLAB_TOKEN_SEMANTIC_VERSIONING before_script: - git pull origin HEAD script: - RELEASE_VERSION=$(npx -y -p @semantic-release/commit-analyzer@9.0.2 -p @semantic-release/git@10.0.1 -p @semantic-release/gitlab@9.5.0 -p @semantic-release/release-notes-generator@10.0.3 -p @semantic-release/exec@6.0.3 -p @semantic-release/changelog@6.0.2 -p conventional-changelog-conventionalcommits@5.0.0 -p semantic-release@19.0.5 semantic-release | grep -oP '(?<=Published release ).*' | awk '{print $1}' || echo "no-release" ) - echo "$RELEASE_VERSION" > release_version.txt - cat release_version.txt artifacts: paths: - release_version.txt only: - main prod_image_build_and_release_job: stage: prod_image_build_release dependencies: - prod_semantic_versioning_job - prod_package_job image: name: registry.ubitech.eu/nsit/maestro-apps/docker:20.10.16 services: - name: registry.ubitech.eu/nsit/maestro-apps/docker:20.10.16-dind command: [ "--tls=false" ] alias: docker before_script: - docker info > /dev/null - RELEASE_VERSION=$(cat release_version.txt) - echo $RELEASE_VERSION - if [ "$RELEASE_VERSION" = "no-release" ]; then exit 0; fi script: - echo -n $CI_REGISTRY_PASSWORD | docker login -u $CI_REGISTRY_USER --password-stdin $CI_REGISTRY - docker build -t $CI_REGISTRY/$CI_PROJECT_PATH/$IMAGE_NAME:latest -f src/main/docker/Dockerfile.jvm . - IMAGE_ID=$(docker images | grep $CI_REGISTRY/$CI_PROJECT_PATH\/$IMAGE_NAME | awk '{print $3}') - docker tag $IMAGE_ID $CI_REGISTRY/$CI_PROJECT_PATH/$IMAGE_NAME:$RELEASE_VERSION - docker push $CI_REGISTRY/$CI_PROJECT_PATH/$IMAGE_NAME:latest - docker push $CI_REGISTRY/$CI_PROJECT_PATH/$IMAGE_NAME:$RELEASE_VERSION only: - main .mvn/wrapper/.gitignore 0 → 100644 +1 −0 Original line number Diff line number Diff line maven-wrapper.jar Loading
.ci-settings.xml 0 → 100644 +17 −0 Original line number Diff line number Diff line <settings xmlns="http://maven.apache.org/SETTINGS/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd"> <servers> <server> <id>gitlab-maven</id> <configuration> <httpHeaders> <property> <name>Job-Token</name> <value>${env.CI_JOB_TOKEN}</value> </property> </httpHeaders> </configuration> </server> </servers> </settings>
.dockerignore 0 → 100644 +5 −0 Original line number Diff line number Diff line * !target/*-runner !target/*-runner.jar !target/lib/* !target/quarkus-app/* No newline at end of file
.gitignore 0 → 100644 +45 −0 Original line number Diff line number Diff line #Maven target/ pom.xml.tag pom.xml.releaseBackup pom.xml.versionsBackup release.properties .flattened-pom.xml # Eclipse .project .classpath .settings/ bin/ # IntelliJ .idea *.ipr *.iml *.iws # NetBeans nb-configuration.xml # Visual Studio Code .vscode .factorypath # OSX .DS_Store # Vim *.swp *.swo # patch *.orig *.rej # Local environment .env # Plugin directory /.quarkus/cli/plugins/ # TLS Certificates .certs/
.gitlab-ci.yml 0 → 100644 +341 −0 Original line number Diff line number Diff line stages: - dev_test - dev_verify - dev_measure_quality - dev_package - dev_image_build - dev_deploy - dev_workflows - prod_extract_next_release - prod_package - prod_release - prod_image_build_release default: image: registry.ubitech.eu/nsit/maestro-apps/maven:3.8.3-openjdk-17 variables: DOCKER_HOST: tcp://docker:2375 DOCKER_TLS_CERTDIR: "" DOCKER_DRIVER: overlay2 #DEPLOYMENT_SERVER_USER: "nsit" #DEPLOYMENT_SERVER_IP: "192.168.5.44" TESTCONTAINERS_HUB_IMAGE_NAME_PREFIX: "registry.ubitech.eu/nsit/maestro-apps/" DEPLOYMENT_SERVER_IP: "192.168.5.185" DEPLOYMENT_SERVER_USER: "ubuntu" IMAGE_NAME: "maestro-portal-jvm" MAVEN_REPO: "${CI_PROJECT_ROOT_NAMESPACE}/.m2/repository" MAVEN_OPTS: "-Dmaven.repo.local=${CI_PROJECT_ROOT_NAMESPACE}/.m2/repository" COVERAGE_CONSOLIDATED_JACOCO_XML: "target/site/jacoco/jacoco.xml" SONAR_USER_HOME: "${CI_PROJECT_ROOT_NAMESPACE}/${CI_PROJECT_NAME}/.sonar" MAVEN_CLI_OPTS_SONAR: "-s .ci-settings.xml --no-transfer-progress" MAVEN_CLI_OPTS: "-s .ci-settings.xml --no-transfer-progress" HELM_INSTALLER_REPO: "gitlab.ubitech.eu/maestro-v2/installer/io.maestro.installer.orchestrator.helm.git" DEV_TMF_APIS_IMAGE: "registry.ubitech.eu/maestro-v2/api/io.maestro.api.tmf.api/tmf-api-jvm:latest" DEV_SONATA_CORE_IMAGE: "registry.ubitech.eu/maestro-v2/sonata/io.maestro.sonata.core/sonata-core-jvm:latest" DEV_SONATA_HELM_IMAGE: "registry.ubitech.eu/maestro-v2/sonata/sonata.engine.helm/helm-engine:latest" DEV_ZTC_CLIENT_IMAGE: "registry.ubitech.eu/maestro-v2/io.maestro.ztc/io.maestro.ztc.client/ztc-client:latest" DEV_SONATA_OSS_IMAGE: "registry.ubitech.eu/maestro-v2/sonata/io.maestro.sonata.oss.client/oss-client-jvm:latest" DEV_TELEMETRY_IMAGE: "registry.ubitech.eu/maestro-v2/api/io.maestro.api.telemetry/telemetry-api-jvm:latest" DEV_PEERING_IMAGE: "registry.ubitech.eu/maestro-v2/api/io.maestro.api.peering/peering-api-jvm:latest" DEV_REGISTRY_IMAGE: "registry.ubitech.eu/maestro-v2/api/io.maestro.api.registry/registry-api-jvm:latest" DEV_FABRIC_IMAGE: "registry.ubitech.eu/maestro-v2/api/io.maestro.api.fabric/fabric-api-jvm:latest" DEV_PORTAL: "registry.ubitech.eu/maestro-v2/io.maestro.portal/maestro-portal/maestro-portal:latest" cache: key: "${CI_PROJECT_ROOT_NAMESPACE}" paths: - .m2/repository/ - ${SONAR_USER_HOME}/cache dev_tests_job: stage: dev_test image: registry.ubitech.eu/nsit/maestro-apps/maven:3.8.3-openjdk-17-slim services: - name: registry.ubitech.eu/nsit/maestro-apps/docker:20.10.16-dind command: [ "--tls=false" ] alias: docker before_script: - curl -fsSL https://get.docker.com -o get-docker.sh - chmod +x ./get-docker.sh - ./get-docker.sh - docker info - echo "$MAESTRO_APPS_TOKEN" | docker login $MAESTRO_APPS_REGISTRY -u $MAESTRO_APPS_USER --password-stdin - touch ~/.testcontainers.properties - echo "ryuk.container.privileged=true" > ~/.testcontainers.properties script: - chmod +x ./mvnw - ./mvnw ${MAVEN_CLI_OPTS} test ${MAVEN_OPTS} artifacts: # Upload artifacts even if job fails. when: always paths: - target/jacoco.exec expire_in: 1 hour reports: junit: - target/surefire-reports/TEST-*.xml except: - main - tags dev_verify_job: stage: dev_verify image: registry.ubitech.eu/nsit/maestro-apps/maven:3.8.3-openjdk-17 services: - name: registry.ubitech.eu/nsit/maestro-apps/docker:20.10.16-dind command: [ "--tls=false" ] alias: docker script: - chmod +x ./mvnw - ./mvnw ${MAVEN_CLI_OPTS} post-integration-test failsafe:verify -DskipUTs ${MAVEN_OPTS} artifacts: paths: - target/** dependencies: - dev_tests_job except: - main - tags dev_measure_quality_job: stage: dev_measure_quality # Needs init_job to retrieve ENV variables. needs: - dev_tests_job - dev_verify_job dependencies: - dev_tests_job - dev_verify_job # As per https://docs.sonarqube.org/8.8/analysis/gitlab-integration/ variables: GIT_DEPTH: "0" # Tells git to fetch all the branches of the project, required by the analysis task script: # -Dsonar.qualitygate.wait=true fails the build if SonarQube quality gate fails - mvn ${MAVEN_CLI_OPTS_SONAR} verify sonar:sonar -Pgenerate-consolidated-coverage -DskipUTs -DskipITs -Dsonar.qualitygate.wait=true - cat target/site/jacoco/index.html | grep -o 'Total[^%]*%' | sed 's/<.*>/ /; s/Total/JaCoCo Coverage Total:/' allow_failure: true coverage: '/JaCoCo Coverage Total: ([0-9]{1,3})%/' artifacts: when: always paths: - ${COVERAGE_CONSOLIDATED_JACOCO_XML} expire_in: 1 day except: - tags - main dev_package_job: stage: dev_package script: - chmod +x ./mvnw - ./mvnw ${MAVEN_CLI_OPTS} clean package -DskipITs -DskipUTs -DskipTests ${MAVEN_OPTS} artifacts: paths: - target/** rules: - if: ' $CI_PIPELINE_SOURCE == "merge_request_event"' dev_image_build_job: stage: dev_image_build image: name: registry.ubitech.eu/nsit/maestro-apps/docker:20.10.16 services: - name: registry.ubitech.eu/nsit/maestro-apps/docker:20.10.16-dind command: [ "--tls=false" ] alias: docker before_script: - docker info > /dev/null script: - echo -n $CI_REGISTRY_PASSWORD | docker login -u $CI_REGISTRY_USER --password-stdin $CI_REGISTRY - docker build -t $CI_REGISTRY/$CI_PROJECT_PATH/$IMAGE_NAME:$CI_COMMIT_SHORT_SHA -f src/main/docker/Dockerfile.jvm . - IMAGE_ID=$(docker images | grep $CI_REGISTRY/$CI_PROJECT_PATH\/$IMAGE_NAME | awk '{print $3}') - docker push $CI_REGISTRY/$CI_PROJECT_PATH/$IMAGE_NAME:$CI_COMMIT_SHORT_SHA dependencies: - dev_package_job rules: - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' dev_deploy_job: stage: dev_deploy image: name: registry.ubitech.eu/nsit/maestro-apps/python:3.9 before_script: - apt-get update && apt-get install -y curl && apt-get install -y jq - python3 -m pip install ruamel.yaml - curl -sSL -o argocd-linux-amd64 https://github.com/argoproj/argo-cd/releases/download/v2.13.5/argocd-linux-amd64 - install -m 555 argocd-linux-amd64 /usr/local/bin/argocd - git clone https://oauth2:$INSTALLER_TOKEN@gitlab.ubitech.eu/maestro-v2/installer/io.maestro.installer.orchestrator.helm.git - cd io.maestro.installer.orchestrator.helm - git checkout gitops-cd - git pull origin gitops-cd script: - python3 scripts/helm_update.py $CI_REGISTRY/$CI_PROJECT_PATH/$IMAGE_NAME:$CI_COMMIT_SHORT_SHA $DEV_TMF_APIS_IMAGE $DEV_SONATA_CORE_IMAGE $DEV_SONATA_HELM_IMAGE $DEV_ZTC_CLIENT_IMAGE $DEV_SONATA_OSS_IMAGE $DEV_TELEMETRY_IMAGE $DEV_PEERING_IMAGE $DEV_REGISTRY_IMAGE $DEV_FABRIC_IMAGE $DEV_PORTAL - git add . - git config --global user.email "avalantasis@ubitech.eu" - git config --global user.name "avalantasis" - | if git commit -m "Update values.yaml for GitOps CD [skip ci]"; then git push origin gitops-cd else echo "No changes to commit." fi - | argocd login $ARGOCD_SERVER --username $ARGOCD_USERNAME --password $ARGOCD_PASSWORD --insecure argocd app sync maestro --timeout 300 APP_STATUS=$(argocd app get maestro -o json | jq -r '.status.health.status') if [ "$APP_STATUS" != "Healthy" ]; then echo "Argo CD application 'maestro' is not healthy. Current status: $APP_STATUS" exit 1 fi echo "Argo CD application 'maestro' is healthy." dependencies: - dev_image_build_job rules: - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' dev_workflows_job: stage: dev_workflows image: name: registry.ubitech.eu/nsit/maestro-apps/docker:20.10.16 services: - name: registry.ubitech.eu/nsit/maestro-apps/docker:20.10.16-dind command: [ "--tls=false" ] alias: docker before_script: - docker info > /dev/null - apk update && apk add git - git clone https://oauth2:$COLLECTION_TOKEN@gitlab.ubitech.eu/maestro-v2/io.maestro.cd/io.maestro.cd.collections.git - cp io.maestro.cd.collections/files/collection.json . - cp io.maestro.cd.collections/files/env.json . - echo "$MAESTRO_APPS_TOKEN" | docker login $MAESTRO_APPS_REGISTRY -u $MAESTRO_APPS_USER --password-stdin script: #- sleep 120 - ls -l - docker run -v $(pwd):/etc/newman -t registry.ubitech.eu/nsit/maestro-apps/postman/newman:latest run /etc/newman/collection.json --environment /etc/newman/env.json dependencies: - dev_deploy_job rules: - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' prod_extract_next_release_job: image: registry.ubitech.eu/nsit/maestro-apps/node:lts stage: prod_extract_next_release variables: GITLAB_TOKEN: $GITLAB_TOKEN_SEMANTIC_VERSIONING script: - DEV_RELEASE_VERSION=$(npx -y -p @semantic-release/commit-analyzer@9.0.2 -p @semantic-release/git@10.0.1 -p @semantic-release/gitlab@9.5.0 -p @semantic-release/release-notes-generator@10.0.3 -p @semantic-release/exec@6.0.3 -p @semantic-release/changelog@6.0.2 -p conventional-changelog-conventionalcommits@5.0.0 -p semantic-release@19.0.5 semantic-release --dry-run | grep -oP '(?<=Published release ).*' | awk '{print $1}' || echo "no-release" ) - echo "$DEV_RELEASE_VERSION" > dev_release_version.txt - cat dev_release_version.txt artifacts: paths: - dev_release_version.txt only: - main prod_package_job: stage: prod_package dependencies: - prod_extract_next_release_job script: - DEV_RELEASE_VERSION=$(cat dev_release_version.txt) - echo $DEV_RELEASE_VERSION - if [ "$DEV_RELEASE_VERSION" = "no-release" ]; then exit 0; fi - chmod +x ./mvnw - ./mvnw ${MAVEN_CLI_OPTS} -q versions:set -DnewVersion=$DEV_RELEASE_VERSION - ./mvnw ${MAVEN_CLI_OPTS} -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive exec:exec - ./mvnw ${MAVEN_CLI_OPTS} clean package -DskipITs -DskipUTs -DskipTests ${MAVEN_OPTS} - git add pom.xml - git status - git config --global user.email $GITLAB_USER_EMAIL - git config --global user.name $GITLAB_USER_NAME - | if git commit -m "Release $DEV_RELEASE_VERSION: Update project version [skip ci]"; then git push -f "https://$GITLAB_USER_NAME:$GITLAB_TOKEN_SEMANTIC_VERSIONING@gitlab.ubitech.eu/maestro-v2/mdg-hypo/org.etsi.osl.hypo.portal/org.etsi.osl.hypo.portal.cart" HEAD:main else echo "No changes to commit." fi artifacts: paths: - target/** only: - main prod_semantic_versioning_job: image: registry.ubitech.eu/nsit/maestro-apps/node:lts stage: prod_release variables: GITLAB_TOKEN: $GITLAB_TOKEN_SEMANTIC_VERSIONING before_script: - git pull origin HEAD script: - RELEASE_VERSION=$(npx -y -p @semantic-release/commit-analyzer@9.0.2 -p @semantic-release/git@10.0.1 -p @semantic-release/gitlab@9.5.0 -p @semantic-release/release-notes-generator@10.0.3 -p @semantic-release/exec@6.0.3 -p @semantic-release/changelog@6.0.2 -p conventional-changelog-conventionalcommits@5.0.0 -p semantic-release@19.0.5 semantic-release | grep -oP '(?<=Published release ).*' | awk '{print $1}' || echo "no-release" ) - echo "$RELEASE_VERSION" > release_version.txt - cat release_version.txt artifacts: paths: - release_version.txt only: - main prod_image_build_and_release_job: stage: prod_image_build_release dependencies: - prod_semantic_versioning_job - prod_package_job image: name: registry.ubitech.eu/nsit/maestro-apps/docker:20.10.16 services: - name: registry.ubitech.eu/nsit/maestro-apps/docker:20.10.16-dind command: [ "--tls=false" ] alias: docker before_script: - docker info > /dev/null - RELEASE_VERSION=$(cat release_version.txt) - echo $RELEASE_VERSION - if [ "$RELEASE_VERSION" = "no-release" ]; then exit 0; fi script: - echo -n $CI_REGISTRY_PASSWORD | docker login -u $CI_REGISTRY_USER --password-stdin $CI_REGISTRY - docker build -t $CI_REGISTRY/$CI_PROJECT_PATH/$IMAGE_NAME:latest -f src/main/docker/Dockerfile.jvm . - IMAGE_ID=$(docker images | grep $CI_REGISTRY/$CI_PROJECT_PATH\/$IMAGE_NAME | awk '{print $3}') - docker tag $IMAGE_ID $CI_REGISTRY/$CI_PROJECT_PATH/$IMAGE_NAME:$RELEASE_VERSION - docker push $CI_REGISTRY/$CI_PROJECT_PATH/$IMAGE_NAME:latest - docker push $CI_REGISTRY/$CI_PROJECT_PATH/$IMAGE_NAME:$RELEASE_VERSION only: - main
.mvn/wrapper/.gitignore 0 → 100644 +1 −0 Original line number Diff line number Diff line maven-wrapper.jar