Bootstrap data support

This commit is contained in:
geek 2017-05-03 14:48:15 -05:00 committed by Sérgio Ramos
parent 22eea95157
commit 7c1896223b
2 changed files with 18 additions and 0 deletions

17
portal-api/bootstrap-data.js vendored Normal file
View File

@ -0,0 +1,17 @@
'use strict';
const Data = require('./lib/data');
const Examples = require('./lib/models/examples');
const data = new Data();
data.connect(() => {
data.createDeployment(Examples.deployment).then((deployment) => {
data.createManifest(deployment.id, Examples.manifest).then((manifest) => {
console.log('deployment with manifest created');
process.exit(0);
});
}).catch((err) => {
console.error(err);
});
});

View File

@ -4,6 +4,7 @@
"description": "",
"main": "./lib/index.js",
"scripts": {
"bootstrap": "node ./bootstrap-data",
"lint": "belly-button",
"rethinkdb-up": "docker run -d -p 8080:8080 -p 28015:28015 -p 29015:29015 --name rethinkdb rethinkdb",
"rethinkdb-down": "docker rm -f rethinkdb",