-
Notifications
You must be signed in to change notification settings - Fork 33
/
.drone.yml
53 lines (48 loc) · 1.57 KB
/
.drone.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
---
kind: pipeline
name: verify
steps:
- name: verify peers
image: python:3.13
commands:
- pip install PyYAML
- scripts/ci-verify.py .
- name: unit tests
image: python:3.13
commands:
- pip install requests ruamel.yaml
- python3 -m unittest discover scripts/peerconfgen/ -v
---
kind: pipeline
name: update dn42 git
steps:
- name: update dn42 DNS config
image: python:3.13
commands:
- pip install PyYAML
- umask 077
- mkdir -p tmp/ $HOME/.ssh
- echo "$SSH_KEY" > $HOME/.ssh/id_git_dn42
- git clone [email protected]:dns/config.git tmp/dn42-dns-config
- scripts/make-auth-server-list.py > tmp/dn42-dns-config/slaves/highdef
# This script shortcuts twice:
# 1) If no changes were to the upstream repo, we don't need to update anything
- cd tmp/dn42-dns-config
- if git diff --exit-code; then echo "Exiting, no changes made"; exit 0; fi
- git remote add fork [email protected]:jlu5/dns-config.git
- git fetch fork
- git commit . -m 'Update AS4242421080 delegation servers'
# 2) If the change we're making is already in the fork, also skip pushing to avoid refreshing the PR unnecessarily
- if ! git diff fork/ci-auto-update --exit-code; then git push -f fork HEAD:ci-auto-update; else echo "Skip pushing, remote branch is equal"; fi
environment:
GIT_SSH_COMMAND: ssh -o StrictHostKeyChecking=accept-new -i $HOME/.ssh/id_git_dn42
GIT_AUTHOR_NAME: highdef.network bot
GIT_AUTHOR_EMAIL: [email protected]
SSH_KEY:
from_secret: git-dn42-ssh-key
trigger:
branch:
- main
- ci-*
event:
- push