Skip to content

Instantly share code, notes, and snippets.

@kvaps
Last active January 16, 2020 08:30
Show Gist options
  • Save kvaps/0713cd35d260c9a7eac44f2d44b488e4 to your computer and use it in GitHub Desktop.
Save kvaps/0713cd35d260c9a7eac44f2d44b488e4 to your computer and use it in GitHub Desktop.
{
// Task for uilding docker-image
dockerImage(name):: {
tags: ['build'],
stage: 'build',
image: {
name: 'gcr.io/kaniko-project/executor:debug-v0.15.0',
entrypoint: [''],
},
script: [
'echo "{\\"auths\\":{\\"$CI_REGISTRY\\":{\\"username\\":\\"$CI_REGISTRY_USER\\",\\"password\\":\\"$CI_REGISTRY_PASSWORD\\"}}}" > /kaniko/.docker/config.json',
'/kaniko/executor --cache --context $CI_PROJECT_DIR/dockerfiles/' + name + ' --dockerfile $CI_PROJECT_DIR/dockerfiles/' + name + '/Dockerfile --destination $CI_REGISTRY_IMAGE/' + name + ':$CI_COMMIT_TAG --build-arg VERSION=$CI_COMMIT_TAG',
],
},
// Job for deploying qbec application
qbecApp(name): {
stage: 'deploy',
script: [
'qbec apply $CI_COMMIT_REF_NAME --root deploy/' + name + ' --force:k8s-context __incluster__ --wait --yes',
],
only: {
changes: [
'deploy/' + name + '/**/*',
],
},
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment