Skip to content

Commit

Permalink
updated actions workflow file
Browse files Browse the repository at this point in the history
  • Loading branch information
kcs-bandihareesh committed Oct 14, 2024
1 parent dd81b8a commit 5328aa1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 18 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/database.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ jobs:
- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v2
with:
project_id: 'som-rit-infrastructure-prod'
workload_identity_provider: 'projects/294515190965/locations/global/workloadIdentityPools/github/providers/susom-github'
project_id: ${{ secrets.WORKLOAD_IDENTITY_PROJECT }}
workload_identity_provider: ${{ secrets.WORKLOAD_IDENTITY_PROVIDER }}
create_credentials_file: true
export_environment_variables: true
cleanup_credentials: true
Expand All @@ -68,8 +68,7 @@ jobs:
"-Duser.timezone=America/Los_Angeles" \
"-Dhsqldb.database.url=jdbc:hsqldb:file:target/hsqldb;shutdown=true" \
-Dhsqldb.database.user=SA -Dhsqldb.database.password= -Pcoverage,hsqldb verify &&
bash test-postgres.sh &&
bash test-oracle.sh
bash test-postgres.sh
- name: Display Surefire reports on failure
if: failure()
Expand Down Expand Up @@ -105,8 +104,8 @@ jobs:
- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v2
with:
project_id: 'som-rit-infrastructure-prod'
workload_identity_provider: 'projects/294515190965/locations/global/workloadIdentityPools/github/providers/susom-github'
project_id: ${{ secrets.WORKLOAD_IDENTITY_PROJECT }}
workload_identity_provider: ${{ secrets.WORKLOAD_IDENTITY_PROVIDER }}
create_credentials_file: true
export_environment_variables: true
cleanup_credentials: true
Expand Down
2 changes: 1 addition & 1 deletion test-oracle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ run_oracle_tests() {
}

run_oracle_tests "19.3-quick"
#run_oracle_tests 2019-latest
#run_oracle_tests 2019-latest
17 changes: 6 additions & 11 deletions test-sqlserver.sh
Original file line number Diff line number Diff line change
@@ -1,26 +1,21 @@
#!/usr/bin/env bash

# Generate a complex password
PASSWORD=$(openssl rand -base64 18 | tr -d +/ | head -c 20)
PASSWORD=$(openssl rand -base64 18 | tr -d +/)
#export TZ=Asia/Kolkata
#export TZ=America/Los_Angeles
export TZ=UTC # Set timezone to UTC for better compatibility
export TZ=America/Los_Angeles

run_ms_tests() {
docker pull mcr.microsoft.com/mssql/server:$1
docker run -d --rm --name dbtest-ms -e ACCEPT_EULA=Y -e TZ=$TZ -e SA_PASSWORD=$PASSWORD -p 1433:1433 \
--health-cmd='/opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P '$PASSWORD' -Q "SELECT 1"' \
--health-interval=5s --health-timeout=10s --health-retries=10 \
mcr.microsoft.com/mssql/server:$1
docker run -d --rm --name dbtest-ms -e ACCEPT_EULA=Y -e TZ=$TZ -e SA_PASSWORD=$PASSWORD -p 1433:1433 --health-cmd='/opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P '$PASSWORD' -Q "SELECT 1"' --health-interval=2s --health-timeout=30s --health-retries=5 mcr.microsoft.com/mssql/server:$1

declare -i count=1
while [ "$(docker inspect --format='{{json .State.Health.Status}}' dbtest-ms)" != '"healthy"' ]
do
echo "Waiting for container to start ($count seconds)"
sleep 5
sleep 1

count=$((count + 5))
if [ $count -gt 180 ] ; then
count=$((count + 1))
if [ $count -gt 120 ] ; then
echo "Database did not startup correctly ($1)"
docker rm -f dbtest-ms
exit 1
Expand Down

0 comments on commit 5328aa1

Please sign in to comment.