2019-06-18 16:48:39 +00:00
|
|
|
VERSION ?= $(shell grep '__version__' cloudbender/__init__.py | cut -d' ' -f3 | cut -d'-' -f1 | sed -e 's/"//g')
|
2021-09-20 14:19:14 +00:00
|
|
|
PACKAGE_FILE := dist/cloudbender-$(VERSION).py3-none-any.whl
|
2019-06-18 16:48:39 +00:00
|
|
|
|
2021-09-23 17:27:06 +00:00
|
|
|
REGISTRY := public.ecr.aws/zero-downtime
|
|
|
|
REPOSITORY := cloudbender
|
|
|
|
TAG := $(REPOSITORY):v$(VERSION)
|
|
|
|
|
|
|
|
.PHONY: test build test_upload upload all dev_setup docker
|
2019-06-18 16:48:39 +00:00
|
|
|
|
|
|
|
all: test build
|
2019-02-07 22:05:33 +00:00
|
|
|
|
2021-09-23 17:27:06 +00:00
|
|
|
dev_setup:
|
|
|
|
pip install -r requirements.txt --user
|
|
|
|
|
2019-02-07 22:05:33 +00:00
|
|
|
test:
|
2019-06-18 16:48:39 +00:00
|
|
|
flake8 --ignore=E501 cloudbender tests
|
|
|
|
TEST=True pytest --log-cli-level=DEBUG
|
2019-02-07 22:05:33 +00:00
|
|
|
|
|
|
|
clean:
|
2019-09-02 11:13:40 +00:00
|
|
|
rm -rf .cache build .coverage .eggs cloudbender.egg-info .pytest_cache dist
|
2021-10-05 10:52:15 +00:00
|
|
|
podman rmi -f $(TAG)
|
2019-06-18 16:48:39 +00:00
|
|
|
|
|
|
|
build: $(PACKAGE_FILE)
|
2019-02-07 22:05:33 +00:00
|
|
|
|
2019-06-18 16:48:39 +00:00
|
|
|
$(PACKAGE_FILE):
|
2019-02-07 22:05:33 +00:00
|
|
|
python setup.py bdist_wheel --universal
|
|
|
|
|
2019-06-18 16:48:39 +00:00
|
|
|
test_upload: $(PACKAGE_FILE)
|
2019-02-07 22:05:33 +00:00
|
|
|
twine upload --repository-url https://test.pypi.org/legacy/ dist/cloudbender-*.whl
|
|
|
|
|
2019-06-18 16:48:39 +00:00
|
|
|
upload: $(PACKAGE_FILE)
|
2021-02-22 18:38:44 +00:00
|
|
|
twine upload --repository-url https://upload.pypi.org/legacy/ dist/cloudbender-*.whl
|
2021-09-23 17:27:06 +00:00
|
|
|
|
|
|
|
docker:
|
|
|
|
podman build --rm --squash-all --build-arg version=$(VERSION) -t $(TAG) .
|
|
|
|
|
|
|
|
push:
|
|
|
|
aws ecr-public get-login-password --region us-east-1 | podman login --username AWS --password-stdin $(REGISTRY)
|
|
|
|
podman tag $(TAG) $(REGISTRY)/$(TAG)
|
|
|
|
podman push $(REGISTRY)/$(TAG)
|
|
|
|
|
|
|
|
scan:
|
|
|
|
podman system service&
|
|
|
|
sleep 3; trivy $(TAG)
|