forked from GSA/catalog.data.gov
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
128 lines (95 loc) · 4.03 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
.PHONY: all build clean copy-src local setup test up update-dependencies
CKAN_HOME := /srv/app
all: build
ci:
docker-compose up -d
build:
docker build -t ghcr.io/gsa/catalog.data.gov:latest ckan/
docker build -t ghcr.io/gsa/catalog.data.gov.solr:latest solr/
docker build -t ghcr.io/gsa/catalog.data.gov.db:latest postgresql/
docker-compose build
clean:
docker-compose down -v --remove-orphans
copy-src:
docker cp catalog-app_ckan_1:$(CKAN_HOME)/src .
cypress:
# Turn on local system, and open cypress in interactive mode
docker-compose up -d && cd e2e && CYPRESS_USER=admin CYPRESS_USER_PASSWORD=password CYPRESS_BASE_URL=http://localhost:5000 npx cypress open
dev:
docker build -t ghcr.io/gsa/catalog.data.gov:latest ckan/
docker-compose build
docker-compose up
debug:
docker build -t ghcr.io/gsa/catalog.data.gov:latest ckan/
docker-compose build
docker-compose run --service-ports ckan
test:
# docker build -t ghcr.io/gsa/catalog.data.gov:latest ckan/
docker-compose -f docker-compose.yml -f docker-compose.test.yml build
docker-compose -f docker-compose.yml -f docker-compose.test.yml up --abort-on-container-exit test
quick-bat-test:
# if local environment is already build and running
docker-compose -f docker-compose.yml -f docker-compose.test.yml up --abort-on-container-exit test
update-dependencies:
docker-compose run --rm -T ckan /app/ckan/freeze-requirements.sh $(shell id -u) $(shell id -g)
up:
docker-compose up
test-import-tool:
cd tools/harvest_source_import && \
pip install pip==20.3.3 && \
pip install -r dev-requirements.txt && \
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics && \
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics && \
python -m pytest --vcr-record=none tests/
lint-all:
docker-compose exec -T ckan \
bash -c "cd $(CKAN_HOME)/src && \
pip install pip==20.3.3 && \
pip install flake8 && \
flake8 . --count --select=E9 --show-source --statistics"
generate-openess-report:
# generate report at /report/openness
docker-compose exec ckan report generate openness
update-tracking-info:
# https://docs.ckan.org/en/2.8/maintaining/tracking.html
docker-compose exec ckan ckan tracking update
rebuild-search-index:
docker-compose exec ckan ckan search-index rebuild
update-qa-info:
# QA is performed when a dataset/resource is archived, or you can run it manually using a ckan command:
docker-compose exec ckan ckan qa update
update-archiver-info:
docker-compose exec ckan ckan archiver update
generate-all-reports:
docker-compose exec ckan ckan report generate
ckan-worker:
docker-compose exec ckan ckan jobs worker bulk
archiver-worker:
export C_FORCE_ROOT=1 # celery don't want to run as root
docker-compose exec ckan ckan celeryd2 run all
harvest-fetch-queue:
docker-compose exec ckan ckan harvester fetch-consumer
harvest-gather-queue:
docker-compose exec ckan ckan harvester gather-consumer
harvest-check-finished-jobs:
docker-compose exec ckan ckan harvester run
test-extensions:
# test our extensions
# deal with the CKAN path
docker-compose exec ckan bash -c "ln -sf $(CKAN_HOME)/src/ckan $(CKAN_HOME)/ckan"
# full test datajson
docker-compose exec ckan bash -c \
"cd $(CKAN_HOME)/src/ckanext-datajson && \
nosetests --ckan --with-pylons=$(CKAN_HOME)/src/ckan/test-catalog-next.ini ckanext/datajson/tests --debug=ckanext"
# full test datagovtheme
docker-compose exec ckan bash -c \
"cd $(CKAN_HOME)/src/ckanext-datagovtheme && \
nosetests --ckan --with-pylons=$(CKAN_HOME)/src/ckan/test-catalog-next.ini ckanext/datagovtheme/tests --debug=ckanext"
# full test geodatagov
docker-compose exec ckan bash -c \
"cd $(CKAN_HOME)/src/ckanext-geodatagov && \
nosetests --ckan --with-pylons=$(CKAN_HOME)/src/ckan/test-catalog-next.ini ckanext/geodatagov/tests --debug=ckanext"
# full test geodatagov
docker-compose exec ckan bash -c \
"cd $(CKAN_HOME)/src/ckanext-datagovdatalog && \
nosetests --ckan --with-pylons=$(CKAN_HOME)/src/ckan/test-catalog-next.ini ckanext/datagovdatalog/tests --debug=ckanext"