Commit d98df9be authored by Nikos Psaromanolakis's avatar Nikos Psaromanolakis
Browse files

Edit .gitlab-ci.yml

parent 04ea7f4e
Loading
Loading
Loading
Loading
Loading
+10 −17
Original line number Diff line number Diff line
@@ -6,29 +6,26 @@ stages:
  - image_build

variables:
  DOCKER_HOST: tcp://localhost:2375
  DOCKER_TLS_CERTDIR: ''
  DOCKER_HOST: unix:///var/run/docker.sock
  DOCKER_DRIVER: overlay2
  IMAGE_NAME: 'hypo-portal'
  TESTCONTAINERS_HOST_OVERRIDE: 'localhost'
  TESTCONTAINERS_HUB_IMAGE_NAME_PREFIX: 'labs.etsi.org:5050/osl/hypo/code/org.etsi.osl.hypo.ops/cicd/integration.tests/'
  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/"
  TESTCONTAINERS_CHECKS_DISABLE: 'true'
  IMAGE_NAME: 'hypo-portal'
  

dev_image_build_job:
  stage: dev_image_build
  tags:
    - hypo
  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
  script:
    - echo -n $CI_REGISTRY_PASSWORD | docker login -u $CI_REGISTRY_USER --password-stdin $CI_REGISTRY
    - docker buildx build -t $CI_REGISTRY/$CI_PROJECT_PATH/$IMAGE_NAME:$CI_COMMIT_SHORT_SHA .
    - docker buildx build --network host --pull -t $CI_REGISTRY/$CI_PROJECT_PATH/$IMAGE_NAME:$CI_COMMIT_SHORT_SHA .
    - 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
  rules:
@@ -115,11 +112,7 @@ 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
  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)
@@ -127,7 +120,7 @@ image_build_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 buildx build -t $CI_REGISTRY/$CI_PROJECT_PATH/$IMAGE_NAME:latest .
    - docker buildx build --network host --pull -t $CI_REGISTRY/$CI_PROJECT_PATH/$IMAGE_NAME:latest .
    - 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