fix docker build issues

This commit is contained in:
Yuri Astrakhan 2022-11-19 13:31:18 -05:00
parent 53ebe95f28
commit 0576ca9442
3 changed files with 6 additions and 4 deletions

View File

@ -62,9 +62,10 @@ jobs:
- name: Test Docker image - name: Test Docker image
run: | 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_BUILD=-
export MARTIN_BIN="docker run --rm --net host -e DATABASE_URL -v $PWD/tests:/tests $TAG" export MARTIN_BIN="docker run --rm --net host -e DATABASE_URL -v $PWD/tests:/tests $TAG"
echo "MARTIN_BIN=$MARTIN_BIN"
tests/test.sh tests/test.sh
env: env:
DATABASE_URL: ${{ steps.pg.outputs.connection-uri }} DATABASE_URL: ${{ steps.pg.outputs.connection-uri }}

2
Cargo.lock generated
View File

@ -1047,7 +1047,7 @@ dependencies = [
[[package]] [[package]]
name = "martin" name = "martin"
version = "0.6.0-rc.1" version = "0.6.0"
dependencies = [ dependencies = [
"actix", "actix",
"actix-cors", "actix-cors",

View File

@ -25,8 +25,9 @@ pub type Connection<'a> = PooledConnection<'a, ConnectionManager>;
const REQUIRED_POSTGIS_VERSION: &str = ">= 2.4.0"; const REQUIRED_POSTGIS_VERSION: &str = ">= 2.4.0";
pub async fn setup_connection_pool(config: &PgConfig) -> io::Result<Pool> { pub async fn setup_connection_pool(config: &PgConfig) -> io::Result<Pool> {
let cfg = pg::Config::from_str(config.connection_string.as_str()) let conn_str = config.connection_string.as_str();
.map_err(|e| prettify_error!(e, "Can't parse connection string"))?; 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"))] #[cfg(not(feature = "ssl"))]
let mgr = ConnectionManager::new(cfg, postgres::NoTls); let mgr = ConnectionManager::new(cfg, postgres::NoTls);