Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ jobs:
run: npm ci

- name: npm - lint
run: npm run lint
run: make npm-lint

- name: npm - test
run: npm test
run: make npm-test

- name: conditionally semantic release
if: ${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ __pycache__/
node_modules/
/lib/
/*.tgz
.idea
59 changes: 51 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,59 @@
all:
@echo "Specify a valid target"
@exit 1
VENV = .venv/bin

.PHONY: all
all: install-deps build fmt lint test

.PHONY: install-deps
install-deps:
@echo "=== Running target: install-deps ==="
npm install --ignore-scripts
python3 -m venv .venv && \
$(VENV)/pip install -r requirements.txt

.PHONY: build
build:
@echo "=== Running target: build ==="
npm run build # runs build through prepare-script

.PHONY: test
test: npm-test py-test

npm-test:
@echo "=== Running target: npm-test ==="
npm run test

py-test:
@echo "=== Running target: py-test ==="
TARGET_BUCKET_URL=s3://dummy/web \
EXPIRE_SECONDS=86400 \
DEPLOY_LOG_BUCKET_URL=s3://dummy/deployments.log \
python -m unittest discover webapp_deploy
$(VENV)/python -m unittest discover webapp_deploy

.PHONY: fmt
fmt:
npm run lint:fix
$(VENV)/black webapp_deploy

.PHONY: npm-fmt
npm-fmt:
@echo "=== Running target: npm-fmt ==="
npm run format

.PHONY: py-fmt
py-fmt:
@echo "=== Running target: py-fmt ==="
$(VENV)/black webapp_deploy

.PHONY: lint
lint: npm-lint py-lint

py-format:
black webapp_deploy
.PHONY: npm-lint
npm-lint:
@echo "=== Running target: npm-lint ==="
npm run lint

.PHONY: py-lint
py-lint:
flake8 --exclude .venv webapp_deploy
black --check webapp_deploy
@echo "=== Running target: py-lint ==="
$(VENV)/flake8 --exclude .venv webapp_deploy
$(VENV)/black --check webapp_deploy
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ threshold.
What it does:

1. Fetch deployment log from S3
1. Fetch bundled artifact and extract locally with optional filtering
1. Upload all non-html files to S3
1. Upload html files to S3
1. Add uploaded items to deployment log
1. Delete old items from S3
1. Prune old deployments from deployment log
1. Store deployment log to S3 for next run
1. Optionally invalidate CloudFront distribution
2. Fetch bundled artifact and extract locally with optional filtering
3. Upload all non-html files to S3
4. Upload html files to S3
5. Add uploaded items to deployment log
6. Delete old items from S3
7. Prune old deployments from deployment log
8. Store deployment log to S3 for next run
9. Optionally invalidate CloudFront distribution

## Preserving old files

Expand Down Expand Up @@ -44,7 +44,7 @@ aws lambda invoke \
--payload '{
"ResourceProperties": {
"artifactS3Url": "s3://my-bucket/my-release.tgz"
},
},
"RequestType": "Update"
}' \
/tmp/out.log
Expand Down
2 changes: 1 addition & 1 deletion commitlint.config.js → commitlint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
export default {
extends: ["@commitlint/config-conventional"],
}
2 changes: 1 addition & 1 deletion jest.config.js → jest.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
export default {
testMatch: ["**/*.test.ts"],
transform: {
"^.+\\.tsx?$": "ts-jest",
Expand Down
Loading