good morning!!!!

Skip to content
Snippets Groups Projects
Commit 696fb924 authored by Garet Halliday's avatar Garet Halliday
Browse files

ci test

parent 5841fd00
No related branches found
No related tags found
No related merge requests found
local jobs = [
{name: "pggat", merge: {}},
];
local param_job(image,tag_var, merge = {}) = std.mergePatch({
stage: 'build',
image: {
name: 'gcr.io/kaniko-project/executor:debug',
entrypoint: [''],
},
script: [
'mkdir -p /kaniko/.docker',
@'echo "{\"auths\":{\"${CI_REGISTRY}\":{\"auth\":\"$(printf "%s:%s" "${CI_REGISTRY_USER}" "${CI_REGISTRY_PASSWORD}" | base64)\"}}}" > /kaniko/.docker/config.json',
std.strReplace(|||
/kaniko/executor
--context ${CI_PROJECT_DIR}
--cache=true
--build-arg GOPROXY
--cache-repo="${CI_REGISTRY_IMAGE}/kaniko/cache"
--dockerfile "${CI_PROJECT_DIR}/Dockerfile"
--destination "${CI_REGISTRY_IMAGE}/%(img)s:%(tag_var)s"
--destination "${CI_REGISTRY_IMAGE}/%(img)s:latest"
||| % {img: image, tag_var: tag_var}, "\n", " "),
]
}, merge);
{
[job.name+"-tag"]: param_job(job.name,"${CI_COMMIT_TAG}",std.mergePatch(job.merge, {only:["tags"]}))
for job in jobs
} + {
[job.name]: param_job(job.name,"${CI_COMMIT_SHORT_SHA}",job.merge)
for job in jobs
}
jsonnet:
stage: build
image: alpine:latest
script:
- apk add -U jsonnet
- jsonnet .gitlab-ci.jsonnet > generated-config.yml
artifacts:
paths:
- generated-config.yml
trigger-builds:
stage: build
needs:
- jsonnet
trigger:
include:
- artifact: generated-config.yml
job: jsonnet
strategy: depend
trigger-deploy:
stage: deploy
needs:
- trigger-builds
image:
name: bitnami/kubectl:latest
entrypoint: ['']
variables:
APP_NAME: "pggat"
IMAGE_NAME: "pggat"
RESOURCE: "statefulset"
only:
variables:
- $CI_COMMIT_BRANCH == "master"
script:
- kubectl config get-contexts
- kubectl config use-context etherlands/gitlab-agents:gfxlabs-dev
- kubectl patch $RESOURCE $APP_NAME -p '{"spec":{"template":{"metadata":{"labels":{"date":"'$(date +'%s')'","sha":"'${CI_COMMIT_SHA}'"}},"spec":{"containers":[{"name":"'${APP_NAME}'","image":"'${CI_REGISTRY_IMAGE}'/'${IMAGE_NAME}':latest"}]}}}}'
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment