mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-01 07:35:34 -05:00
Revert "Celery 4"
This commit is contained in:
33
Makefile
33
Makefile
@@ -2,6 +2,7 @@
|
||||
SHELL := /bin/bash
|
||||
DATE = $(shell date +%Y-%m-%d:%H:%M:%S)
|
||||
|
||||
PIP_ACCEL_CACHE ?= ${CURDIR}/cache/pip-accel
|
||||
APP_VERSION_FILE = app/version.py
|
||||
|
||||
GIT_BRANCH ?= $(shell git symbolic-ref --short HEAD 2> /dev/null || echo "detached")
|
||||
@@ -33,19 +34,11 @@ help:
|
||||
@cat $(MAKEFILE_LIST) | grep -E '^[a-zA-Z_-]+:.*?## .*$$' | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
|
||||
|
||||
.PHONY: venv
|
||||
# if there's a virtualenv already active, we don't want to do anything
|
||||
ifeq ($(VIRTUAL_ENV),)
|
||||
venv: venv/bin/activate ## Create virtualenv if it does not exist
|
||||
|
||||
venv/bin/activate:
|
||||
test -d venv || virtualenv venv -p python3
|
||||
|
||||
VENV_BIN_DIR = $(shell . venv/bin/activate && echo $$VIRTUAL_ENV/bin)
|
||||
else
|
||||
venv:
|
||||
|
||||
VENV_BIN_DIR = $(VIRTUAL_ENV)/bin
|
||||
endif
|
||||
. venv/bin/activate && pip install pip-accel
|
||||
|
||||
.PHONY: check-env-vars
|
||||
check-env-vars: ## Check mandatory environment variables
|
||||
@@ -72,9 +65,9 @@ production: ## Set environment to production
|
||||
@true
|
||||
|
||||
.PHONY: dependencies
|
||||
dependencies: venv
|
||||
$(call install-pycurl, $(VENV_BIN_DIR)/pip)
|
||||
$(VENV_BIN_DIR)/pip install -r requirements_for_test.txt
|
||||
dependencies: venv ## Install build dependencies
|
||||
mkdir -p ${PIP_ACCEL_CACHE}
|
||||
. venv/bin/activate && PIP_ACCEL_CACHE=${PIP_ACCEL_CACHE} pip-accel install -r requirements_for_test.txt
|
||||
|
||||
.PHONY: generate-version-file
|
||||
generate-version-file: ## Generates the app version file
|
||||
@@ -82,7 +75,7 @@ generate-version-file: ## Generates the app version file
|
||||
|
||||
.PHONY: build
|
||||
build: dependencies generate-version-file ## Build project
|
||||
|
||||
. venv/bin/activate && PIP_ACCEL_CACHE=${PIP_ACCEL_CACHE} pip-accel install -r requirements.txt
|
||||
|
||||
.PHONY: build-paas-artifact
|
||||
build-paas-artifact: ## Build the deploy artifact for PaaS
|
||||
@@ -104,7 +97,6 @@ test: venv generate-version-file ## Run tests
|
||||
freeze-requirements:
|
||||
rm -rf venv-freeze
|
||||
virtualenv -p python3 venv-freeze
|
||||
$(call install-pycurl, $$(pwd)/venv-freeze/bin/pip)
|
||||
$$(pwd)/venv-freeze/bin/pip install -r requirements-app.txt
|
||||
echo '# pyup: ignore file' > requirements.txt
|
||||
echo '# This file is autogenerated. Do not edit it manually.' >> requirements.txt
|
||||
@@ -113,15 +105,6 @@ freeze-requirements:
|
||||
$$(pwd)/venv-freeze/bin/pip freeze -r <(sed '/^--/d' requirements-app.txt) | sed -n '/The following requirements were added by pip freeze/,$$p' >> requirements.txt
|
||||
rm -rf venv-freeze
|
||||
|
||||
define install-pycurl
|
||||
# install pycurl separately to avoid flags disabling wheels for other packages
|
||||
PYCURL_SSL_LIBRARY=openssl ${1} install pycurl==7.43.0.2 --global-option="build_ext" --global-option="-I/usr/local/opt/openssl/include"
|
||||
endef
|
||||
|
||||
.PHONY: install-pycurl
|
||||
install-pycurl:
|
||||
$(call install-pycurl, pip)
|
||||
|
||||
.PHONY: test-requirements
|
||||
test-requirements:
|
||||
@diff requirements-app.txt requirements.txt | grep '<' \
|
||||
@@ -131,10 +114,11 @@ test-requirements:
|
||||
|
||||
.PHONY: coverage
|
||||
coverage: venv ## Create coverage report
|
||||
coveralls
|
||||
. venv/bin/activate && coveralls
|
||||
|
||||
.PHONY: prepare-docker-build-image
|
||||
prepare-docker-build-image: ## Prepare the Docker builder image
|
||||
mkdir -p ${PIP_ACCEL_CACHE}
|
||||
make -C docker build
|
||||
|
||||
.PHONY: build-with-docker
|
||||
@@ -142,6 +126,7 @@ build-with-docker: prepare-docker-build-image ## Build inside a Docker container
|
||||
@docker run -i${DOCKER_TTY} --rm \
|
||||
--name "${DOCKER_CONTAINER_PREFIX}-build" \
|
||||
-v "`pwd`:/var/project" \
|
||||
-v "${PIP_ACCEL_CACHE}:/var/project/cache/pip-accel" \
|
||||
-e UID=$(shell id -u) \
|
||||
-e GID=$(shell id -g) \
|
||||
-e GIT_COMMIT=${GIT_COMMIT} \
|
||||
|
||||
Reference in New Issue
Block a user