-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTaskfile.yml
64 lines (56 loc) · 1.68 KB
/
Taskfile.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
version: '3'
dotenv:
- .env
vars:
BOX_VERSION: 4.3.8
CERTBOT_BIN: '${CERTBOT_BIN}'
INSTALL_DIR: /usr/local/bin
TARGET_FILENAME: certbot-online.phar
tasks:
clean:
desc: clean build files and vendors
cmds:
- 'rm -f bin/{{.TARGET_FILENAME}}'
- rm -rf vendor
setup:
desc: locally install project dependencies (box, composer)
env:
BOX_VERSION: '{{.BOX_VERSION}}'
cmds:
- ./scripts/install_box.sh
- ./scripts/install_composer.sh
status:
- test -x ./bin/box.phar
- test -x ./bin/composer.phar
build:
desc: generate the phar file
cmds:
- ./bin/composer.phar install --no-dev
- ./bin/box.phar compile --composer-bin ./bin/composer.phar
status:
- test -d vendor
- 'test -x bin/{{.TARGET_FILENAME}}'
install:
cmds:
- task: build
- 'install --owner=root --group=root -mode=655 bin/{{.TARGET_FILENAME}} {{.INSTALL_DIR}}'
status:
- test -x {{.INSTALL_DIR}}/{{.TARGET_FILENAME}}
test:certbot:
desc: execute a dry-run certificate renew using certbot
cmds:
- '{{.CERTBOT_BIN}} certonly -n --manual --manual-auth-hook ./main.php --manual-cleanup-hook ./main.php
--agree-tos --email test@${CERTBOT_DOMAIN}
--dry-run --preferred-challenges=dns --config-dir=/tmp --work-dir=/tmp --logs-dir=/tmp
-d $CERTBOT_DOMAIN'
test:script:
desc: test the hook without certbot, in simulated conditions
cmds:
- ./main.php
- echo "switching to deletion mode in 3s..."
- sleep 3
- CERTBOT_AUTH_OUTPUT=some_meaningless_data ./main.php
env:
GET_TRACES: 1
CERTBOT_VALIDATION:
sh: cat /proc/sys/kernel/random/uuid