diff --git a/codefresh/Chart.yaml b/codefresh/Chart.yaml index 998529e22..939102a5f 100644 --- a/codefresh/Chart.yaml +++ b/codefresh/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 description: Helm Chart for Codefresh On-Prem name: codefresh -version: 2.8.1 +version: 2.8.2 keywords: - codefresh home: https://codefresh.io/ @@ -18,10 +18,8 @@ annotations: # artifacthub.io/containsSecurityUpdates: "true" # supported kinds are added, changed, deprecated, removed, fixed and security. artifacthub.io/changes: | - - kind: added - description: "Documentation about external MongoDB Atlas" - kind: fixed - description: "Fix postgresql seed job" + description: "Fix createDB function in postgres seed job" dependencies: - name: cf-common repository: oci://quay.io/codefresh/charts diff --git a/codefresh/README.md b/codefresh/README.md index 2c44cc8f5..2efd0b612 100644 --- a/codefresh/README.md +++ b/codefresh/README.md @@ -1,6 +1,6 @@ ## Codefresh On-Premises -![Version: 2.8.1](https://img.shields.io/badge/Version-2.8.1-informational?style=flat-square) ![AppVersion: 2.8.0](https://img.shields.io/badge/AppVersion-2.8.0-informational?style=flat-square) +![Version: 2.8.2](https://img.shields.io/badge/Version-2.8.2-informational?style=flat-square) ![AppVersion: 2.8.0](https://img.shields.io/badge/AppVersion-2.8.0-informational?style=flat-square) Helm chart for deploying [Codefresh On-Premises](https://codefresh.io/docs/docs/getting-started/intro-to-codefresh/) to Kubernetes. diff --git a/codefresh/files/postgresSeedJobScript.sh b/codefresh/files/postgresSeedJobScript.sh index 442278a69..fa4950606 100644 --- a/codefresh/files/postgresSeedJobScript.sh +++ b/codefresh/files/postgresSeedJobScript.sh @@ -28,7 +28,9 @@ POSTGRES_SEED_USER="${POSTGRES_SEED_USER:-$POSTGRES_USER}" POSTGRES_SEED_PASSWORD="${POSTGRES_SEED_PASSWORD:-$POSTGRES_PASSWORD}" function createDB() { - psql -tc "SELECT 1 FROM pg_database WHERE datname = '${1}'" | grep -q 1 || psql -c "CREATE DATABASE ${1}" + local db=$1 + echo "Creating ${db} database" + psql -c "CREATE DATABASE ${db}" 2>&1 || true } function createUser() { @@ -37,7 +39,9 @@ function createUser() { } function grantPrivileges() { - psql -c "GRANT ALL ON DATABASE ${1} TO ${POSTGRES_USER}" + local db=$1 + echo "Granting privileges on $db to ${POSTGRES_USER}" + psql -c "GRANT ALL ON DATABASE ${db} TO ${POSTGRES_USER}" } function runSeed() {