-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yml
93 lines (78 loc) · 1.88 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
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
version: "3"
vars:
GIT_REV:
sh: git -c safe.directory={{.ROOT_DIR}} rev-parse --short HEAD
REGISTRY: 362159410824.dkr.ecr.us-east-2.amazonaws.com
REPOSITORY: "k3auto"
IMAGE_TAG: "testing-{{.GIT_REV}}"
IMAGE_REF: "{{.REGISTRY}}/{{.REPOSITORY}}:{{.IMAGE_TAG}}"
BUILD_FLAGS: "-tags containers_image_openpgp"
env:
CGO_ENABLED: "0"
tasks:
rev: echo {{.GIT_REV}}
image-ref: echo {{.IMAGE_REF}}
image-registry: echo {{.REGISTRY}}
image-repository: echo {{.REPOSITORY}}
create:
cmds:
- go run {{.BUILD_FLAGS}} . create
delete:
cmds:
- go run {{.BUILD_FLAGS}} . delete
test:
env:
DOCKER_API_VERSION: "1.43"
cmds:
- go test {{.BUILD_FLAGS}} ./... -v --count=1
hack:
cmds:
- go test {{.BUILD_FLAGS}} ./hack/... -v --count=1
e2e:
cmds:
- go test {{.BUILD_FLAGS}} ./e2e/... -v --count=1
docker-test-image:
cmds:
- >
docker build .
-f testing.Dockerfile
-t {{.IMAGE_REF}}
docker-test:
cmds:
- task: docker
vars:
DOCKER_CMD: task test
docker-e2e:
cmds:
- task: docker
vars:
DOCKER_CMD: task e2e
docker-no-build-test:
cmds:
- task: docker-no-build
vars:
DOCKER_CMD: task test
docker-shell:
cmds:
- task: docker
vars:
DOCKER_CMD: /bin/bash
DOCKER_RUN_EXTRA_FLAGS: "-i"
docker:
cmds:
- task: docker-test-image
- task: docker-no-build
vars:
DOCKER_CMD: "{{.DOCKER_CMD}}"
DOCKER_RUN_EXTRA_FLAGS: "{{.DOCKER_RUN_EXTRA_FLAGS}}"
docker-no-build:
cmds:
- >
docker run --rm -t
{{.DOCKER_RUN_EXTRA_FLAGS}}
--network host
-v "/var/run/docker.sock:/var/run/docker.sock"
-v "{{.ROOT_DIR}}:{{.ROOT_DIR}}"
-w "{{.ROOT_DIR}}"
{{.IMAGE_REF}}
{{.DOCKER_CMD}}