add gitlab-templates
This commit is contained in:
parent
186e1eea78
commit
05e0d5502b
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,3 +1,5 @@
|
||||
.DS_Store
|
||||
|
||||
# Binaries for programs and plugins
|
||||
*.exe
|
||||
*.dll
|
||||
|
||||
11
.gitlab-ci.yml
Normal file
11
.gitlab-ci.yml
Normal file
@ -0,0 +1,11 @@
|
||||
include:
|
||||
- local: 'gitlab-templates/base.yml'
|
||||
- local: 'gitlab-templates/build-images.yml'
|
||||
|
||||
variables:
|
||||
user: 'admin'
|
||||
password: '${token}'
|
||||
dockefile: 'alpine-with-ca.Dockerfile'
|
||||
repository: 'artifact.onwalk.net/k8s'
|
||||
image: 'apline'
|
||||
tag: '3.13'
|
||||
6
gitlab-templates/base.yml
Normal file
6
gitlab-templates/base.yml
Normal file
@ -0,0 +1,6 @@
|
||||
image:
|
||||
name: gcr.io/kaniko-project/executor:v1.9.0-debug
|
||||
entrypoint: [""]
|
||||
|
||||
stages:
|
||||
- build
|
||||
11
gitlab-templates/build-images.yml
Normal file
11
gitlab-templates/build-images.yml
Normal file
@ -0,0 +1,11 @@
|
||||
build-image-job:
|
||||
stage: build
|
||||
script:
|
||||
- mkdir -p /kaniko/.docker
|
||||
- echo "{\"auths\":{"${repository}":{\"auth\":\"$(printf "%s:%s" "${user}" "${password}" | base64 | tr -d '\n')\"}}}" > /kaniko/.docker/config.json
|
||||
- /kaniko/executor --context "${CI_PROJECT_DIR}" --dockerfile "${CI_PROJECT_DIR}/${dockerfile}" --destination "${repository}/${image}:${tag}"
|
||||
tags:
|
||||
- shared
|
||||
- shell
|
||||
rules:
|
||||
- if: $CI_COMMIT_BRANCH == "main"
|
||||
Loading…
Reference in New Issue
Block a user