From 3972830530ab58315a0c63d4d6a11aba0f7c5e4e Mon Sep 17 00:00:00 2001 From: Fuhu Xia Date: Thu, 22 Aug 2024 13:50:14 -0400 Subject: [PATCH] fix docker compose --- Makefile | 16 ++++++++-------- README.md | 8 ++++---- test.sh | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index bf06eda0..0168326a 100644 --- a/Makefile +++ b/Makefile @@ -2,28 +2,28 @@ CKAN_VERSION ?= 2.10 COMPOSE_FILE ?= docker-compose.yml build: ## Build the docker containers - CKAN_VERSION=$(CKAN_VERSION) docker-compose -f $(COMPOSE_FILE) build + CKAN_VERSION=$(CKAN_VERSION) docker compose -f $(COMPOSE_FILE) build debug: - CKAN_VERSION=$(CKAN_VERSION) docker-compose run --service-ports app + CKAN_VERSION=$(CKAN_VERSION) docker compose run --service-ports app lint: ## Lint the code - CKAN_VERSION=$(CKAN_VERSION) docker-compose -f docker-compose.yml run --rm app flake8 /srv/app/ckanext/ --count --max-line-length=127 --show-source --statistics --exclude ckan + CKAN_VERSION=$(CKAN_VERSION) docker compose -f docker-compose.yml run --rm app flake8 /srv/app/ckanext/ --count --max-line-length=127 --show-source --statistics --exclude ckan clean: ## Clean workspace and containers find . -name *.pyc -delete - CKAN_VERSION=$(CKAN_VERSION) docker-compose -f $(COMPOSE_FILE) down -v --remove-orphans + CKAN_VERSION=$(CKAN_VERSION) docker compose -f $(COMPOSE_FILE) down -v --remove-orphans test: ## Run tests in a new container - CKAN_VERSION=$(CKAN_VERSION) docker-compose -f $(COMPOSE_FILE) run --rm app /srv/app/test.sh + CKAN_VERSION=$(CKAN_VERSION) docker compose -f $(COMPOSE_FILE) run --rm app /srv/app/test.sh java-test: ## Test java transformation command (java + saxon installed) - CKAN_VERSION=$(CKAN_VERSION) docker-compose -f $(COMPOSE_FILE) run --rm app bash -c "java net.sf.saxon.Transform -s:/app/ckanext/geodatagov/tests/data-samples/waf-fgdc/fgdc-csdgm_sample.xml -xsl:/app/ckanext/geodatagov/harvesters/fgdcrse2iso19115-2.xslt" + CKAN_VERSION=$(CKAN_VERSION) docker compose -f $(COMPOSE_FILE) run --rm app bash -c "java net.sf.saxon.Transform -s:/app/ckanext/geodatagov/tests/data-samples/waf-fgdc/fgdc-csdgm_sample.xml -xsl:/app/ckanext/geodatagov/harvesters/fgdcrse2iso19115-2.xslt" up: ## Start the containers - CKAN_VERSION=$(CKAN_VERSION) docker-compose -f $(COMPOSE_FILE) up + CKAN_VERSION=$(CKAN_VERSION) docker compose -f $(COMPOSE_FILE) up ci: ## Start the containers in the background - CKAN_VERSION=$(CKAN_VERSION) docker-compose -f $(COMPOSE_FILE) up -d + CKAN_VERSION=$(CKAN_VERSION) docker compose -f $(COMPOSE_FILE) up -d .DEFAULT_GOAL := help .PHONY: build clean help lint test up diff --git a/README.md b/README.md index 8843a400..f7a35e8b 100644 --- a/README.md +++ b/README.md @@ -46,18 +46,18 @@ All the tests live in the [/ckanext/geodatagov/tests](/ckanext/geodatagov/tests) ### Build Environment To start environment, run: -```docker-compose build``` -```docker-compose up``` +```docker compose build``` +```docker compose up``` CKAN will start at localhost:5000 To shut down environment, run: -```docker-compose down``` +```docker compose down``` To docker exec into the CKAN image, run: -```docker-compose exec app /bin/bash``` +```docker compose exec app /bin/bash``` ### Testing diff --git a/test.sh b/test.sh index 2be43ec9..7049affe 100755 --- a/test.sh +++ b/test.sh @@ -2,7 +2,7 @@ # Setup and run extension tests. This script should be run in a _clean_ CKAN # environment. e.g.: # -# $ docker-compose run --rm app ./test.sh +# $ docker compose run --rm app ./test.sh # set -o errexit