-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yaml
More file actions
115 lines (104 loc) · 3.48 KB
/
Copy pathTaskfile.yaml
File metadata and controls
115 lines (104 loc) · 3.48 KB
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
# Taskfile.yaml - development and test tasks for the generic devcontainer kit
#
# Why this exists:
# - keeps the kit's Docker and smoke-test commands close to the files they verify
# - provides a stable entrypoint for tests without adding root-level wrappers
#
# Inputs:
# - WORKSPACE selects the host path mounted into docker-run, defaulting to $PWD,
# and is passed as DEVCONTAINER_WORKSPACE_FOLDER for entrypoint setup.
# - COMMAND selects the docker-run command, defaulting to devcontainer up.
# - CONTAINER_* values can align the image user with the caller.
#
# Related files:
# - Dockerfile.base
# - entrypoint.sh
# - scripts/code-open.sh
# - scripts/release-build.sh
# - tests/run.sh
# - tests/code-open-test.sh
# - scripts/chrome.sh
# - tests/browser-open-test.sh
# - tests/release-build.sh
version: '3'
vars:
IMAGE: codegeist-devcontainer-kit:local
WORKSPACE:
sh: printf '%s' "${WORKSPACE:-$PWD}"
COMMAND:
sh: printf '%s' "${COMMAND:-devcontainer up --workspace-folder .}"
CONTAINER_USER:
sh: printf '%s' "${CONTAINER_USER:-${USER:-$(id -un)}}"
CONTAINER_GROUP:
sh: printf '%s' "${CONTAINER_GROUP:-${USER:-$(id -un)}}"
CONTAINER_UID:
sh: printf '%s' "${CONTAINER_UID:-${UID:-$(id -u)}}"
CONTAINER_GID:
sh: printf '%s' "${CONTAINER_GID:-${UID:-$(id -u)}}"
tasks:
check:
desc: Run fast deterministic contributor checks
cmds:
- >-
bash -n
"{{.TASKFILE_DIR}}/entrypoint.sh"
"{{.TASKFILE_DIR}}/initialize.sh"
"{{.TASKFILE_DIR}}"/scripts/*.sh
"{{.TASKFILE_DIR}}"/tests/*.sh
- '"{{.TASKFILE_DIR}}/tests/release-build.sh"'
docker-build:
desc: Build the generic devcontainer kit image
cmds:
- >-
bash -lc 'tmp_dir="$(mktemp -d)";
cleanup() { rm -rf "$tmp_dir"; };
trap cleanup EXIT;
mkdir -p "$tmp_dir/.devcontainer";
cp -R "{{.TASKFILE_DIR}}/." "$tmp_dir/.devcontainer/";
rm -rf "$tmp_dir/.devcontainer/tests";
docker build
--build-arg CONTAINER_USER={{.CONTAINER_USER}}
--build-arg CONTAINER_GROUP={{.CONTAINER_GROUP}}
--build-arg CONTAINER_UID={{.CONTAINER_UID}}
--build-arg CONTAINER_GID={{.CONTAINER_GID}}
-f "$tmp_dir/.devcontainer/Dockerfile.base"
-t {{.IMAGE}}
"$tmp_dir"'
docker-run:
desc: Run the generic devcontainer kit image with nested Docker
deps:
- docker-build
cmds:
- >-
docker run --rm -it
--privileged
--network host
-e DEVCONTAINER_WORKSPACE_FOLDER={{.WORKSPACE}}
-v {{.WORKSPACE}}:{{.WORKSPACE}}
-w {{.WORKSPACE}}
{{.IMAGE}}
{{.COMMAND}}
browser-open-test:
desc: Start a temp Dev Containers CLI repo and open visible Chrome
cmds:
- '{{.TASKFILE_DIR}}/tests/browser-open-test.sh {{.CLI_ARGS}}'
qemu-alpine-smoke:
desc: Download and boot Alpine Linux through QEMU
cmds:
- '{{.TASKFILE_DIR}}/tests/qemu-alpine-smoke.sh'
tests-run:
desc: Run the generic devcontainer kit test suite
cmds:
- '{{.TASKFILE_DIR}}/tests/run.sh'
code-open:
desc: Open the current Git root in VS Code
cmds:
- '{{.TASKFILE_DIR}}/scripts/code-open.sh {{.CLI_ARGS}}'
code-open-test:
desc: Create a temp consuming repo and open it with VS Code
cmds:
- '{{.TASKFILE_DIR}}/tests/code-open-test.sh {{.CLI_ARGS}}'
release-build:
desc: Update the runtime-only devcontainer release branch
cmds:
- '{{.TASKFILE_DIR}}/scripts/release-build.sh {{.CLI_ARGS}}'