-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yaml
More file actions
149 lines (127 loc) · 5.16 KB
/
Taskfile.yaml
File metadata and controls
149 lines (127 loc) · 5.16 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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
# https://taskfile.dev
version: '3'
dotenv:
- .env
tasks:
ci:
desc: Run all tasks required to merge code into the main branch
cmds:
- task: ruff:check
- task: pytest
- task: basedpyright
- task: mdlint
- task: build
- task: validate:links
- task: aws:lint
ruff:check:
desc: Check linting and formatting of Python sources with `astral-sh/ruff`.
cmds:
- uv run ruff check {{.CLI_ARGS}} .
- uv run ruff format --check {{.CLI_ARGS}} .
ruff:fix:
desc: Fix linting errors in Python sources with `astral-sh/ruff`.
cmds:
- uv run ruff check --fix {{.CLI_ARGS}} .
- uv run ruff format {{.CLI_ARGS}} .
basedpyright:
desc: Check Python type annotations with `detachhead/basedpyright`
cmds:
- uv run basedpyright {{.CLI_ARGS}}
pytest:
desc: Run unit tests via pytest-dev/pytest
cmds:
- uv run pytest {{.CLI_ARGS}} ./weaving
mdlint:
desc: Lint markdown sources with DavidAnson/markdownlint
cmds:
- npx markdownlint {{.CLI_ARGS}} --ignore node_modules --ignore .pytest_cache --ignore 'pages/debug/*.md' '**/*.md'
dev:
desc: Run weaving in local dev mode
cmds:
- uv run python -m weaving --include-debug --site-name rileychase.net --locale en_AU dev {{.CLI_ARGS}}
build:
desc: Run weaving in single build mode
cmds:
- uv run python -m weaving --site-name rileychase.net --locale en_AU build --host rileychase.net {{.CLI_ARGS}}
validate:
desc: Run the inbuilt weaving validator
cmds:
- uv run python -m weaving validate {{.CLI_ARGS}}
validate:links:
desc: Run the inbuilt weaving validator with dead link detection enabled
deps:
- build
cmds:
- uv run python -m weaving validate --dead-links --allow-link 'https://www.linkedin.com/.*' --allow-link 'https://zendesk.com' --allow-link 'https://www.canva.com' {{.CLI_ARGS}}
deploy:
desc: Deploy the built site to S3
cmds:
- aws s3 sync ./output s3://{{ .BUCKET_NAME }}/website --exclude "**/*.md" --delete
- aws cloudfront create-invalidation --distribution-id {{ .DISTRIBUTION_ID }} --path "/*"
emoji:
desc: Update emoji files
cmds:
- ./weaving/emoji/update.sh
aws:lint:
desc: Run cfn-lint across all templates
cmds:
- uv run cfn-lint --include-checks I -- ./aws/**/*.yml
aws:website:validate:
desc: Validate the website_cfn.yml CloudFormation template
sources:
- aws/website_cfn.yml
cmds:
- aws cloudformation validate-template --template-body file://./aws/website_cfn.yml
aws:website:deploy:
desc: Deploy the website_cfn.yml CloudFormation template
deps:
- aws:website:validate
cmds:
- |
aws cloudformation deploy --template-file ./aws/website_cfn.yml \
--stack-name website-rileychase-net \
--no-fail-on-empty-changeset \
--tags PROJECT=rileychase.net STAGE=production \
--parameter-overrides \
DomainName=${DOMAIN_NAME} \
CertificateArn=${CERTIFICATE_ARN}
aws:gh-actions:validate:
desc: Validate the gha_role_cfn.yml CloudFormation template
sources:
- aws/gha_role_cfn.yml
cmds:
- aws cloudformation validate-template --template-body file://./aws/gha_role_cfn.yml
aws:gh-actions:deploy:
desc: Deploy the gha_role_cfn.yml CloudFormation template
deps:
- aws:gh-actions:validate
cmds:
- |
aws cloudformation deploy --template-file ./aws/gha_role_cfn.yml \
--stack-name github-actions-nadock-rileychase-net \
--no-fail-on-empty-changeset \
--capabilities CAPABILITY_IAM \
--tags PROJECT=rileychase.net STAGE=production \
--parameter-overrides \
BucketName=${BUCKET_NAME} \
DistributionID=${DISTRIBUTION_ID} \
aws:acm:validate:
desc: Validate the acm_cert_cfn.yml CloudFormation template
sources:
- aws/acm_cert_cfn.yml
cmds:
- aws cloudformation validate-template --template-body file://./aws/acm_cert_cfn.yml
aws:acm:deploy:
desc: Deploy the acm_cert_cfn.yml CloudFormation template
deps:
- aws:acm:validate
cmds:
- |
aws --region us-east-1 cloudformation deploy --template-file ./aws/acm_cert_cfn.yml \
--stack-name website-rileychase-net-cert \
--no-fail-on-empty-changeset \
--capabilities CAPABILITY_IAM \
--tags PROJECT=rileychase.net STAGE=production \
--parameter-overrides \
DomainName=${DOMAIN_NAME} \
HostedZoneId=${HOSTED_ZONE_ID} \