Skip to content

Commit 2cb8e78

Browse files
authored
update docker compose command change, update action version (#338)
Updates needed to get GitHub Actions up and running. Note: The `test.yaml` needs to be updated once we get the test template for 2.11 merged into data.gov (PR: GSA/data.gov#5122)
1 parent 2f9e804 commit 2cb8e78

12 files changed

Lines changed: 242 additions & 24 deletions

File tree

.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ CKAN_SYSADMIN_NAME=admin
1010
CKAN_SYSADMIN_PASSWORD=password
1111
CKAN_SYSADMIN_EMAIL=your_email@example.com
1212
TZ=UTC
13+
CKAN_VERSION=2.10
1314

1415
# Database connections (TODO: avoid duplication)
1516
CKAN_SQLALCHEMY_URL=postgresql://ckan_default:pass@db/ckan_test

.github/workflows/test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on: [push, workflow_dispatch]
44
jobs:
55
lint-test:
66
name: Lint + Test
7-
uses: gsa/data.gov/.github/workflows/ckan-test.yml@main
7+
uses: gsa/data.gov/.github/workflows/ckan-test.yml@ckan-211-swig
88
with:
99
ext_name: dcat_usmetadata
1010
plugins: dcat_usmetadata usmetadata
@@ -82,9 +82,9 @@ jobs:
8282
CKAN_VERSION=2.10 yarn install
8383
CKAN_VERSION=2.10 yarn build
8484
CKAN_VERSION=2.10 yarn dockerize
85-
CKAN_VERSION=2.10 docker-compose -f docker-compose.yml -f docker-compose.cypress.yml run cypress /bin/bash -c "npx wait-on http://ckan:5000/api/action/status_show && npx cypress install && yarn && NODE_ENV=test npx cypress run --spec cypress/integration/${{ matrix.test-files }}"
85+
CKAN_VERSION=2.10 docker compose -f docker-compose.yml -f docker-compose.cypress.yml run cypress /bin/bash -c "npx wait-on http://ckan:5000/api/action/status_show --timeout 120000 && npx cypress install && yarn && NODE_ENV=test npx cypress run --spec cypress/integration/${{ matrix.test-files }}"
8686
- name: cypress-artifacs
87-
uses: actions/upload-artifact@v3
87+
uses: actions/upload-artifact@v4
8888
if: failure()
8989
with:
9090
name: cypress-artifacts

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ ARG CKAN_VERSION=2.10
22
FROM openknowledge/ckan-dev:${CKAN_VERSION}
33
ARG CKAN_VERSION
44

5-
RUN apk add swig
5+
RUN apk add swig
66
RUN pip install --upgrade pip
77

88
COPY . ${APP_DIR}/

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ yarn e2e
174174
Note, it may be necessary to remove cached images when rebuilding the docker container, in order to ensure that the new usmetadata-app template is included in the build. If you want to make sure that you aren't using cached builds, you can try:
175175

176176
```bash
177-
docker-compose build --no-cache --pull ckanext-dcat_usmetadata_app
177+
docker compose build --no-cache --pull ckanext-dcat_usmetadata_app
178178
```
179179

180180
To run e2e tests interactively use:

cypress.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"baseUrl": "http://ckan:5000",
33
"chromeWebSecurity": false,
4-
"videoCompression": false
4+
"videoCompression": false,
5+
"requestTimeout": 15000
56
}

docker-compose.cypress.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
version: "3.7"
21
services:
32
cypress:
43
image: cypress/included:12.17.2
54
environment:
65
NODE_ENV: test
76
entrypoint: []
8-
command: /bin/bash -c 'npx wait-on http://ckan:5000/api/action/status_show && npx cypress install && npx cypress run'
7+
command: /bin/bash -c 'npx wait-on http://ckan:5000/api/action/status_show --timeout 120000 && npx cypress install && npx cypress run'
98
# Run a specific test
109
# command: /bin/bash -c 'npx wait-on http://ckan:5000/api/action/status_show && npx cypress install && npx cypress run --spec cypress/integration/additional-metadata.spec.js'
1110
ipc: host

docker-compose.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
version: "3.7"
21
services:
32
ckan:
43
image: datagov/ckanext-dcat_usmetadata:${CKAN_VERSION}
54
build:
65
context: .
76
args:
87
CKAN_VERSION: ${CKAN_VERSION}
8+
hostname: ckan
99
env_file:
1010
- .env
1111
environment:
@@ -14,7 +14,7 @@ services:
1414
CKAN_DATASTORE_READ_URL: postgresql://datastore_read:pass@db/datastore_test
1515
CKAN_SOLR_URL: http://solr:8983/solr/ckan
1616
CKAN_REDIS_URL: redis://redis:6379/1
17-
CKAN_DATAPUSHER_URL: http://localhost:8080/ # datapusher is not really enabled
17+
CKAN_DATAPUSHER_URL: http://localhost:8080/ # datapusher is not really enabled
1818
CKAN__PLUGINS: dcat_usmetadata usmetadata
1919
PYTHONDONTWRITEBYTECODE: 1
2020
# command: /bin/bash -c "while ! nc -zv db 5432; do echo \"CKAN** Waiting for DB\"; sleep 3; done; /srv/app/start_ckan_development.sh"
@@ -30,7 +30,7 @@ services:
3030
- ./test.ini:/srv/app/test.ini
3131
- ./setup.py:/srv/app/setup.py
3232
- /etc/timezone:/etc/timezone:ro
33-
33+
3434
db:
3535
image: ckan/ckan-postgres-dev:${CKAN_VERSION}
3636
environment:

makefile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
CKAN_VERSION ?= 2.10
2+
COMPOSE_FILE ?= docker-compose.yml
3+
4+
build:
5+
CKAN_VERSION=$(CKAN_VERSION) docker compose -f $(COMPOSE_FILE) build
6+
7+
up:
8+
CKAN_VERSION=$(CKAN_VERSION) docker compose -f $(COMPOSE_FILE) up
9+
10+
down:
11+
docker compose down
12+
13+
.DEFAULT_GOAL := help
14+
.PHONY: build up
15+
16+
# Output documentation for top-level targets
17+
# Thanks to https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
18+
help: ## This help
19+
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-10s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)

