better ci

master 0.2.3
parent ec0c5bd466
commit 6978674ae5
  1. 11
      .drone.yml

@ -2,11 +2,15 @@ kind: pipeline
name: default
steps:
- name: test
- 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
@ -14,11 +18,6 @@ steps:
commands:
- echo "$${SSH_KEY}" > /tmp/key
- chmod 600 /tmp/key
- 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'
- 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:

Loading…
Cancel
Save