Skip to content

Commit

Permalink
fix docker compose
Browse files Browse the repository at this point in the history
  • Loading branch information
FuhuXia committed Aug 22, 2024
1 parent dbd6679 commit 3972830
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
16 changes: 8 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3972830

Please sign in to comment.