package.json

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@
44
"description": "This extension provides a react Admin UI for managing custom fields related to [DCAT-US Schema](https://https://resources.data.gov/resources/dcat-us/).",
55
"main": "index.js",
66
"scripts": {
7-
"build:docker": "docker-compose build",
7+
"build:docker": "docker compose build",
88
"package": "python setup.py sdist && python setup.py bdist_wheel",
9-
"clean": "docker-compose down -v --remove-orphans",
10-
"test": "yarn dockerize && docker-compose run --rm ckan /srv/app/test.sh",
11-
"up": "docker-compose -f docker-compose.yml up",
12-
"lint:python": "docker-compose -f docker-compose.yml run --rm ckan flake8 /srv/app --count --show-source --statistics --exclude ckan --max-line-length 127",
13-
"dockerize": "docker-compose -f docker-compose.yml up -d",
9+
"clean": "docker compose down -v --remove-orphans",
10+
"test": "yarn dockerize && docker compose run --rm ckan /srv/app/test.sh",
11+
"up": "docker compose -f docker-compose.yml up",
12+
"lint:python": "docker compose -f docker-compose.yml run --rm ckan flake8 /srv/app --count --show-source --statistics --exclude ckan --max-line-length 127",
13+
"dockerize": "docker compose -f docker-compose.yml up -d",
1414
"test:metadata-app": "node react-scripts/test.js --watchAll=false",
1515
"test:metadata-app:watch": "node react-scripts/test.js --watchAll=true",
1616
"pre-commit": "echo 'formatting your changes...' && eslint metadata-app/src/ && prettier --write",
17-
"e2e": "docker-compose -f docker-compose.yml -f docker-compose.cypress.yml run cypress /bin/bash -c \"npx wait-on http://ckan:5000/api/action/status_show && npx cypress install && yarn && NODE_ENV=test npx cypress run\"",
18-
"e2e:interactive": "docker-compose -f docker-compose.yml up -d && yarn && NODE_ENV=test npx cypress open",
17+
"e2e": "docker compose -f docker-compose.yml -f docker-compose.cypress.yml run cypress /bin/bash -c \"npx wait-on http://ckan:5000/api/action/status_show --timeout 120000 && npx cypress install && yarn && NODE_ENV=test npx cypress run\"",
18+
"e2e:interactive": "docker compose -f docker-compose.yml up -d && yarn && NODE_ENV=test npx cypress open",
1919
"lint:js": "npx eslint metadata-app/src && npx prettier --check metadata-app/src",
2020
"rename:builds": "cd ckanext/dcat_usmetadata/public/ && mv assets/css . && mv assets/js .",
2121
"start:dev": "yarn dockerize && yarn && cd metadata-app && yarn start:metadata-app",
@@ -140,7 +140,8 @@
140140
"eslint-plugin-react": "^7.22.0",
141141
"husky": "^4.2.5",
142142
"lint-staged": "^10.2.11",
143-
"prettier": "^2.0.5"
143+
"prettier": "^2.0.5",
144+
"wait-on": "8.0.3"
144145
},
145146
"jest": {
146147
"roots": [
@@ -205,5 +206,6 @@
205206
"url": "git@gitlab.com:datopian/clients/ckanext-dcat_usmetadata.git"
206207
},
207208
"author": "",
208-
"license": "ISC"
209+
"license": "ISC",
210+
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
209211
}

requirements.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ repoze.who==2.4
1111
webob
1212

1313
# ckanext-saml2 dependencies
14-
M2Crypto==0.36.0
14+
M2Crypto==0.44.0
15+
1516
#-e git+https://github.com/IdentityPython/pysaml2.git#egg=pysaml2
1617
pysaml2
1718

@@ -27,3 +28,4 @@ pyOpenSSL==20.0.1
2728
python-memcached==1.58
2829
pip==23.3.1
2930
flake8
31+
packaging==21.3

0 commit comments

Comments
 (0)