Skip to content
Snippets Groups Projects
  • Jared Kosanovic's avatar
    83503cd8
    Allow failure for container scanning · 83503cd8
    Jared Kosanovic authored
    Sometimes the container scanning step fails because the container scanning runner fails, such as when it runs out of disk space. Instead of making this block the whole build, I think we should allow this step to fail.
    83503cd8
    History
    Allow failure for container scanning
    Jared Kosanovic authored
    Sometimes the container scanning step fails because the container scanning runner fails, such as when it runs out of disk space. Instead of making this block the whole build, I think we should allow this step to fail.
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
.gitlab-ci.yml 1.31 KiB
stages:
  - build
  - scan

variables:
  ECR_IMAGE_TAG: "${AWS_ACCOUNT_ID}.dkr.ecr.us-east-1.amazonaws.com/enterprise-integrations/iics_secure_agent:${CI_COMMIT_REF_SLUG}-${CI_COMMIT_SHORT_SHA}"
  DOIT_REGISTRY_IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA

before_script:
  - apk update && apk add groff less && apk add py3-pip
  - pip3 install awscli
  - $(aws ecr get-login --no-include-email --region us-east-1)
  - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY

after_script:
  - docker logout "$AWS_ACCOUNT_ID".dkr.ecr.us-east-1.amazonaws.com

image: docker:latest

build-master:
  stage: build
  tags:
    - docker
  script:
    - docker build --pull --rm -t ${DOIT_REGISTRY_IMAGE_TAG} .
    - docker tag ${DOIT_REGISTRY_IMAGE_TAG} ${ECR_IMAGE_TAG}
    - docker push ${DOIT_REGISTRY_IMAGE_TAG}
    - docker push ${ECR_IMAGE_TAG}
  only:
    changes:
      - Dockerfile
      - .gitlab-ci.yml
      - run-agent.sh

include:
  - project: interop/checkqualys
    file: templates/.check-qualys-job.yml

image_scan:
  stage: scan
  extends: qualys_scan
  variables:
    CI_TOKEN: $CI_TOKEN
    DOCKER_IMAGE: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA
  when: on_success
  allow_failure: true
  only:
    changes:
      - Dockerfile
      - .gitlab-ci.yml
      - run-agent.sh