This repository has been archived by the owner on Dec 5, 2023. It is now read-only.
forked from danskernesdigitalebibliotek/dpl-design-system
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yml
79 lines (64 loc) · 2.27 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
version: '3'
dotenv: [".task.env"]
vars:
COMMIT_COUNT:
sh: git rev-list --count origin/main
# Constructing docker image name.
DOCKER_IMAGE_PREFIX: "{{ .RELEASE_IMAGE_REGISTRY }}/{{ .DOCKER_IMAGE_NAMESPACE }}"
# Constructing docker image name.
RELEASE_IMAGE_NAME: '{{.RELEASE_IMAGE_NAME | default "dpl-cms-source"}}'
RELEASE_FULL_NAME: '{{.RELEASE_IMAGE_REGISTRY}}/{{.RELEASE_IMAGE_NAME}}:{{.RELEASE_IMAGE_TAG}}'
# Docker file selection
DOCKER_COMPOSE_FILES_OSX: '{{if eq OS "darwin"}}-f docker-compose.mac-nfs.yml{{end}}'
DOCKER_COMPOSE_FILES_DEFAULT: '-f docker-compose.yml {{ .DOCKER_COMPOSE_FILES_OSX }}'
DOCKER_COMPOSE_FILES: '{{.DOCKER_COMPOSE_FILES | default .DOCKER_COMPOSE_FILES_DEFAULT }}'
tasks:
dev:install:
summary: Install packages
cmds:
- task dev:cli -- npm install
dev:start:
summary: Install and run docker compose
cmds:
- task dev:install
- docker compose up --detach
dev:stop:
summary: Stop docker compose environment
cmds:
- docker compose {{ .DOCKER_COMPOSE_FILES }} stop
dev:down:
summary: Stop and remove docker compose environment
cmds:
# DNS proxies such as Dory may hang on to the network for a bit which
# causes the process to fail. Wait and retry if that is the case
- docker compose {{ .DOCKER_COMPOSE_FILES }} down --volumes --remove-orphans || (sleep 3 && docker-compose down)
dev:logs:
summary: Tail docker compose logs for web-pack
cmds:
- docker compose logs node --follow
dev:reset:
summary: Install development environment and clean up.
cmds:
- task dev:cli -- storybook:axe
- task dev:down
- rm -rf node_modules
- task dev:up
dev:test:
summary: Run tests
cmds:
- task dev:cli -- npm run chromatic
dev:lint:
summary: Run linters
cmds:
- task dev:cli -- npm run js:eslint
- task dev:cli -- npm run js:lint
- task dev:cli -- npm run css:stylelint
- task dev:cli -- npm run lint:markdown
dev:chromatic:
summary: Run Chromatic for visual test
cmds:
- task dev:cli -- npm run chromatic
dev:cli:
summary: Performs command inside container. Expects parameter(s).
cmds:
- docker compose {{ .DOCKER_COMPOSE_FILES }} run --rm node {{.CLI_ARGS}}