diff --git a/.github/workflows/walhall-ci.yml b/.github/workflows/walhall-ci.yml new file mode 100644 index 0000000..184757a --- /dev/null +++ b/.github/workflows/walhall-ci.yml @@ -0,0 +1,19 @@ +name: Walhall CI + +on: + push: + branches: + - deploy + +jobs: + push-to-humanitec-dev: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: Build and Push to Humanitec Dev + uses: humanitec/build-push-to-humanitec@v1 + with: + humanitec-token: ${{ secrets.HUMANITEC_TOKEN_DEV }} + organization: damien85 + humanitec-registry: dev-registry.humanitec.io + humanitec-api: dev-api.humanitec.io \ No newline at end of file diff --git a/bin/init_db.js b/bin/init_db.js index d72f979..8644d12 100644 --- a/bin/init_db.js +++ b/bin/init_db.js @@ -2,6 +2,7 @@ const db = require("../db"); console.log("[init_db.js] Initializing database"); +console.log(`[init_db.js] CONNECTION_STRING="${process.env.CONNECTION_STRING || ""}"`); console.log(`[init_db.js] DATABASE_USER="${process.env.DATABASE_USER || ""}"`); console.log(`[init_db.js] DATABASE_HOST="${process.env.DATABASE_HOST || ""}"`); console.log(`[init_db.js] DATABASE_NAME="${process.env.DATABASE_NAME || ""}"`); diff --git a/db/index.js b/db/index.js index ccee7de..fe3e95a 100644 --- a/db/index.js +++ b/db/index.js @@ -1,11 +1,7 @@ const { Pool } = require("pg"); const pool = new Pool({ - user: process.env.DATABASE_USER, - host: process.env.DATABASE_HOST, - database: process.env.DATABASE_NAME, - password: process.env.DATABASE_PASSWORD, - port: process.env.DATABASE_PORT, + connectionString: `${process.env.CONNECTION_STRING}` }); module.exports = { diff --git a/docker-compose.yml b/docker-compose.yml index e725d60..aad4071 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -14,10 +14,7 @@ services: - productdb environment: - DATABASE_HOST: productdb - DATABASE_NAME: product - DATABASE_USER: product_robot - DATABASE_PASSWORD: "pr0dr0b0t" + CONNECTION_STRING: postgresql://product_robot:pr0dr0b0t@productdb:5432/product productdb: image: postgres:11 diff --git a/package.json b/package.json index f49d0ec..f61f689 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,6 @@ "express-promise-router": "^3.0.3", "morgan": "^1.9.1", "path": "^0.12.7", - "pg": "^7.12.1" + "pg": "^8.2.1" } }