@@ -6,67 +6,82 @@ ECR_URL_DEV:=222053980223.dkr.ecr.us-east-1.amazonaws.com/timdex-index-manager-d
66SHELL =/bin/bash
77DATETIME: =$(shell date -u +% Y% m% dT% H% M% SZ)
88
9- # ## Dependency commands ###
9+ help : # preview Makefile commands
10+ @awk ' BEGIN { FS = ":.*#"; print "Usage: make <target>\n\nTargets:" } \
11+ /^[-_[ :alpha:]]+:.?* # / { printf " %-15s%s\n", $$1, $$2 }' $(MAKEFILE_LIST)
1012
11- install : # # Install dependencies and CLI app
13+ # # Dependency commands
14+
15+ install : # install Python dependencies and pre-commit hook
1216 pipenv install --dev
17+ pipenv run pre-commit install
1318
14- update : install # # Update all Python dependencies
19+ update : install # update Python dependencies
1520 pipenv clean
1621 pipenv update --dev
1722
18- # ## Test commands ###
23+ # # Unit Test commands
1924
20- test : # # Run tests and print a coverage report
25+ test : # run tests and print a coverage report
2126 pipenv run coverage run --source=tim -m pytest -vv
2227 pipenv run coverage report -m
2328
24- coveralls : test
29+ coveralls : test # write coverage data to an LCOV report
2530 pipenv run coverage lcov -o ./coverage/lcov.info
2631
27- # ## Code quality and safety commands ###
28-
29- lint : bandit black mypy pylama safety # # Run linting, code quality, and safety checks
32+ # # Code quality and safety commands
3033
31- bandit :
32- pipenv run bandit -r tim
34+ lint : black mypy ruff safety # run linters
3335
34- black :
36+ black : # run 'black' linter and print a preview of suggested changes
3537 pipenv run black --check --diff .
3638
37- mypy :
39+ mypy : # run 'mypy' linter
3840 pipenv run mypy tim
3941
40- pylama :
41- pipenv run pylama --options setup.cfg
42+ ruff : # run 'ruff' linter and print a preview of errors
43+ pipenv run ruff check .
4244
43- safety :
45+ safety : # check for security vulnerabilities and verify Pipfile.lock is up-to-date
4446 pipenv check
4547 pipenv verify
4648
47- # ## Terraform-generated Developer Deploy Commands for Dev environment ###
48- dist-dev : # # Build docker container (intended for developer-based manual build)
49+ lint-apply : # apply changes with 'black' and resolve fixable errors with 'ruff'
50+ black-apply ruff-apply
51+
52+ black-apply : # apply changes with 'black'
53+ pipenv run black .
54+
55+ ruff-apply : # resolve fixable errors with 'ruff'
56+ pipenv run ruff check --fix .
57+
58+ # # Terraform-generated commands for container build and deployment in dev
59+ dist-dev : # build docker container (intended for developer-based manual build)
4960 docker build --platform linux/amd64 \
5061 -t $(ECR_URL_DEV ) :latest \
5162 -t $(ECR_URL_DEV ) :` git describe --always` \
5263 -t $(ECR_NAME_DEV ) :latest .
5364
54- publish-dev : dist-dev # # Build , tag and push (intended for developer-based manual publish)
65+ publish-dev : dist-dev # build , tag and push (intended for developer-based manual publish)
5566 docker login -u AWS -p $$(aws ecr get-login-password --region us-east-1 ) $(ECR_URL_DEV )
5667 docker push $(ECR_URL_DEV ) :latest
5768 docker push $(ECR_URL_DEV ) :` git describe --always`
5869
59- # ## Terraform-generated manual shortcuts for deploying to Stage ###
60- # ## This requires that ECR_NAME_STAGE & ECR_URL_STAGE environment variables are set locally
61- # ## by the developer and that the developer has authenticated to the correct AWS Account.
62- # ## The values for the environment variables can be found in the stage_build.yml caller workflow.
63- dist-stage : # # Only use in an emergency
70+ # # Terraform-generated commands for container build and deployment in stage \
71+ This requires that ECR_NAME_STAGE and ECR_URL_STAGE environment variables \
72+ are set locally by the developer and that the developer has \
73+ authenticated to the correct AWS Account. The values for the environment \
74+ variables can be found in the stage_build.yml caller workflow. \
75+ While Stage should generally only be used in an emergency for most repos, \
76+ it is necessary for any testing requiring access to the Data Warehouse \
77+ because Cloud Connector is not enabled on Dev1.
78+ dist-stage :
6479 docker build --platform linux/amd64 \
6580 -t $(ECR_URL_STAGE ) :latest \
6681 -t $(ECR_URL_STAGE ) :` git describe --always` \
6782 -t $(ECR_NAME_STAGE ) :latest .
6883
69- publish-stage : # # Only use in an emergency
84+ publish-stage :
7085 docker login -u AWS -p $$(aws ecr get-login-password --region us-east-1 ) $(ECR_URL_STAGE )
7186 docker push $(ECR_URL_STAGE ) :latest
7287 docker push $(ECR_URL_STAGE ) :` git describe --always`
0 commit comments