-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.local.yml
123 lines (120 loc) · 3.67 KB
/
Taskfile.local.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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
version: '3'
dotenv: ['./taskfiles/files/base.cfg']
vars:
VAULT_REPO: '../vault/local'
BIN_DIR: '~/bin'
tasks:
default:
cmds:
- task: download-iso
- task: download-tools
- task: generate-keys
download-iso:
cmds:
- task: make-dir
vars:
DIR: http/iso
- task: download-pkg
vars: {
SRC: "${ALPINE_MIRROR}/v${ALPINE_VERSION}/releases/x86_64/alpine-standard-${ALPINE_RELEASE}-x86_64.iso",
DST: "http/iso/alpine-standard-${ALPINE_RELEASE}-x86_64.iso"
}
- task: download-pkg
vars: {
SRC: "${ALPINE_MIRROR}/v${ALPINE_VERSION}/releases/x86_64/alpine-standard-${ALPINE_RELEASE}-x86_64.iso.sha256",
DST: "http/iso/alpine-standard-${ALPINE_RELEASE}-x86_64.iso.sha256"
}
- task: download-pkg
vars: {
SRC: "${ALPINE_MIRROR}/v${ALPINE_VERSION}/releases/x86_64/alpine-standard-${ALPINE_RELEASE}-x86_64.iso.asc",
DST: "http/iso/alpine-standard-${ALPINE_RELEASE}-x86_64.iso.asc"
}
download-tools:
cmds:
- task: make-tools
- task: download-nomad
- task: download-consul
- task: download-vault
- task: download-gotask
- task: download-monit
generate-keys:
cmds:
- task: make-encrypt
- task: pull-ca-crt
- task: pull-nomad-key
- task: pull-nomad-crt
- task: pull-consul-key
- task: pull-consul-crt
make-encrypt:
cmds:
- task: make-dir
vars:
DIR: http/vault
make-tools:
cmds:
- task: make-dir
vars:
DIR: http/tools
pull-nomad-key:
cmds:
- cp {{.VAULT_REPO}}/encrypt/nomad.key http/vault/nomad.key
pull-consul-key:
cmds:
- cp {{.VAULT_REPO}}/encrypt/consul.key http/vault/consul.key
pull-ca-crt:
cmds:
- cp {{.VAULT_REPO}}/tls/*ca_l1.crt http/vault/
pull-consul-crt:
cmds:
- cp {{.VAULT_REPO}}/tls/consul.crt {{.VAULT_REPO}}/tls/consul-key.pem http/vault/
pull-nomad-crt:
cmds:
- cp {{.VAULT_REPO}}/tls/nomad.crt {{.VAULT_REPO}}/tls/nomad-key.pem http/vault/
download-nomad:
cmds:
- task: download-pkg
vars: {
SRC: "https://releases.hashicorp.com/nomad/${NOMAD_VERSION}/nomad_${NOMAD_VERSION}_linux_amd64.zip",
DST: "http/tools/nomad_${NOMAD_VERSION}_linux_amd64.zip"
}
download-consul:
cmds:
- task: download-pkg
vars: {
SRC: "https://releases.hashicorp.com/consul/${CONSUL_VERSION}/consul_${CONSUL_VERSION}_linux_amd64.zip",
DST: "http/tools/consul_${CONSUL_VERSION}_linux_amd64.zip"
}
download-vault:
cmds:
- task: download-pkg
vars: {
SRC: "https://releases.hashicorp.com/vault/${VAULT_VERSION}/vault_${VAULT_VERSION}_linux_amd64.zip",
DST: "http/tools/vault_${VAULT_VERSION}_linux_amd64.zip"
}
download-gotask:
cmds:
- task: download-pkg
vars: {
SRC: "https://github.com/go-task/task/releases/download/${TASK_VERSION}/task_linux_amd64.tar.gz",
DST: "http/tools/task_linux_amd64_${TASK_VERSION}.tar.gz"
}
download-monit:
cmds:
- task: download-pkg
vars: {
SRC: "https://mmonit.com/monit/dist/binary/${MONIT_VERSION}/monit-${MONIT_VERSION}-linux-x64-musl.tar.gz",
DST: "http/tools/monit-${MONIT_VERSION}-linux-x64-musl.tar.gz"
}
download-pkg:
cmds:
- echo "Downloading - {{ (splitList "/" .DST | last | quote) }}"
- curl -sSL -o {{ .DST }} {{ .SRC }}
silent: true
status:
- test -f {{ .DST }}
make-dir:
cmds:
- mkdir -v -p {{ .DIR }}
silent: true
status:
- test -d {{ .DIR }}