This repository has been archived by the owner on Oct 3, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.drone.yml
100 lines (84 loc) · 1.9 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
kind: pipeline
type: docker
name: default
clone:
disable: true
trigger:
event:
- push
- custom
steps:
- name: clone
image: alpine/git
commands:
- git init --quiet
- git remote add origin $DRONE_REMOTE_URL
- git fetch --quiet --depth=1 origin "+refs/heads/$DRONE_BRANCH:"
- git checkout --quiet $DRONE_COMMIT -b $DRONE_BRANCH
- git submodule update --quiet --init
- name: makepkg
image: misotolar/makepkg
volumes:
- name: cache
path: /tmp
commands:
- BUILD_PATH="$DRONE_REPO_NAME" makepkg.sh
- sudo repo-add export/$DRONE_REPO_NAME.db.tar.gz export/*.pkg.tar.zst
- name: cleanup
image: misotolar/makepkg
volumes:
- name: cache
path: /tmp
commands:
- rm -rf /tmp/build
- rm -rf /tmp/tmp.*
when:
status:
- success
- failure
- name: publish
image: misotolar/drone-rsync
settings:
source: ./export/
remote:
from_secret: RSYNC_HOST
port:
from_secret: RSYNC_PORT
username:
from_secret: RSYNC_USERNAME
password:
from_secret: RSYNC_PASSWORD
target:
from_secret: RSYNC_TARGET
volumes:
- name: cache
host:
path: /mnt/cache
---
kind: pipeline
type: docker
name: update
clone:
disable: true
trigger:
event:
- cron
steps:
- name: clone
image: alpine/git
commands:
- git init --quiet
- git remote add origin $DRONE_REMOTE_URL
- git fetch --quiet --depth=1 origin "+refs/heads/$DRONE_BRANCH:"
- git checkout --quiet $DRONE_COMMIT -b $DRONE_BRANCH
- git submodule update --quiet --init --remote
- name: version
image: misotolar/curl-jq
commands:
- curl -s https://aur.archlinux.org/rpc/?v=5\&type=info\&arg[]=$DRONE_REPO_NAME | jq --raw-output '.results[0].Version' > .version
- name: update
image: alpine/git
commands:
- export VERSION=$(cat .version)
- git diff --quiet && git diff --quiet --staged || git commit -a -m "$DRONE_REPO_NAME $VERSION"
- git push origin $DRONE_BRANCH