diff --git a/.github/workflows/cache-config-tests.yml b/.github/workflows/cache-config-tests.yml index 20a0e387e6..7b184c89df 100644 --- a/.github/workflows/cache-config-tests.yml +++ b/.github/workflows/cache-config-tests.yml @@ -26,41 +26,47 @@ on: workflow_dispatch: push: paths: + - cache-config/**.go + - cache-config/testing/** + - .github/actions/build-ats-test-rpm/** + - .github/actions/cache-config-integration-tests/** + - .github/actions/repo-info/** - .github/workflows/cache-config-tests.yml - go.mod - go.sum - GO_VERSION + - lib/atscfg-go/**.go - lib/go-atscfg/**.go + - 'traffic_ops/app/db/**' + - '!traffic_ops/app/db/**.md' - traffic_ops/*client/**.go + - 'traffic_ops/install/**' - traffic_ops/toclientlib/**.go - - lib/atscfg-go/**.go - traffic_ops/traffic_ops_golang/**.go - - cache-config/**.go - - cache-config/testing/** - vendor/**.go - vendor/modules.txt - - .github/actions/build-ats-test-rpm/** - - .github/actions/repo-info/** - - .github/actions/cache-config-integration-tests/** create: pull_request: paths: + - cache-config/**.go + - cache-config/testing/** + - .github/actions/build-ats-test-rpm/** + - .github/actions/cache-config-integration-tests/** + - .github/actions/repo-info/** - .github/workflows/cache-config-tests.yml - go.mod - go.sum - GO_VERSION + - lib/atscfg-go/**.go - lib/go-atscfg/**.go + - 'traffic_ops/app/db/**' + - '!traffic_ops/app/db/**.md' - traffic_ops/*client/**.go + - 'traffic_ops/install/**' - traffic_ops/toclientlib/**.go - - lib/atscfg-go/**.go - traffic_ops/traffic_ops_golang/**.go - - cache-config/**.go - - cache-config/testing/** - vendor/**.go - vendor/modules.txt - - .github/actions/build-ats-test-rpm/** - - .github/actions/repo-info/** - - .github/actions/cache-config-integration-tests/** types: [opened, reopened, ready_for_review, synchronize] jobs: diff --git a/traffic_ops/app/db/admin.go b/traffic_ops/app/db/admin.go index 50607739be..01529c8eae 100644 --- a/traffic_ops/app/db/admin.go +++ b/traffic_ops/app/db/admin.go @@ -466,6 +466,7 @@ func seed() { } cmd := exec.Command("psql", "-h", hostIP, "-p", hostPort, "-d", dbName, "-U", dbUser, "-e", "-v", "ON_ERROR_STOP=1") cmd.Stdin = bytes.NewBuffer(seedsBytes) + cmd.Env = append(os.Environ(), "PGPASSWORD="+dbPassword) out, err := cmd.CombinedOutput() fmt.Println(string(out)) if err != nil { @@ -485,6 +486,7 @@ func loadSchema() { } cmd := exec.Command("psql", "-h", hostIP, "-p", hostPort, "-d", dbName, "-U", dbUser, "-e", "-v", "ON_ERROR_STOP=1") cmd.Stdin = bytes.NewBuffer(schemaBytes) + cmd.Env = append(os.Environ(), "PGPASSWORD="+dbPassword) out, err := cmd.CombinedOutput() fmt.Println(string(out)) if err != nil { @@ -503,6 +505,7 @@ func patch() { } cmd := exec.Command("psql", "-h", hostIP, "-p", hostPort, "-d", dbName, "-U", dbUser, "-e", "-v", "ON_ERROR_STOP=1") cmd.Stdin = bytes.NewBuffer(patchesBytes) + cmd.Env = append(os.Environ(), "PGPASSWORD="+dbPassword) out, err := cmd.CombinedOutput() fmt.Printf(string(out)) if err != nil { @@ -658,10 +661,6 @@ func main() { if err := parseDBConfig(); err != nil { die(err.Error()) } - if err := os.Setenv("PGPASSWORD", dbPassword); err != nil { - die("Setting PGPASSWORD: " + err.Error()) - } - commands := make(map[string]func()) commands[cmdCreateDB] = createDB