Skip to content

Commit

Permalink
plain postgres
Browse files Browse the repository at this point in the history
  • Loading branch information
david-littlefarmer committed Dec 20, 2023
1 parent 97008e5 commit c64c3a1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
tests:
runs-on: ubuntu-latest
services:
skeleton-postgres:
postgres:
image: postgres:15.3
env:
POSTGRES_USER: devbox
Expand All @@ -24,10 +24,9 @@ jobs:
# - ${{ github.workspace }}/temp/db.sh:/home/db.sh
# - ${{ github.workspace }}/temp/schema.sql:/home/schema.sql
- ${{ github.workspace }}/temp:/home
options: --name skeleton-postgres
options: --name postgres

steps:

- name: Git clone
run: |
sudo chown -R $USER:$USER /home/runner/work/skeleton
Expand All @@ -48,7 +47,7 @@ jobs:
- name: Restart postgres
uses: docker://docker
with:
args: docker restart skeleton-postgres
args: docker restart postgres

- name: Git safe.directory
# Fixes following git error:
Expand Down
2 changes: 1 addition & 1 deletion etc/ci.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ environment = "test"
conn_max_lifetime = "1800s"
connect_timeout = 5
database = "skeleton_e2e"
host = "skeleton-postgres:5432"
host = "postgres:5432"
max_idle_conns = 10
max_open_conns = 100
read_only = false
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/api/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func initDB(database string) error {
slog.Debug("Initializing DB", "database", database)

// Execute the command to create the new schema
createCmd := exec.Command("bash", "-c", fmt.Sprintf(`docker exec skeleton-postgres /bin/sh -c '/home/db.sh create %s'`, database))
createCmd := exec.Command("bash", "-c", fmt.Sprintf(`docker exec postgres /bin/sh -c '/home/db.sh create %s'`, database))
_, err := createCmd.Output()
if err != nil {
if e, ok := err.(*exec.ExitError); ok {
Expand All @@ -134,7 +134,7 @@ func initDB(database string) error {
}

// Import the schema.sql script into the new schema
importCmd := exec.Command("bash", "-c", fmt.Sprintf(`docker exec skeleton-postgres /bin/sh -c '/home/db.sh import %s %s'`, database, "/home/schema.sql"))
importCmd := exec.Command("bash", "-c", fmt.Sprintf(`docker exec postgres /bin/sh -c '/home/db.sh import %s %s'`, database, "/home/schema.sql"))
_, err = importCmd.Output()
if err != nil {
if e, ok := err.(*exec.ExitError); ok {
Expand Down

0 comments on commit c64c3a1

Please sign in to comment.