Skip to content

Commit

Permalink
Make psql.sh support podman
Browse files Browse the repository at this point in the history
  • Loading branch information
oyvindhagberg committed Jul 31, 2024
1 parent b69e1e6 commit 043cb26
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:11
image: postgres:15
env:
POSTGRES_USER: nivlheim
POSTGRES_DB: nivlheim
Expand Down Expand Up @@ -47,7 +47,7 @@ jobs:
- name: Docker save
run: docker save nivlheim | gzip > nivlheim-image.tar.gz
- name: Upload artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: nivlheim-image.tar.gz
path: nivlheim-image.tar.gz
Expand Down Expand Up @@ -105,9 +105,9 @@ jobs:
- powershell.sh
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Download artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
# the name input parameter is not provided, so all artifacts will be downloaded
- name: Load images
run: |
Expand Down
7 changes: 6 additions & 1 deletion ci/docker/psql.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,9 @@ I="-it "
if [[ "$*" == *"-c"* ]]; then
I=""
fi
docker exec $I -e PGCONNECT_TIMEOUT=30 docker_postgres_1 psql -U nivlheim -h localhost -d nivlheim "$@"
EXECUTABLE=docker
if ! type docker >/dev/null 2>&1; then
EXECUTABLE=podman
fi
CONTAINER_NAME=$($EXECUTABLE ps --filter ancestor=postgres --format '{{.Names}}')
$EXECUTABLE exec $I -e PGCONNECT_TIMEOUT=30 $CONTAINER_NAME psql -U nivlheim -h localhost -d nivlheim "$@"

0 comments on commit 043cb26

Please sign in to comment.