mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2025-12-14 05:45:06 +03:00
CI: simplify image build job
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
.build-container:
|
pipeline-image:
|
||||||
cache:
|
cache:
|
||||||
key: $CI_COMMIT_REF_SLUG
|
key: $CI_COMMIT_REF_SLUG
|
||||||
paths:
|
paths:
|
||||||
@@ -11,22 +11,14 @@
|
|||||||
name: gcr.io/kaniko-project/executor:debug
|
name: gcr.io/kaniko-project/executor:debug
|
||||||
entrypoint: ['']
|
entrypoint: ['']
|
||||||
variables:
|
variables:
|
||||||
TAG: $CI_COMMIT_SHORT_SHA
|
|
||||||
PROJECT_DIR: $CI_PROJECT_DIR
|
|
||||||
DOCKERFILE: Dockerfile
|
|
||||||
GODEBUG: "http2client=0"
|
GODEBUG: "http2client=0"
|
||||||
script:
|
script:
|
||||||
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"auth\":\"$(echo -n ${CI_REGISTRY_USER}:${CI_REGISTRY_PASSWORD} | base64)\"}}}" > /kaniko/.docker/config.json
|
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"auth\":\"$(echo -n ${CI_REGISTRY_USER}:${CI_REGISTRY_PASSWORD} | base64)\"}}}" > /kaniko/.docker/config.json
|
||||||
- /kaniko/executor --cache=true
|
- /kaniko/executor --cache=true
|
||||||
--cache-dir=image-cache
|
--cache-dir=image-cache
|
||||||
--context $PROJECT_DIR
|
--context $CI_PROJECT_DIR
|
||||||
--dockerfile $PROJECT_DIR/$DOCKERFILE
|
--dockerfile $CI_PROJECT_DIR/pipeline.Dockerfile
|
||||||
--label 'git-branch'=$CI_COMMIT_REF_SLUG
|
--label 'git-branch'=$CI_COMMIT_REF_SLUG
|
||||||
--label 'git-tag=$CI_COMMIT_TAG'
|
--label 'git-tag=$CI_COMMIT_TAG'
|
||||||
--destination $PIPELINE_IMAGE
|
--destination $PIPELINE_IMAGE
|
||||||
--log-timestamp=true
|
--log-timestamp=true
|
||||||
|
|
||||||
pipeline-image:
|
|
||||||
extends: .build-container
|
|
||||||
variables:
|
|
||||||
DOCKERFILE: pipeline.Dockerfile
|
|
||||||
|
|||||||
Reference in New Issue
Block a user