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.
36 lines
1.1 KiB
36 lines
1.1 KiB
kind: pipeline |
|
name: default |
|
|
|
steps: |
|
- name: build |
|
pull: if-not-exists |
|
image: docker.registry.bksp.space/common-runner |
|
commands: |
|
- mkdir -p rules |
|
- cd rules && for f in *; do mv "$f" "${DRONE_REPO_OWNER}-${DRONE_REPO_NAME}-$f"; done && cd - |
|
- promtool check rules rules/* |
|
- mkdir -p discovery |
|
- '[ -f discovery.conf.d/dns.yaml ] && generate-dns-sd.py discovery.conf.d/dns.yaml > discovery/dns-${DRONE_REPO_OWNER}-${DRONE_REPO_NAME}.yaml' |
|
|
|
- name: publish |
|
pull: if-not-exists |
|
image: docker.registry.bksp.space/common-runner |
|
commands: |
|
- echo "$${SSH_KEY}" > /tmp/key |
|
- chmod 600 /tmp/key |
|
- scp -P $${REMOTE_PORT} -i /tmp/key -r rules discovery $${REMOTE_USER}@$${REMOTE_HOST}:/var/lib/prometheus |
|
- ssh -p $${REMOTE_PORT} -i /tmp/key $${REMOTE_USER}@$${REMOTE_HOST} killall -s SIGHUP prometheus |
|
environment: |
|
SSH_KEY: |
|
from_secret: ssh_key |
|
REMOTE_HOST: |
|
from_secret: remote_host |
|
REMOTE_PORT: |
|
from_secret: remote_port |
|
REMOTE_USER: |
|
from_secret: remote_user |
|
when: |
|
event: tag |
|
|
|
image_pull_secrets: |
|
- dockerconfig
|
|
|