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

fix: remove private repo images

parent 276beb83
Loading
Loading
Loading
Loading
Loading
+87 −45
Original line number Diff line number Diff line
@@ -12,14 +12,15 @@ 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"
  TESTCONTAINERS_HUB_IMAGE_NAME_PREFIX: "registry.ubitech.eu/nsit/maestro-apps/"
  #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: "fabric-api-jvm"
  MAVEN_REPO: "${CI_PROJECT_ROOT_NAMESPACE}/.m2/repository"
  MAVEN_OPTS: "-Dmaven.repo.local=${CI_PROJECT_ROOT_NAMESPACE}/.m2/repository"
@@ -38,17 +39,19 @@ 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:
@@ -68,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:
@@ -88,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
@@ -118,6 +127,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}
@@ -127,13 +138,15 @@ dev_package_job:
  rules:
    - if: ' $CI_PIPELINE_SOURCE == "merge_request_event"'


dev_image_build_job:
  stage: dev_image_build
  tags:
    - hypo
  image:
    name: registry.ubitech.eu/nsit/maestro-apps/docker:20.10.16
    pull_policy: [always, if-not-present]
    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:
@@ -149,20 +162,37 @@ dev_image_build_job:
    - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'



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_PEERING_IMAGE $DEV_REGISTRY_IMAGE $DEV_TELEMETRY_IMAGE $DEV_PORTAL
    - git add .
    - git config --global user.email "$GITLAB_USER_NAME"
    - git config --global user.name "$GITLAB_USER_EMAIL"
    - 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_PEERING_IMAGE $DEV_REGISTRY_IMAGE $DEV_TELEMETRY_IMAGE $DEV_PORTAL
    - 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
@@ -187,13 +217,15 @@ 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:
@@ -201,16 +233,16 @@ dev_workflows_job:




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
@@ -219,8 +251,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:
@@ -230,11 +261,15 @@ prod_extract_next_release_job:
    - main


   
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
@@ -248,29 +283,33 @@ 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 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/**
  only:
    - 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
@@ -279,8 +318,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:
@@ -289,12 +327,19 @@ prod_semantic_versioning_job:
  only:
    - main



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:
@@ -309,9 +354,6 @@ prod_image_build_and_release_job:
    - 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
  dependencies:
    - prod_semantic_versioning_job
    - prod_package_job

  only:
    - main
+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.fabric//-/issues/{{id}}"
          "issueUrlFormat": "https://labs.etsi.org/rep/osl/hypo/code/org.etsi.osl.hypo.api/fabric/-/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.fabric"
        "gitlabUrl": "https://labs.etsi.org/rep/osl/hypo/code/org.etsi.osl.hypo.api/fabric"
      }],
      ["@semantic-release/changelog",{
          "changelogFile": "./CHANGELOG.md"

CHANGELOG.md

deleted100644 → 0
+0 −512

File deleted.

Preview size limit exceeded, changes collapsed.

+1 −1
Original line number Diff line number Diff line
@@ -26,7 +26,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/1332/-/packages/maven</url>
        </repository>
    </repositories>

+2 −2
Original line number Diff line number Diff line
@@ -135,8 +135,8 @@ quarkus.datasource.db-kind=postgresql

############## SWAGGER UI PROD ################

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:v24.1.2
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:v24.1.2

# Fabric token path
fabric.vault.token-path=${FABRIC_VAULT_TOKEN_PATH:src/test/resources/tokens/vault-token-dev}