From 761dadabcbe915fa8c9591b3fbc125354d9d7039 Mon Sep 17 00:00:00 2001 From: Ivar Date: Thu, 16 Jun 2016 18:17:07 +0200 Subject: [PATCH 1/3] 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 || {}; From cd845040694f545b344b4a3f63277fced5e90991 Mon Sep 17 00:00:00 2001 From: Ivar Date: Thu, 16 Jun 2016 18:20:11 +0200 Subject: [PATCH 2/3] remove unsued packages --- package.json | 2 -- 1 file changed, 2 deletions(-) diff --git a/package.json b/package.json index e5b814ac1d..c873fa56b6 100644 --- a/package.json +++ b/package.json @@ -62,7 +62,6 @@ "errorhandler": "1.3.5", "express": "4.13.4", "express-validator": "2.20.3", - "ini": "1.3.4", "install": "^0.6.1", "jsx-loader": "0.12.2", "jsxhint": "0.13.2", @@ -70,7 +69,6 @@ "lodash": "^3.5.0", "log4js": "0.6.35", "moment": "^2.13.0", - "nconf": "0.8.4", "npm": "^3.8.8", "pg": "^4.5.5", "react": "^0.13.1", From 90b690c6ec9ea02acdf0c1bd4e9b1be0a74581a8 Mon Sep 17 00:00:00 2001 From: Ivar Date: Thu, 16 Jun 2016 22:08:52 +0200 Subject: [PATCH 3/3] more finn cleanups --- .dockerignore | 2 -- Vagrantfile | 20 -------------------- helpers/install.sh | 14 -------------- 3 files changed, 36 deletions(-) delete mode 100644 Vagrantfile delete mode 100644 helpers/install.sh diff --git a/.dockerignore b/.dockerignore index 51a5557c62..e61253b7e3 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,5 +1,3 @@ .git docker-compose.yml node_modules -artifact.json -finnbuild.json diff --git a/Vagrantfile b/Vagrantfile deleted file mode 100644 index 1fccf7b811..0000000000 --- a/Vagrantfile +++ /dev/null @@ -1,20 +0,0 @@ -# -*- mode: ruby -*- -# vi: set ft=ruby : - -# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! -VAGRANTFILE_API_VERSION = "2" - -Vagrant.require_version ">= 1.7.0" - -Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| - config.vm.provider "virtualbox" do |v| - v.memory = 2048 - v.cpus = 2 - end - - config.vm.box = "boxcutter/ubuntu1410-docker" - - config.vm.network "private_network", ip: "192.168.12.34" - - config.vm.provision "shell", inline: "/vagrant/helpers/install.sh" -end \ No newline at end of file diff --git a/helpers/install.sh b/helpers/install.sh deleted file mode 100644 index dce90c55aa..0000000000 --- a/helpers/install.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env bash - -set -e - -echo "" -sudo apt-get install unzip - -curl -L -O https://dl.bintray.com/mitchellh/consul/0.5.2_linux_amd64.zip - -unzip 0.5.2_linux_amd64.zip -d /usr/bin - -consul agent -data-dir=/tmp/consul -dc=oslo0 & -consul join dev-mod2.finntech.no -consul members \ No newline at end of file