-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yml
58 lines (50 loc) · 1.45 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
version: '3'
vars:
BASH_SCRIPTS:
sh: find . -iname '*.sh' -not -path './cygwin/*' | xargs echo
tasks:
test:
cmds:
- echo {{.BASH_SCRIPTS}}
- ./test/shellcheck.sh {{.BASH_SCRIPTS}}
- ./test/check-safe-bash.sh {{.BASH_SCRIPTS}}
sources:
- "**/*.sh"
#- "{{.BASH_SCRIPTS}}"
format-scripts:
cmds:
- shfmt -i 2 -w {{.BASH_SCRIPTS}}
sources:
- "**/*.sh"
#- "{{.BASH_SCRIPTS}}"
lint-containerfile:
cmds:
- podman run --rm -i hadolint/hadolint < Containerfile
sources:
- Containerfile
build-container:
cmds:
- podman build --format=docker -t nvolcz/dotfiles .
- podman build --format=docker -t nvolcz/dotfiles-base --target base .
- podman build --format=docker -t nvolcz/dotfiles-bootstrapped --target bootstrapped .
sources:
- Containerfile
- "{bin,config,installs,local}/*"
- bootstrap.sh
run-container:
deps: [build-container]
cmds:
- podman run -it nvolcz/dotfiles-bootstrapped /bin/bash
run-container-base:
deps: [build-container]
cmds:
- podman run -it nvolcz/dotfiles-base /bin/bash
test-container:
deps: [build-container]
cmds:
- |
CONTAINER_ID=$(podman run -t -d nvolcz/dotfiles)
echo ${CONTAINER_ID}
trap 'podman kill ${CONTAINER_ID}' EXIT
podman exec -it $CONTAINER_ID \
bash -c 'cd /home/niklas/git/dotFiles; sudo bash ./test/container-test.sh'