From 0b38269fe8ccc31d73e605e6692b0ec5c8c322f8 Mon Sep 17 00:00:00 2001 From: Tsiry Sandratraina Date: Thu, 29 Aug 2024 20:13:15 +0000 Subject: [PATCH] fix(postgres): skip database init errors --- postgres/Cargo.toml | 2 +- postgres/README.md | 2 +- postgres/fluentci.toml | 2 +- postgres/src/lib.rs | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/postgres/Cargo.toml b/postgres/Cargo.toml index 42a7fa5..f3a8a94 100644 --- a/postgres/Cargo.toml +++ b/postgres/Cargo.toml @@ -4,7 +4,7 @@ description = "Postgres plugin for FluentCI" edition = "2021" license = "MIT" name = "postgres" -version = "0.1.6" +version = "0.1.7" [lib] crate-type = ["cdylib"] diff --git a/postgres/README.md b/postgres/README.md index c95e5ad..3a44c91 100644 --- a/postgres/README.md +++ b/postgres/README.md @@ -36,7 +36,7 @@ use fluentci_pdk::dag; // ... -dag().call("https://pkg.fluentci.io/postgres@v0.1.5?wasm=1", "start", vec![])?; +dag().call("https://pkg.fluentci.io/postgres@v0.1.7?wasm=1", "start", vec![])?; ``` ## 📚 Examples diff --git a/postgres/fluentci.toml b/postgres/fluentci.toml index b57369b..4e02422 100644 --- a/postgres/fluentci.toml +++ b/postgres/fluentci.toml @@ -4,4 +4,4 @@ description = "Postgres Plugin for FluentCI" keywords = ["postgres"] license = "MIT" name = "postgres" -version = "0.1.6" +version = "0.1.7" diff --git a/postgres/src/lib.rs b/postgres/src/lib.rs index 0868b7c..6710141 100644 --- a/postgres/src/lib.rs +++ b/postgres/src/lib.rs @@ -38,11 +38,11 @@ pub fn start(_args: String) -> FnResult { ])? .wait_on(port.parse()?, None)? .with_exec(vec![ - "psql --host=localhost -d postgres -U `whoami` -c \"CREATE DATABASE $POSTGRES_DB;\"", + "psql --host=localhost -d postgres -U `whoami` -c \"CREATE DATABASE $POSTGRES_DB;\" || true", ])? .with_exec(vec![ &format!( - "psql --host=localhost -d postgres -U `whoami` -c \"CREATE USER $POSTGRES_USER {} CREATEDB CREATEROLE;\"", + "psql --host=localhost -d postgres -U `whoami` -c \"CREATE USER $POSTGRES_USER {} CREATEDB CREATEROLE;\" || true", with_password ) ])?