Skip to content
Snippets Groups Projects
Commit 590b7c06 authored by Nathan Hertz's avatar Nathan Hertz
Browse files

Added some quality-of-life improvements to the Makefile: make setup now

installs all requirements required by all 3 services; new rule: make
clean, which cleans up your Python environment and your Docker environment; make test now runs setup.py files for all packages
parent 687b62a1
No related branches found
No related tags found
1 merge request!84Makefile quality-of-life improvements
Pipeline #579 passed
SHELL := /bin/bash
.PHONY: check-build test-dev test dev setup alembic-update docker-base build create-coverage-config clean
all: dev check-build
# Check if local code will pass CI build
.PHONY: check-build
check-build: docker-base docker-dev-images-locally test-dev
# Run tests on Dockerfile.dev images
.PHONY: test-dev
test-dev:
docker run nrao:workflow ./bin/run-tests.sh
docker run nrao:capability ./bin/run-tests.sh
docker run nrao:notification ./bin/run-tests.sh
# Run tests on Dockerfile.local containers
.PHONY: test
test:
docker exec workspaces_workflow_1 ./bin/run-tests.sh
docker exec workspaces_capability_1 ./bin/run-tests.sh
docker exec workspaces_notification_1 ./bin/run-tests.sh
# Setup local development environment
.PHONY: dev
dev: docker-base
.PHONY: setup
setup:
docker exec workspaces_capability_1 /bin/bash -c 'python -m pip install -r requirements.txt'
docker exec workspaces_capability_1 /bin/bash -c 'python -m pip install -e .'
docker exec workspaces_workflow_1 /bin/bash -c 'python -m pip install -r requirements.txt'
docker exec workspaces_workflow_1 /bin/bash -c 'python -m pip install -e .'
docker exec workspaces_notification_1 /bin/bash -c 'python -m pip install -r requirements.txt'
docker exec workspaces_notification_1 /bin/bash -c 'python -m pip install -e .'
docker-compose restart
.PHONY: alembic-update
alembic-update:
cd schema; \
env CAPO_PROFILE=local alembic upgrade head
# Build images from Dockerfile.dev
.PHONY: docker-dev-images-locally
docker-dev-images-locally:
docker build -t nrao:workflow -f services/workflow/Dockerfile.local . --build-arg capo_env=docker
docker build -t nrao:capability -f services/capability/Dockerfile.local . --build-arg capo_env=docker
docker build -t nrao:notification -f services/notification/Dockerfile.local . --build-arg capo_env=docker
# Build base image
.PHONY: docker-base
docker-base:
docker build -t marconi.aoc.nrao.edu/ops/base:workspaces -f Dockerfile.base .
# Build docker images
build: docker-base
docker-compose build --no-cache
# CI HELPERS
# create .coveragerc
.PHONY: create-coverage-config
create-coverage-config:
./ci/helpers/add-coverage-rc.sh
\ No newline at end of file
./ci/helpers/add-coverage-rc.sh
# Clean up environment
clean:
# Clean up Docker environment
docker-compose down
-docker images -aq | xargs docker rmi
docker system prune --volumes -af
docker volume prune -f
# Delete Python cache directories
find . \( -name "*.egg-info" -o -name ".pytest_cache" \) | xargs rm -r
# This is used by the automated testing infrastructure.
# see services/capability/bin/run-tests.sh, services/workflow/bin/run-tests.sh,
# and services/notification/bin/run-tests.sh for more details
-e ../shared/schema
-e ../shared/channels
-e ../shared/workspaces
-e ../apps/cli/utilities/wf_monitor
-e ../apps/cli/executables/datafetcher
-e ../apps/cli/executables/delivery
-e ../apps/cli/executables/null
-e ../apps/cli/executables/tmpdir_eraser
-e ../apps/cli/executables/vulture
pytest>=5.4,<6.0
pendulum==2.1.2
pytest-mock==3.3.1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment