From 761dadabcbe915fa8c9591b3fbc125354d9d7039 Mon Sep 17 00:00:00 2001 From: Ivar Date: Thu, 16 Jun 2016 18:17:07 +0200 Subject: [PATCH] Remove finn config #133 --- artifact.json | 19 ------------------ finnbuild.json | 46 ------------------------------------------- lib/databaseConfig.js | 29 --------------------------- server-impl.js | 2 +- 4 files changed, 1 insertion(+), 95 deletions(-) delete mode 100644 artifact.json delete mode 100644 finnbuild.json delete mode 100644 lib/databaseConfig.js diff --git a/artifact.json b/artifact.json deleted file mode 100644 index b1cbf27eb5..0000000000 --- a/artifact.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "ownership": [ - { - "name": "Utviklingsproduktivitet", - "email": "utviklingsproduktivitet@finn.no" - } - ], - - "artifacts": { - - "artifact": [ - { - "name": "unleash-server", - "type": "service", - "description": "Unleash" - } - ] - } -} \ No newline at end of file diff --git a/finnbuild.json b/finnbuild.json deleted file mode 100644 index 9268905bef..0000000000 --- a/finnbuild.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "links": { - "build": "https://travis-ci.org/finn-no/unleash/", - "repository": "https://github.com/finn-no/unleash", - "issues": "https://github.com/finn-no/unleash/issues" - }, - "versions": { - "jdk": "1.8", - "mvn": "3", - "node": "5" - }, - "tasks": { - "deploy": [ - {"command": "npm install && npm run pg-virtualenv-test && npm run build"}, - {"command": "tar -cvzf unleash-server.tar.gz --exclude=unleash-server.tar.gz --exclude=.git *"}, - { - "command": "mvn deploy:deploy-file -Durl=http://mavenproxy.finntech.no/finntech-internal-snapshot/ -DrepositoryId=finntech-internal-snapshot -Dfile=unleash-server.tar.gz -DgroupId=no.finntech.unleash -DartifactId=unleash-server -Dversion=0.1337-SNAPSHOT -Dpackaging=tar.gz", - "pipelines": [ - { - "name": "unleash-server", - "pattern": "Uploaded: +(http:.+unleash-server-.+.tar.gz)" - } - ] - }, - { "command" : "docker build -t finntech/unleash-server:$FINNBUILD_RANDOM_HASH . && docker push finntech/unleash-server:$FINNBUILD_RANDOM_HASH" }, - { "command" : "rm -rf sql && mkdir sql" }, - { "command" : "scripts/generate-liquibase-artifact.js > sql/db.changelog-master.xml"}, - { "command" : "jar -cf unleash-db.jar sql"}, - { - "command": "mvn deploy:deploy-file -Durl=http://mavenproxy.finntech.no/finntech-internal-snapshot/ -DrepositoryId=finntech-internal-snapshot -Dfile=unleash-db.jar -DgroupId=no.finntech.unleash -DartifactId=unleash-db -Dversion=0.1337-SNAPSHOT -Dpackaging=jar", - "pipelines": [ - { - "name": "unleash-db", - "pattern": "Uploaded:\\s+(http:.+unleash-db-.+\\.jar)" - } - ] - }, - - ], - "default": [ - {"command": "npm install && npm run pg-virtualenv-test"}, - {"command" : "docker build -t finntech/unleash-server:$FINNBUILD_RANDOM_HASH ." }, - - ] - } -} diff --git a/lib/databaseConfig.js b/lib/databaseConfig.js deleted file mode 100644 index 70cb78e3c7..0000000000 --- a/lib/databaseConfig.js +++ /dev/null @@ -1,29 +0,0 @@ -var nconf = require('nconf'); -var fs = require('fs'); -var ini = require('ini'); -var logger = require('./logger'); - -function getDatabaseIniUrl() { - // Finn specific way of delivering env variables - var databaseini = nconf.argv().get('databaseini'); - var config = ini.parse(fs.readFileSync(databaseini, 'utf-8')); - - logger.info('unleash started with databaseini: ' + databaseini); - - return config.DATABASE_URL; -} - -function getDatabaseUrl() { - if (process.env.DATABASE_URL) { - logger.info('unleash started with DATABASE_URL'); - return process.env.DATABASE_URL; - } else if (nconf.argv().get('databaseini') !== undefined) { - return getDatabaseIniUrl(); - } - - throw new Error('please set DATABASE_URL or pass --databaseini'); -} - -module.exports = { - getDatabaseUrl: getDatabaseUrl -}; diff --git a/server-impl.js b/server-impl.js index 6ece96bdca..cbb4b3192e 100644 --- a/server-impl.js +++ b/server-impl.js @@ -1,5 +1,5 @@ var logger = require('./lib/logger'); -var defaultDatabaseUri = require('./lib/databaseConfig').getDatabaseUrl(); +var defaultDatabaseUri = process.env.DATABASE_URL; function start(options) { options = options || {};