Skip to content

Commit

Permalink
fix docker build issues
Browse files Browse the repository at this point in the history
  • Loading branch information
nyurik committed Nov 19, 2022
1 parent 53ebe95 commit 0576ca9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,10 @@ jobs:

- name: Test Docker image
run: |
TAG=$(echo '${{ steps.docker_meta.outputs.tags }}' | cut -d' ' -f1)
TAG=$(echo '${{ steps.docker_meta.outputs.json }}' | jq -r '.tags[0]')
export MARTIN_BUILD=-
export MARTIN_BIN="docker run --rm --net host -e DATABASE_URL -v $PWD/tests:/tests $TAG"
echo "MARTIN_BIN=$MARTIN_BIN"
tests/test.sh
env:
DATABASE_URL: ${{ steps.pg.outputs.connection-uri }}
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions src/pg/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ pub type Connection<'a> = PooledConnection<'a, ConnectionManager>;
const REQUIRED_POSTGIS_VERSION: &str = ">= 2.4.0";

pub async fn setup_connection_pool(config: &PgConfig) -> io::Result<Pool> {
let cfg = pg::Config::from_str(config.connection_string.as_str())
.map_err(|e| prettify_error!(e, "Can't parse connection string"))?;
let conn_str = config.connection_string.as_str();
let cfg = pg::Config::from_str(conn_str)
.map_err(|e| prettify_error!(e, "Can't parse connection string {}", conn_str))?;

#[cfg(not(feature = "ssl"))]
let mgr = ConnectionManager::new(cfg, postgres::NoTls);
Expand Down

0 comments on commit 0576ca9

Please sign in to comment.