35 lines
744 B
YAML
35 lines
744 B
YAML
---
|
|
kind: 'pipeline'
|
|
name: 'build'
|
|
type: 'kubernetes'
|
|
|
|
steps:
|
|
|
|
# build and publish
|
|
- image: 'docker.io/library/docker'
|
|
name: 'publish'
|
|
pull: 'always'
|
|
privileged: true
|
|
|
|
environment:
|
|
IMG: 'rakepanorama/ansible-deployment-container'
|
|
DOCKER_USER:
|
|
from_secret: 'docker_username'
|
|
DOCKER_PASS:
|
|
from_secret: 'docker_password'
|
|
|
|
volumes:
|
|
- name: 'docker_socket'
|
|
path: '/var/run/docker.sock'
|
|
|
|
commands:
|
|
- 'echo building image ${IMG}'
|
|
- 'docker login -u ${DOCKER_USER} -p${DOCKER_PASS} docker.io'
|
|
- 'docker build -t ${IMG}:v0.9 -t ${IMG}:latest -f Dockerfile.linux.amd64 .'
|
|
- 'docker push -a'
|
|
|
|
volumes:
|
|
- name: 'docker_socket'
|
|
host:
|
|
path: '/var/run/docker.sock'
|