Skip to content

Commit

Permalink
Add dbsetup script
Browse files Browse the repository at this point in the history
  • Loading branch information
SandGrainOne committed Oct 21, 2024
1 parent 703d08a commit 3bedda8
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/build-and-analyze.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Setup PostgreSQL
run: |
chmod +x dbsetup.sh
./dbsetup.sh
- name: Restart database to enable config changes
run: |
docker restart $(docker ps -q)
- name: Cache SonarCloud packages
uses: actions/cache@v4
with:
Expand Down
13 changes: 13 additions & 0 deletions dbsetup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
export PGPASSWORD=Password

# alter max connections
psql -h localhost -p 5432 -U platform_profile_admin -d profiledb \
-c "ALTER SYSTEM SET max_connections TO '200';"

# set up platform_profile role
psql -h localhost -p 5432 -U platform_profile_admin -d profiledb \
-c "DO \$\$
BEGIN CREATE ROLE platform_profile WITH LOGIN PASSWORD 'Password';
EXCEPTION WHEN duplicate_object THEN RAISE NOTICE '%, skipping', SQLERRM USING ERRCODE = SQLSTATE;
END \$\$;"

0 comments on commit 3bedda8

Please sign in to comment.