2023-01-09 10:29:27 +08:00
|
|
|
---
|
2024-06-11 21:19:02 +08:00
|
|
|
.build-container:
|
|
|
|
cache:
|
|
|
|
key: $CI_COMMIT_REF_SLUG
|
|
|
|
paths:
|
|
|
|
- image-cache
|
|
|
|
tags:
|
2024-07-01 18:25:36 +08:00
|
|
|
- ffci
|
2023-01-09 10:29:27 +08:00
|
|
|
stage: build
|
2023-05-03 02:56:15 +08:00
|
|
|
image:
|
2024-06-11 21:19:02 +08:00
|
|
|
name: gcr.io/kaniko-project/executor:debug
|
|
|
|
entrypoint: ['']
|
2023-01-09 10:29:27 +08:00
|
|
|
variables:
|
2024-06-11 21:19:02 +08:00
|
|
|
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:
|
2024-06-11 21:19:02 +08:00
|
|
|
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"auth\":\"$(echo -n ${CI_REGISTRY_USER}:${CI_REGISTRY_PASSWORD} | base64)\"}}}" > /kaniko/.docker/config.json
|
2023-05-03 02:56:15 +08:00
|
|
|
script:
|
2024-06-11 21:19:02 +08:00
|
|
|
- /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
|
2023-05-03 02:56:15 +08:00
|
|
|
|
2024-06-11 21:19:02 +08:00
|
|
|
pipeline-image:
|
|
|
|
extends: .build-container
|
|
|
|
variables:
|
|
|
|
DOCKERFILE: pipeline.Dockerfile
|