forked from opticdev/optic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTaskfile.yml
96 lines (82 loc) · 2.6 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
94
95
96
# https://taskfile.dev/#/installation
version: '3'
includes:
openapi-utilities:
taskfile: projects/openapi-utilities/Taskfile.yml
dir: projects/openapi-utilities
tasks:
default:
desc: Perform a clean build
cmds:
- task: setup
- task: clean
- task: build
setup:
desc: Install dependencies
cmds:
- yarn install
build:
desc: Build
cmds:
- yarn workspaces foreach -pv --topological-dev --no-private run ws:build
clean:
desc: Clean
cmds:
- yarn workspaces foreach -pv --no-private run ws:clean
test:
desc: Test
cmds:
- yarn workspaces foreach -pv --no-private run ws:test {{.CLI_ARGS}}
update-snapshots:
desc: Update snapshots
cmds:
- yarn workspaces foreach -pv --no-private run ws:test -u
publish:
desc: "Publish built artifacts. Passes CLI_ARGS to 'npm publish'"
cmds:
- yarn workspaces foreach -v --no-private npm publish --access public {{.CLI_ARGS}}
#
# container image build tasks
#
docker:setup:
cmds:
- >
docker buildx create
--name optic-multiplatform-builder
--platform linux/amd64,linux/arm64
status:
- docker buildx ls | grep -Eq optic-multiplatform-builder
docker:build:local:
desc: Build an Optic image for your platform
summary: |
Build an Optic image for your platform
Most useful for produce a single-platform build for local use. Builds intended
for publishing should use `docker:build:release`.
cmds:
- >
docker build {{.CLI_ARGS}}
--tag docker.io/useoptic/optic:local
.
docker:build:release:
desc: Build an Optic image for all supported platforms, suitable for publishing
summary: |
Build an Optic image for all supported platforms.
The version of Optic installed and the image tag is determined by the value of OPTIC_CLI_VERSION.
.CLI_ARGS are appended to the command. To publish images to DockerHub include `--push`.
example:
task docker:build:release OPTIC_CLI_VERSION=0.28.1 -- --push
deps:
- docker:setup
vars:
OPTIC_CLI_VERSION: '{{.OPTIC_CLI_VERSION | default "latest"}}'
cmds:
- >
docker buildx build {{.CLI_ARGS}}
--tag docker.io/useoptic/optic:{{.OPTIC_CLI_VERSION}}
--tag docker.io/useoptic/optic:latest
--tag public.ecr.aws/optic/optic:{{.OPTIC_CLI_VERSION}}
--tag public.ecr.aws/optic/optic:latest
--platform linux/amd64,linux/arm64
--builder optic-multiplatform-builder
--build-arg OPTIC_CLI_VERSION={{.OPTIC_CLI_VERSION}}
.