-
Notifications
You must be signed in to change notification settings - Fork 27
/
Makefile
36 lines (26 loc) · 1.46 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
CKAN_VERSION ?= 2.10.1
COMPOSE_FILE ?= docker-compose.yml
build: ## Build the docker containers
CKAN_VERSION=$(CKAN_VERSION) docker compose -f $(COMPOSE_FILE) build
clean: ## Clean workspace and containers
find . -name *.pyc -delete
CKAN_VERSION=$(CKAN_VERSION) docker compose -f $(COMPOSE_FILE) down -v --remove-orphans
lint: ## Lint the code (python 3 only)
CKAN_VERSION=$(CKAN_VERSION) docker compose -f $(COMPOSE_FILE) run --rm ckan flake8 ckanext --count --show-source --statistics --exclude ckan
test: ## Run extension tests
CKAN_VERSION=$(CKAN_VERSION) docker compose -f $(COMPOSE_FILE) run --rm ckan ./test.sh
ui-test:
CKAN_VERSION=$(CKAN_VERSION) docker compose -f $(COMPOSE_FILE) -f docker-compose.test.yml up --abort-on-container-exit test
ui-interactive:
CYPRESS_BASE_URL=http://ckan:5000 npx cypress open
up: ## Start the containers
CKAN_VERSION=$(CKAN_VERSION) docker compose -f $(COMPOSE_FILE) up
upd: ## Start the containers in the background
CKAN_VERSION=$(CKAN_VERSION) docker compose -f $(COMPOSE_FILE) run --rm ckan ckan search-index rebuild -i -o -e
CKAN_VERSION=$(CKAN_VERSION) docker compose -f $(COMPOSE_FILE) up -d
.DEFAULT_GOAL := help
.PHONY: build clean help lint test up upd
# Output documentation for top-level targets
# Thanks to https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
help: ## This help
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-10s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)