-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fdcea7a
commit bd7357b
Showing
4 changed files
with
15 additions
and
14 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
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 |
---|---|---|
|
@@ -24,11 +24,12 @@ on: | |
description: PostgreSQL Database Name | ||
required: true | ||
type: string | ||
# TODO: remove this parameter once the populate script is no longer needed | ||
RUN_POPULATE_SCRIPT: | ||
description: Option to run the script that populates the database | ||
required: false | ||
default: false | ||
type: boolean | ||
default: 'false' | ||
type: string | ||
REGION: | ||
description: GCP region | ||
required: true | ||
|
@@ -67,7 +68,7 @@ jobs: | |
url: 'jdbc:postgresql://${{ env.DB_IP }}:5432/${{ inputs.DB_NAME }}' | ||
|
||
- name: Clear content of the database | ||
if: inputs.RUN_POPULATE_SCRIPT | ||
if: inputs.RUN_POPULATE_SCRIPT == 'true' | ||
uses: liquibase-github-actions/[email protected] | ||
with: | ||
classpath: 'liquibase' | ||
|
@@ -77,7 +78,7 @@ jobs: | |
url: 'jdbc:postgresql://${{ env.DB_IP }}:5432/${{ inputs.DB_NAME }}' | ||
|
||
- name: Setup python | ||
if: inputs.RUN_POPULATE_SCRIPT | ||
if: inputs.RUN_POPULATE_SCRIPT == 'true' | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.9' | ||
|
@@ -94,11 +95,11 @@ jobs: | |
cat config/.env.local | ||
- name: Install requirements and generate db model | ||
if: inputs.RUN_POPULATE_SCRIPT | ||
if: inputs.RUN_POPULATE_SCRIPT == 'true' | ||
run: scripts/db-gen.sh | ||
|
||
- name: Download csv version of the database | ||
if: inputs.RUN_POPULATE_SCRIPT | ||
if: inputs.RUN_POPULATE_SCRIPT == 'true' | ||
run: wget -O sources.csv https://bit.ly/catalogs-csv | ||
|
||
- name: Validate file download | ||
|
@@ -109,11 +110,11 @@ jobs: | |
run: echo "PATH=$(realpath sources.csv)" >> $GITHUB_OUTPUT | ||
|
||
- name: Populate Database | ||
if: inputs.RUN_POPULATE_SCRIPT | ||
if: inputs.RUN_POPULATE_SCRIPT == 'true' | ||
run: scripts/populate-db.sh ${{ steps.getpath.outputs.PATH }} > populate.log | ||
|
||
- name: Upload log file for verification | ||
if: inputs.RUN_POPULATE_SCRIPT | ||
if: inputs.RUN_POPULATE_SCRIPT == 'true' | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: populate.log | ||
|