pihole_exporter/.drone.yml
n0vember 3f8f26af84
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
also limit container registry push to push events
2024-03-12 02:20:10 +01:00

65 lines
1.4 KiB
YAML

---
kind: pipeline
name: default
services:
- name: docker
image: docker:dind
privileged: true
volumes:
- name: dockersock
path: /var/run
volumes:
- name: dockersock
temp: {}
steps:
- name: wait for docker
image: docker:dind
volumes:
- name: dockersock
path: /var/run
commands:
- echo "$(date) - waiting for docker service"
- until docker ps 2>/dev/null ; do echo "$(date) - not yet..." ; sleep 1 ; done
- echo "$(date) - docker service available"
- name: container creation
image: registry.gitlab.com/role_unit/role_unit_containers:build
privileged: true
volumes:
- name: dockersock
path: /var/run
environment:
REGISTRY: git.half-9.net
OWNER: containers
IMAGE: pihole-exporter
TAG: latest
commands:
- docker build -t $REGISTRY/$OWNER/$IMAGE:$TAG .
- name: container publish
when:
branch:
- main
event:
- push
image: registry.gitlab.com/role_unit/role_unit_containers:build
privileged: true
volumes:
- name: dockersock
path: /var/run
environment:
REGISTRY: git.half-9.net
OWNER: containers
IMAGE: pihole-exporter
TAG: latest
USER: n0vember
TOKEN:
from_secret: registry_token
commands:
- docker login --username="$USER" --password="$TOKEN" $REGISTRY
- docker push $REGISTRY/$OWNER/$IMAGE:$TAG