You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

87 lines
2.1 KiB

kind: pipeline
type: docker
name: docker build
environment:
CONSUL_HTTP_ADDR: http://192.168.1.15:8500
NOMAD_ADDR: http://192.168.1.15:4646
volumes:
- name: dockersock
host:
path: /var/run/docker.sock
trigger:
event:
- push
- promote
steps:
- name: docker build
image: docker:dind
volumes:
- name: dockersock
path: /var/run/docker.sock
commands:
- apk add make git
- docker login -u adamveld12 -p $${DOCKER_PASSWORD}
- make vdhsn/gopherhole
- docker push -a vdhsn/gopherhole
environment:
DOCKER_PASSWORD:
from_secret: DOCKER_PASS
- name: deploy
image: adamveld12/nomad:1.0.4
commands:
- apk add make git
- git clone https://git.vdhsn.com/adam/SunnyHomeLab.git repo
- cd ./repo/jobs
- nomad job run ./git.job
when:
branch:
- trunk
event:
- promote
target:
- production
depends_on:
- docker build
- name: post deploy
image: plugins/matrix
settings:
homeserver: https://matrix.vdhsn.com
password:
from_secret: MATRIX_PASSWORD
roomid: UwldmBPwrgpoXYozVG:matrix.vdhsn.com
template: "Build promoted to deploy on {{ build.branch }} {{ build.status }}. See @ [{{ repo.Owner }}/{{ repo.Name }}#{{ truncate build.commit 8 }}]({{ build.link }}). Triggered by {{ build.author }}"
username:
from_secret: MATRIX_USER
failure: ignore
when:
status:
- failure
- success
depends_on:
- deploy
- name: post update
image: plugins/matrix
settings:
homeserver: https://matrix.vdhsn.com
password:
from_secret: MATRIX_PASSWORD
roomid: UwldmBPwrgpoXYozVG:matrix.vdhsn.com
template: "Docker image build and push from {{ build.branch }} {{ build.status }}. See @ [{{ repo.Owner }}/{{ repo.Name }}#{{ truncate build.commit 8 }}]({{ build.link }}). Triggered by {{ build.author }}"
username:
from_secret: MATRIX_USER
failure: ignore
when:
status:
- failure
- success
depends_on:
- docker build