Commit ee99275b authored by Labros Papadopoulos's avatar Labros Papadopoulos Committed by Nikos Psaromanolakis
Browse files

fix: remove private repo config

parent cdf4147d
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@
                </repository>
                <repository>
                    <id>gitlab-maven</id>
                    <url>https://gitlab.ubitech.eu/api/v4/groups/maestro-v2/-/packages/maven</url>
                    <url>https://labs.etsi.org/rep/api/v4/groups/1332/-/packages/maven</url>
                </repository>
            </repositories>
        </profile>
+81 −46
Original line number Diff line number Diff line
@@ -12,13 +12,16 @@ stages:
  - prod_image_build_release

default:
  image: registry.ubitech.eu/nsit/maestro-apps/maven:3.8.3-openjdk-17
  image: labs.etsi.org:5050/osl/hypo/code/org.etsi.osl.hypo.ops/cicd/integration.tests/maven:3.8.3-openjdk-17

variables:
  DOCKER_HOST: tcp://docker:2375
  DOCKER_HOST: tcp://localhost:2375
  DOCKER_TLS_CERTDIR: ""
  DOCKER_DRIVER: overlay2
  DOCKER_API_VERSION: "1.41"
  #DOCKER_API_VERSION: "1.41"
  TESTCONTAINERS_HOST_OVERRIDE: "localhost"
  TESTCONTAINERS_HUB_IMAGE_NAME_PREFIX: "labs.etsi.org:5050/osl/hypo/code/org.etsi.osl.hypo.ops/cicd/integration.tests/"

  IMAGE_NAME: "peering-api-jvm"
  MAVEN_REPO: "${CI_PROJECT_ROOT_NAMESPACE}/.m2/repository"
  MAVEN_OPTS: "-Dmaven.repo.local=${CI_PROJECT_ROOT_NAMESPACE}/.m2/repository"
@@ -36,23 +39,24 @@ cache:

