1.2 KiB · text History 0bd853f
#image:
#  name: quay.io/buildah/stable:latest
#  entrypoint: [""]
#
#build-master:
#  retry: 1
#  stage: build
#  tags: ["privileged"]
#  variables:
#    STORAGE_DRIVER: "vfs"
#    BUILDAH_FORMAT: "docker"
#    BUILDAH_ISOLATION: "rootless"
#
#  script:
#    - buildah login -u gitlab-ci-token -p ${CI_JOB_TOKEN} ${CI_REGISTRY}
#    - buildah bud --build-arg CI_REGISTRY_IMAGE=$CI_REGISTRY_IMAGE --tag $CI_REGISTRY_IMAGE $CI_PROJECT_DIR
#    - buildah push $CI_REGISTRY_IMAGE docker://$CI_REGISTRY_IMAGE
#
#  only:
#    - master
before_script:
  ##
  ## Assuming you created the SSH_KNOWN_HOSTS file type CI/CD variable, uncomment the
  ## following two lines.
  ##
  - mkdir -p ~/.ssh
  - cp "$SSH_KNOWN_HOSTS" ~/.ssh/known_hosts
  - chmod 644 ~/.ssh/known_hosts

build-master:
  retry: 1
  stage: build
  image:
    name: gcr.io/kaniko-project/executor:v1.23.2-debug
    entrypoint: [""]
  only:
    - master
  script:
    - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
    - /kaniko/executor --force --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $CI_REGISTRY_IMAGE --registry-mirror us0.regi.kube.gmp.io