58 lines
No EOL
1.7 KiB
YAML
58 lines
No EOL
1.7 KiB
YAML
version: v0
|
|
runs:
|
|
- name: Build
|
|
tasks:
|
|
- name: checkout code
|
|
runtime:
|
|
type: pod
|
|
containers:
|
|
- image: docker.io/alpine/git
|
|
steps:
|
|
- clone:
|
|
- save_to_workspace:
|
|
contents:
|
|
- source_dir: .
|
|
dest_dir: .
|
|
paths:
|
|
- '**'
|
|
- name: Build
|
|
runtime:
|
|
containers:
|
|
- image: gcr.io/kaniko-project/executor:debug
|
|
environment:
|
|
DOCKERAUTH:
|
|
from_variable: dockerauth
|
|
shell: /busybox/sh
|
|
steps:
|
|
- restore_workspace:
|
|
dest_dir: .
|
|
- run:
|
|
name: generate docker config
|
|
command: |
|
|
cat << EOF > /kaniko/.docker/config.json
|
|
{
|
|
"auths": {
|
|
"code.icb4dc0.de": { "auth" : "$DOCKERAUTH" }
|
|
}
|
|
}
|
|
EOF
|
|
- run:
|
|
name: Build container image
|
|
command: |
|
|
/kaniko/executor \
|
|
--destination code.icb4dc0.de/prskr/blog:$AGOLA_GIT_COMMITSHA \
|
|
--destination code.icb4dc0.de/prskr/blog:latest \
|
|
--context dir:///root/project/ \
|
|
--dockerfile /root/project/Dockerfile
|
|
depends:
|
|
- checkout code
|
|
- name: Deploy
|
|
runtime:
|
|
containers:
|
|
- image: docker.io/alpine/helm
|
|
steps:
|
|
- restore_workspace:
|
|
dest_dir: .
|
|
- run:
|
|
name: Deploy Helm chart
|
|
command: helm upgrade --set image.tag=$AGOLA_GIT_COMMITSHA --install --namespace blog deploy/helm blog |