-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[QOLDEV-954] replace obsolete test containers
- Loading branch information
Showing
10 changed files
with
86 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,36 +7,30 @@ set -ex | |
## | ||
# BEGIN: Add sysadmin config values. | ||
# | ||
curl -LsH "Authorization: ${API_KEY}" \ | ||
--data '{ | ||
api_call '{ | ||
"ckan.comments.profanity_list": "", | ||
"ckan.datarequests.closing_circumstances": "Released as open data|nominate_dataset\r\nOpen dataset already exists|nominate_dataset\r\nPartially released|nominate_dataset\r\nTo be released as open data at a later date|nominate_approximate_date\r\nData openly available elsewhere\r\nNot suitable for release as open data\r\nRequested data not available/cannot be compiled\r\nRequestor initiated closure", | ||
"ckanext.data_qld.resource_formats": "CSV\r\nHTML\r\nJSON\r\nRDF\r\nTXT\r\nXLS" | ||
}' \ | ||
${CKAN_ACTION_URL}/config_option_update | ||
}' config_option_update | ||
|
||
## | ||
# END. | ||
# | ||
|
||
# Create private test dataset with our standard fields | ||
curl -LsH "Authorization: ${API_KEY}" \ | ||
--data '{"name": "test-dataset", "owner_org": "'"${TEST_ORG_ID}"'", "private": true, | ||
api_call '{"name": "test-dataset", "owner_org": "'"${TEST_ORG_ID}"'", "private": true, | ||
"update_frequency": "monthly", "author_email": "admin@localhost", "version": "1.0", | ||
"license_id": "other-open", "data_driven_application": "NO", "security_classification": "PUBLIC", | ||
"notes": "private test", "de_identified_data": "NO"}' \ | ||
${CKAN_ACTION_URL}/package_create | ||
"notes": "private test", "de_identified_data": "NO"}' package_create | ||
|
||
# Create public test dataset with our standard fields | ||
curl -LsH "Authorization: ${API_KEY}" \ | ||
--data '{"name": "public-test-dataset", "owner_org": "'"${TEST_ORG_ID}"'", | ||
api_call '{"name": "public-test-dataset", "owner_org": "'"${TEST_ORG_ID}"'", | ||
"update_frequency": "monthly", "author_email": "[email protected]", "version": "1.0", | ||
"license_id": "other-open", "data_driven_application": "NO", "security_classification": "PUBLIC", | ||
"notes": "public test", "de_identified_data": "NO", "resources": [ | ||
{"name": "test-resource", "description": "Test resource description", | ||
"url": "https://example.com/foo", "format": "HTML", "size": 1024} | ||
]}' \ | ||
${CKAN_ACTION_URL}/package_create | ||
]}' package_create | ||
|
||
# Populate Archiver data for test dataset | ||
ckan_cli archiver update-test public-test-dataset | ||
|
@@ -56,36 +50,26 @@ add_user_if_needed dr_editor "Data Request Editor" dr_editor@localhost | |
echo "Creating ${DR_ORG_TITLE} Organisation:" | ||
|
||
DR_ORG=$( \ | ||
curl -LsH "Authorization: ${API_KEY}" \ | ||
--data '{"name": "'"${DR_ORG_NAME}"'", "title": "'"${DR_ORG_TITLE}"'"}' \ | ||
${CKAN_ACTION_URL}/organization_create | ||
api_call '{"name": "'"${DR_ORG_NAME}"'", "title": "'"${DR_ORG_TITLE}"'"}' organization_create | ||
) | ||
|
||
DR_ORG_ID=$(echo $DR_ORG | $PYTHON $APP_DIR/bin/extract-id.py) | ||
|
||
echo "Assigning test users to ${DR_ORG_TITLE} Organisation:" | ||
|
||
curl -LsH "Authorization: ${API_KEY}" \ | ||
--data '{"id": "'"${DR_ORG_ID}"'", "object": "dr_admin", "object_type": "user", "capacity": "admin"}' \ | ||
${CKAN_ACTION_URL}/member_create | ||
api_call '{"id": "'"${DR_ORG_ID}"'", "object": "dr_admin", "object_type": "user", "capacity": "admin"}' member_create | ||
|
||
curl -LsH "Authorization: ${API_KEY}" \ | ||
--data '{"id": "'"${DR_ORG_ID}"'", "object": "dr_editor", "object_type": "user", "capacity": "editor"}' \ | ||
${CKAN_ACTION_URL}/member_create | ||
api_call '{"id": "'"${DR_ORG_ID}"'", "object": "dr_editor", "object_type": "user", "capacity": "editor"}' member_create | ||
|
||
echo "Creating test dataset for data request organisation:" | ||
|
||
curl -LsH "Authorization: ${API_KEY}" \ | ||
--data '{"name": "data_request_dataset", "title": "Dataset for data requests", "owner_org": "'"${DR_ORG_ID}"'", | ||
api_call '{"name": "data_request_dataset", "title": "Dataset for data requests", "owner_org": "'"${DR_ORG_ID}"'", | ||
"update_frequency": "near-realtime", "author_email": "dr_admin@localhost", "version": "1.0", "license_id": "cc-by-4", | ||
"data_driven_application": "NO", "security_classification": "PUBLIC", "notes": "test", "de_identified_data": "NO"}'\ | ||
${CKAN_ACTION_URL}/package_create | ||
"data_driven_application": "NO", "security_classification": "PUBLIC", "notes": "test", "de_identified_data": "NO"}'package_create | ||
|
||
echo "Creating test Data Request:" | ||
|
||
curl -LsH "Authorization: ${API_KEY}" \ | ||
--data '{"title": "Test Request", "description": "This is an example", "organization_id": "'"${TEST_ORG_ID}"'"}' \ | ||
${CKAN_ACTION_URL}/create_datarequest | ||
api_call '{"title": "Test Request", "description": "This is an example", "organization_id": "'"${TEST_ORG_ID}"'"}' create_datarequest | ||
|
||
## | ||
# END. | ||
|
@@ -105,24 +89,18 @@ add_user_if_needed report_admin "Reporting Admin" report_admin@localhost | |
echo "Creating ${REPORT_ORG_TITLE} Organisation:" | ||
|
||
REPORT_ORG=$( \ | ||
curl -LsH "Authorization: ${API_KEY}" \ | ||
--data '{"name": "'"${REPORT_ORG_NAME}"'", "title": "'"${REPORT_ORG_TITLE}"'"}' \ | ||
${CKAN_ACTION_URL}/organization_create | ||
api_call '{"name": "'"${REPORT_ORG_NAME}"'", "title": "'"${REPORT_ORG_TITLE}"'"}' organization_create | ||
) | ||
|
||
REPORT_ORG_ID=$(echo $REPORT_ORG | $PYTHON $APP_DIR/bin/extract-id.py) | ||
|
||
echo "Assigning admin user to ${REPORT_ORG_TITLE} Organisation:" | ||
|
||
curl -LsH "Authorization: ${API_KEY}" \ | ||
--data '{"id": "'"${REPORT_ORG_ID}"'", "object": "report_admin", "object_type": "user", "capacity": "admin"}' \ | ||
${CKAN_ACTION_URL}/member_create | ||
api_call '{"id": "'"${REPORT_ORG_ID}"'", "object": "report_admin", "object_type": "user", "capacity": "admin"}' member_create | ||
|
||
echo "Creating test Data Request for reporting:" | ||
|
||
curl -LsH "Authorization: ${API_KEY}" \ | ||
--data '{"title": "Reporting Request", "description": "Data Request for reporting", "organization_id": "'"${REPORT_ORG_ID}"'"}' \ | ||
${CKAN_ACTION_URL}/create_datarequest | ||
api_call '{"title": "Reporting Request", "description": "Data Request for reporting", "organization_id": "'"${REPORT_ORG_ID}"'"}' create_datarequest | ||
|
||
## | ||
# END. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.