Loading .gitlab-ci.yml +19 −27 Original line number Diff line number Diff line Loading @@ -15,11 +15,10 @@ default: 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://localhost:2375 DOCKER_TLS_CERTDIR: "" DOCKER_HOST: unix:///var/run/docker.sock DOCKER_DRIVER: overlay2 #DOCKER_API_VERSION: "1.41" TESTCONTAINERS_HOST_OVERRIDE: "localhost" TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE: "/var/run/docker.sock" TESTCONTAINERS_HUB_IMAGE_NAME_PREFIX: "labs.etsi.org:5050/osl/hypo/code/org.etsi.osl.hypo.ops/cicd/integration.tests/" IMAGE_NAME: "telemetry-api-jvm" MAVEN_REPO: "${CI_PROJECT_ROOT_NAMESPACE}/.m2/repository" Loading @@ -41,22 +40,26 @@ dev_tests_job: 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: 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 "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 - | cat > ~/.testcontainers.properties <<EOF ryuk.container.privileged=true docker.host=unix:///var/run/docker.sock EOF - | cat > ~/.docker-java.properties <<EOF api.version=1.44 docker.host=unix:///var/run/docker.sock EOF script: - chmod +x ./mvnw - ./mvnw ${MAVEN_CLI_OPTS} test ${MAVEN_OPTS} - ./mvnw ${MAVEN_CLI_OPTS} test ${MAVEN_OPTS} -Dapi.version=1.44 -Ddocker.host=unix:///var/run/docker.sock artifacts: # Upload artifacts even if job fails. when: always Loading @@ -71,15 +74,12 @@ dev_tests_job: - tags dev_verify_job: stage: dev_verify 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: 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: - chmod +x ./mvnw - ./mvnw ${MAVEN_CLI_OPTS} post-integration-test failsafe:verify -DskipUTs ${MAVEN_OPTS} Loading Loading @@ -140,17 +140,13 @@ dev_image_build_job: tags: - hypo image: name: labs.etsi.org:5050/osl/hypo/code/org.etsi.osl.hypo.ops/cicd/integration.tests/docker:20.10.16 name: labs.etsi.org:5050/osl/hypo/code/org.etsi.osl.hypo.ops/cicd/integration.tests/docker:29.1.3 pull_policy: [always, if-not-present] services: - 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: - 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 . - docker build --network host --pull -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: Loading Loading @@ -332,11 +328,7 @@ prod_image_build_and_release_job: - prod_semantic_versioning_job - prod_package_job image: name: labs.etsi.org:5050/osl/hypo/code/org.etsi.osl.hypo.ops/cicd/integration.tests/docker:20.10.16 services: - 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 name: labs.etsi.org:5050/osl/hypo/code/org.etsi.osl.hypo.ops/cicd/integration.tests/docker:29.1.3 before_script: - docker info > /dev/null - RELEASE_VERSION=$(cat release_version.txt) Loading @@ -344,7 +336,7 @@ prod_image_build_and_release_job: - 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 . - docker build --network host --pull -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 Loading Loading
.gitlab-ci.yml +19 −27 Original line number Diff line number Diff line Loading @@ -15,11 +15,10 @@ default: 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://localhost:2375 DOCKER_TLS_CERTDIR: "" DOCKER_HOST: unix:///var/run/docker.sock DOCKER_DRIVER: overlay2 #DOCKER_API_VERSION: "1.41" TESTCONTAINERS_HOST_OVERRIDE: "localhost" TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE: "/var/run/docker.sock" TESTCONTAINERS_HUB_IMAGE_NAME_PREFIX: "labs.etsi.org:5050/osl/hypo/code/org.etsi.osl.hypo.ops/cicd/integration.tests/" IMAGE_NAME: "telemetry-api-jvm" MAVEN_REPO: "${CI_PROJECT_ROOT_NAMESPACE}/.m2/repository" Loading @@ -41,22 +40,26 @@ dev_tests_job: 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: 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 "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 - | cat > ~/.testcontainers.properties <<EOF ryuk.container.privileged=true docker.host=unix:///var/run/docker.sock EOF - | cat > ~/.docker-java.properties <<EOF api.version=1.44 docker.host=unix:///var/run/docker.sock EOF script: - chmod +x ./mvnw - ./mvnw ${MAVEN_CLI_OPTS} test ${MAVEN_OPTS} - ./mvnw ${MAVEN_CLI_OPTS} test ${MAVEN_OPTS} -Dapi.version=1.44 -Ddocker.host=unix:///var/run/docker.sock artifacts: # Upload artifacts even if job fails. when: always Loading @@ -71,15 +74,12 @@ dev_tests_job: - tags dev_verify_job: stage: dev_verify 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: 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: - chmod +x ./mvnw - ./mvnw ${MAVEN_CLI_OPTS} post-integration-test failsafe:verify -DskipUTs ${MAVEN_OPTS} Loading Loading @@ -140,17 +140,13 @@ dev_image_build_job: tags: - hypo image: name: labs.etsi.org:5050/osl/hypo/code/org.etsi.osl.hypo.ops/cicd/integration.tests/docker:20.10.16 name: labs.etsi.org:5050/osl/hypo/code/org.etsi.osl.hypo.ops/cicd/integration.tests/docker:29.1.3 pull_policy: [always, if-not-present] services: - 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: - 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 . - docker build --network host --pull -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: Loading Loading @@ -332,11 +328,7 @@ prod_image_build_and_release_job: - prod_semantic_versioning_job - prod_package_job image: name: labs.etsi.org:5050/osl/hypo/code/org.etsi.osl.hypo.ops/cicd/integration.tests/docker:20.10.16 services: - 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 name: labs.etsi.org:5050/osl/hypo/code/org.etsi.osl.hypo.ops/cicd/integration.tests/docker:29.1.3 before_script: - docker info > /dev/null - RELEASE_VERSION=$(cat release_version.txt) Loading @@ -344,7 +336,7 @@ prod_image_build_and_release_job: - 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 . - docker build --network host --pull -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 Loading