kubespray/.gitlab-ci/build.yml

33 lines
971 B
YAML
Raw Normal View History

2023-01-09 10:29:27 +08:00
---
.build-container:
cache:
key: $CI_COMMIT_REF_SLUG
paths:
- image-cache
tags:
- ffci
2023-01-09 10:29:27 +08:00
stage: build
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: ['']
2023-01-09 10:29:27 +08:00
variables:
TAG: $CI_COMMIT_SHORT_SHA
PROJECT_DIR: $CI_PROJECT_DIR
DOCKERFILE: Dockerfile
GODEBUG: "http2client=0"
2023-01-09 10:29:27 +08:00
before_script:
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"auth\":\"$(echo -n ${CI_REGISTRY_USER}:${CI_REGISTRY_PASSWORD} | base64)\"}}}" > /kaniko/.docker/config.json
script:
- /kaniko/executor --cache=true
--cache-dir=image-cache
--context $PROJECT_DIR
--dockerfile $PROJECT_DIR/$DOCKERFILE
--label 'git-branch'=$CI_COMMIT_REF_SLUG
--label 'git-tag=$CI_COMMIT_TAG'
--destination $PIPELINE_IMAGE
pipeline-image:
extends: .build-container
variables:
DOCKERFILE: pipeline.Dockerfile