From e1c475d05a2194a2ae73aeaa307b1a0f17cea75c Mon Sep 17 00:00:00 2001 From: Aravinth Manivannan Date: Mon, 19 Dec 2022 12:19:58 +0530 Subject: [PATCH] debug: CI: switch to local env vars for passing DATABASE_URL --- .woodpecker.yml | 7 ++++--- Makefile | 8 ++++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 3ce374e..59d827f 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -2,7 +2,7 @@ pipeline: backend: image: rust environment: - - DATABASE_URL="postgres://postgres:password@database:5432/postgres" + - PG_DATABASE_URL=postgres://postgres:password@database:5432/postgres commands: - curl -fsSL https://deb.nodesource.com/setup_16.x | bash - &&\ - apt update && apt-get -y --no-install-recommends install nodejs @@ -11,9 +11,10 @@ pipeline: # rewrite conducotr configuration - sed -i 's%url = "http:\/\/localhost:5000"%url = "http:\/\/librepages-conductor:5000"%' config/default.toml - make dev-env - - make migrate + - make build + - DATABASE_URL=PG_DATABASE_URL make migrate - make lint - - make test + - DATABASE_URL=PG_DATABASE_URL make test build_docker_img: image: plugins/docker diff --git a/Makefile b/Makefile index 5abaa87..7eac5ed 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,10 @@ default: ## Debug build $(call cache_bust) cargo run -- serve +build: ## Debug build + $(call cache_bust) + cargo build + cache-bust: ## Run cache buster on static assets $(call cache_bust) @@ -23,7 +27,7 @@ coverage: ## Generate HTML code coverage dev-env: ## Download development dependencies npm install - unset DATABASE_URL && cargo fetch + cargo fetch doc: ## Prepare documentation cargo doc --no-deps --workspace --all-features @@ -45,7 +49,7 @@ lint: ## Lint codebase migrate: ## run migrations $(call cache_bust) - unset DATABASE_URL && echo ${DATABASE_URL} && cargo build + unset DATABASE_URL && cargo build DATABASE_URL=${DATABASE_URL} cargo run -- migrate release: ## Release build