dev_tests_job:
  stage: dev_test
  image: registry.ubitech.eu/nsit/maestro-apps/maven:3.8.3-openjdk-17-slim
  tags:
    - hypo
  image: labs.etsi.org:5050/osl/hypo/code/org.etsi.osl.hypo.ops/cicd/integration.tests/maven:3.8.3-openjdk-17-slim
  services:
    - name: registry.ubitech.eu/nsit/maestro-apps/docker:20.10.16-dind
    - name: labs.etsi.org:5050/osl/hypo/code/org.etsi.osl.hypo.ops/cicd/integration.tests/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
    - echo "127.0.0.1 $(hostname)" >> /etc/hosts
    - echo "$GROUP_ACCESS_TOKEN" | docker login $HYPO_APPS_REGISTRY -u $GROUP_ACCESS_NAME --password-stdin
    - touch ~/.testcontainers.properties
    - echo "ryuk.container.privileged=true" > ~/.testcontainers.properties
  script:
    - chmod +x ./mvnw
    - rm -rf ${MAVEN_REPO}/*
    - ./mvnw ${MAVEN_CLI_OPTS} test ${MAVEN_OPTS} -U
    - ./mvnw ${MAVEN_CLI_OPTS} test ${MAVEN_OPTS}
  artifacts:
    # Upload artifacts even if job fails.
    when: always
@@ -67,11 +71,14 @@ dev_tests_job:
    - tags



dev_verify_job:
  stage: dev_verify
  image: registry.ubitech.eu/nsit/maestro-apps/maven:3.8.3-openjdk-17
  tags:
    - hypo
  image: labs.etsi.org:5050/osl/hypo/code/org.etsi.osl.hypo.ops/cicd/integration.tests/maven:3.8.3-openjdk-17
  services:
    - name: registry.ubitech.eu/nsit/maestro-apps/docker:20.10.16-dind
    - name: labs.etsi.org:5050/osl/hypo/code/org.etsi.osl.hypo.ops/cicd/integration.tests/docker:20.10.16-dind
      command: [ "--tls=false" ]
      alias: docker
  script:
@@ -87,8 +94,11 @@ dev_verify_job:
    - tags



dev_measure_quality_job:
  stage: dev_measure_quality
  tags:
    - hypo
  # Needs init_job to retrieve ENV variables.
  needs:
    - dev_tests_job
@@ -116,6 +126,8 @@ dev_measure_quality_job:

dev_package_job:
  stage: dev_package
  tags:
    - hypo
  script:
    - chmod +x ./mvnw
    - ./mvnw ${MAVEN_CLI_OPTS} clean package -DskipITs -DskipUTs -DskipTests ${MAVEN_OPTS}
@@ -128,10 +140,12 @@ dev_package_job:

dev_image_build_job:
  stage: dev_image_build
  tags:
    - hypo
  image:
    name: registry.ubitech.eu/nsit/maestro-apps/docker:20.10.16
    name: labs.etsi.org:5050/osl/hypo/code/org.etsi.osl.hypo.ops/cicd/integration.tests/docker:20.10.16
  services:
    - name: registry.ubitech.eu/nsit/maestro-apps/docker:20.10.16-dind
    - name: labs.etsi.org:5050/osl/hypo/code/org.etsi.osl.hypo.ops/cicd/integration.tests/docker:20.10.16-dind
      command: [ "--tls=false" ]
      alias: docker
  before_script:
@@ -148,21 +162,39 @@ dev_image_build_job:




dev_deploy_job:
  stage: dev_deploy
  tags:
    - hypo
  image:
    name: registry.ubitech.eu/nsit/maestro-apps/python-argocd:3.9
    name: labs.etsi.org:5050/osl/hypo/code/org.etsi.osl.hypo.ops/cicd/integration.tests/python-argocd:3.9
    pull_policy: [always, if-not-present]
  before_script:
    - git clone --depth 1 --branch gitops-cd https://oauth2:$INSTALLER_TOKEN@$INSTALLER_REPO
    - mkdir -p /tmp/bin
    - export PATH="/tmp/bin:$PATH"
    - curl -L -o /tmp/age.tar.gz https://github.com/FiloSottile/age/releases/download/v1.2.1/age-v1.2.1-linux-amd64.tar.gz
    - tar -xzf /tmp/age.tar.gz -C /tmp
    - mv /tmp/age/age /tmp/age/age-keygen /tmp/bin/
    - curl -L -o /tmp/bin/sops https://github.com/getsops/sops/releases/download/v3.10.2/sops-v3.10.2.linux.amd64
    - chmod +x /tmp/bin/sops
    - sops --version
    - age --version
    - git clone --depth 1 --branch gitops-cd https://oauth2:$GROUP_ACCESS_TOKEN@$INSTALLER_REPO
    - cd $INSTALLER_PATH
    - echo "$SOPS_AGE_KEY_PRIVATE" > ~/.sops-age-key.txt
    - chmod 600 ~/.sops-age-key.txt
    - export SOPS_AGE_KEY_FILE=~/.sops-age-key.txt

  script:
    - python3 scripts/helm_update.py $CI_REGISTRY/$CI_PROJECT_PATH/$IMAGE_NAME:$CI_COMMIT_SHORT_SHA $DEV_SONATA_CORE_IMAGE $DEV_SONATA_OSS_IMAGE $DEV_SONATA_HELM_IMAGE $DEV_ZTC_CLIENT_IMAGE $DEV_PORTAL_CART_IMAGE $DEV_TMF_API_IMAGE $DEV_REGISTRY_IMAGE $DEV_FABRIC_IMAGE $DEV_PORTAL
    - sops --decrypt charts/hypo/values-cd.enc.yaml > charts/hypo/values-cd.yaml
    - python3 scripts/helm_update_etsi.py $CI_REGISTRY/$CI_PROJECT_PATH/$IMAGE_NAME:$CI_COMMIT_SHORT_SHA $DEV_SONATA_CORE_IMAGE $DEV_SONATA_OSS_IMAGE $DEV_SONATA_HELM_IMAGE  $DEV_PORTAL_CART_IMAGE $DEV_TMF_API_IMAGE $DEV_REGISTRY_IMAGE $DEV_FABRIC_IMAGE $DEV_PORTAL
    
    - git add .
    - git config --global user.email "$GITLAB_USER_NAME"
    - git config --global user.name "$GITLAB_USER_EMAIL"
    - sops --encrypt --age $SOPS_AGE_KEY_PUBLIC charts/hypo/values-cd.yaml > charts/hypo/values-cd.enc.yaml
    - rm -f charts/hypo/values-cd.yaml ~/.sops-age-key.txt
    - git add charts/hypo/values-cd.enc.yaml
    - git config --global user.email "$GITLAB_USER_EMAIL"
    - git config --global user.name "$GITLAB_USER_NAME"

    - |
      if git commit -m "Update values.yaml for GitOps CD [skip ci]"; then
@@ -186,30 +218,30 @@ dev_deploy_job:

dev_workflows_job:
  stage: dev_workflows
  image: registry.ubitech.eu/nsit/maestro-apps/maven:3.9-eclipse-temurin-17
  tags:
    - hypo
  image: labs.etsi.org:5050/osl/hypo/code/org.etsi.osl.hypo.ops/cicd/integration.tests/maven:3.9-eclipse-temurin-17
  before_script:
    # clone the integration tests repo
    - git clone --depth 1 "https://oauth2:$INTEGRATION_TOKEN@$INTEGRATION_REPO"
    - cd org.etsi.osl.hypo.ops.cicd.integration.tests
    - git clone --depth 1 "https://oauth2:$GROUP_ACCESS_TOKEN@$INTEGRATION_REPO"
    - cd integration.tests
  script:
    - mvn -B -q test "-Dkarate.env=staging" "-Dkarate.options=--tags @smoke-e2e-workflow-private"
    - mvn -B -q test "-Dkarate.env=$KARATE_ENV" "-Dkarate.options=--tags @smoke-e2e-workflow-private"
  dependencies:
    - dev_deploy_job
  rules:
    - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'



prod_extract_next_release_job:
  image:
    name: registry.ubitech.eu/nsit/maestro-apps/node:lts
  image: labs.etsi.org:5050/osl/hypo/code/org.etsi.osl.hypo.ops/cicd/integration.tests/node:lts
  stage: prod_extract_next_release
  tags:
    - hypo
  variables:
    GITLAB_TOKEN: $GROUP_ACCESS_TOKEN
  before_script:
    - node --version
  script:
    - npx -y
    - 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
@@ -218,8 +250,7 @@ prod_extract_next_release_job:
      -p @semantic-release/changelog@6.0.2
      -p conventional-changelog-conventionalcommits@5.0.0
      -p semantic-release@19.0.5
      semantic-release --dry-run
    - DEV_RELEASE_VERSION=$(cat .next-release-version 2>/dev/null || echo "no-release")
      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:
@@ -231,9 +262,12 @@ prod_extract_next_release_job:

prod_package_job:
  stage: prod_package
  tags:
    - hypo
  dependencies:
    - prod_extract_next_release_job
  script:
    - echo "$CI_REPOSITORY_URL"
    - DEV_RELEASE_VERSION=$(cat dev_release_version.txt)
    - echo  $DEV_RELEASE_VERSION
    - if [ "$DEV_RELEASE_VERSION" = "no-release" ]; then exit 0; fi
@@ -247,14 +281,15 @@ prod_package_job:
    - 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:$GROUP_ACCESS_TOKEN@gitlab.ubitech.eu/maestro-v2/mdg-hypo/org.etsi.osl.hypo.api/org.etsi.osl.hypo.api.peering.git" HEAD:main
        git remote set-url origin "https://${GITLAB_USER_NAME}:${GROUP_ACCESS_TOKEN}@${CI_SERVER_HOST}/${CI_PROJECT_PATH}.git"
        REPO_URL="${CI_SERVER_URL}/${CI_PROJECT_PATH}.git"
        AUTH_REPO_URL="https://${GITLAB_USER_NAME}:${GROUP_ACCESS_TOKEN}@${REPO_URL#https://}"
        git remote set-url origin "$AUTH_REPO_URL"
        git push -f origin HEAD:main

      else
        echo "No changes to commit."
      fi


  artifacts:
    paths:
      - target/**
@@ -262,18 +297,17 @@ prod_package_job:
    - main



prod_semantic_versioning_job:
  image:
    name: registry.ubitech.eu/nsit/maestro-apps/node:lts
  image: labs.etsi.org:5050/osl/hypo/code/org.etsi.osl.hypo.ops/cicd/integration.tests/node:lts
  stage: prod_release
  tags:
    - hypo
  variables:
    GITLAB_TOKEN: $GROUP_ACCESS_TOKEN
  before_script:
    - git fetch origin main
    - git reset --hard origin/main
    - git pull origin HEAD
  script:
    - npx -y
    - 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
@@ -282,8 +316,7 @@ prod_semantic_versioning_job:
      -p @semantic-release/changelog@6.0.2
      -p conventional-changelog-conventionalcommits@5.0.0
      -p semantic-release@19.0.5
      semantic-release
    - RELEASE_VERSION=$(cat .next-release-version 2>/dev/null || echo "no-release")
      semantic-release | grep -oP '(?<=Published release ).*' | awk '{print $1}' || echo "no-release" )
    - echo "$RELEASE_VERSION" > release_version.txt
    - cat release_version.txt
  artifacts:
@@ -296,13 +329,15 @@ prod_semantic_versioning_job:

prod_image_build_and_release_job:
  stage: prod_image_build_release
  tags:
    - hypo
  dependencies:
    - prod_semantic_versioning_job
    - prod_package_job
  image:
    name: registry.ubitech.eu/nsit/maestro-apps/docker:20.10.16
    name: labs.etsi.org:5050/osl/hypo/code/org.etsi.osl.hypo.ops/cicd/integration.tests/docker:20.10.16
  services:
    - name: registry.ubitech.eu/nsit/maestro-apps/docker:20.10.16-dind
    - name: labs.etsi.org:5050/osl/hypo/code/org.etsi.osl.hypo.ops/cicd/integration.tests/docker:20.10.16-dind
      command: [ "--tls=false" ]
      alias: docker
  before_script:
+2 −2
Original line number Diff line number Diff line
@@ -16,12 +16,12 @@
          {"type": "perf", "hidden": true},
          {"type": "test", "hidden": true}
        ],
        "issueUrlFormat": "https://gitlab.ubitech.eu/maestro-v2/mdg-hypo/org.etsi.osl.hypo.api/org.etsi.osl.hypo.api.peering/-/issues/{{id}}"
        "issueUrlFormat": "https://labs.etsi.org/rep/osl/hypo/code/org.etsi.osl.hypo.api/peering/-/issues/{{id}}"
      }
    }],
    "@semantic-release/release-notes-generator",
    ["@semantic-release/gitlab", {
      "gitlabUrl": "https://gitlab.ubitech.eu/maestro-v2/mdg-hypo/org.etsi.osl.hypo.api/org.etsi.osl.hypo.api.peering"
      "gitlabUrl": "https://labs.etsi.org/rep/osl/hypo/code/org.etsi.osl.hypo.api/peering"
    }],
    ["@semantic-release/changelog",{
        "changelogFile": "./CHANGELOG.md"
+1 −1
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@

        <repository>
            <id>gitlab-maven</id>
            <url>https://gitlab.ubitech.eu/api/v4/groups/maestro-v2/-/packages/maven</url>
            <url>https://labs.etsi.org/rep/api/v4/groups/1330/-/packages/maven</url>
        </repository>
    </repositories>
    <dependencies>
+3 −3
Original line number Diff line number Diff line
@@ -16,9 +16,9 @@ mp.openapi.extensions.smallrye.info.contact.email=hypo@ubitech.eu
mp.openapi.extensions.smallrye.info.contact.name=HypO
mp.openapi.extensions.smallrye.info.contact.url=https://osl.etsi.org/hypo/documentation/
mp.openapi.extensions.smallrye.info.license.name=HypO
quarkus.datasource.devservices.image-name=registry.ubitech.eu/nsit/maestro-apps/postgres:14
quarkus.kafka.devservices.image-name=registry.ubitech.eu/nsit/maestro-apps/vectorized/redpanda:v22.3.4
quarkus.keycloak.devservices.image-name=registry.ubitech.eu/nsit/maestro-apps/keycloak/keycloak:22.0.3
quarkus.datasource.devservices.image-name=labs.etsi.org:5050/osl/hypo/code/org.etsi.osl.hypo.ops/cicd/integration.tests/postgres:14
quarkus.kafka.devservices.image-name=labs.etsi.org:5050/osl/hypo/code/org.etsi.osl.hypo.ops/cicd/integration.tests/vectorized/redpanda:v22.3.4
quarkus.keycloak.devservices.image-name=labs.etsi.org:5050/osl/hypo/code/org.etsi.osl.hypo.ops/cicd/integration.tests/keycloak/keycloak:22.0.3
################## PROMETHEUS METRICS ##################
quarkus.micrometer.export.json.enabled=true
quarkus.micrometer.export.prometheus.path=metrics/prometheus