diff --git a/docker/api/bootstrap-data.js b/docker/api/bootstrap-data.js index 82535648..137a8acc 100644 --- a/docker/api/bootstrap-data.js +++ b/docker/api/bootstrap-data.js @@ -63,56 +63,68 @@ const bootstrap = function ({ docker, rethink }) { return; } - data.createDatacenter({ region, name: region }, (err, datacenter) => { + data.getDatacenters((err, datacenters) => { if (err) { console.error(err); return; } - Triton.createClient( - { - profile: settings.triton - }, - (err, { cloudapi }) => { - if (err) { - console.error(err); - return; - } + if (datacenters && datacenters.length) { + process.exit(0); + return; + } - cloudapi.getAccount((err, { firstName, lastName, email, login }) => { + data.createDatacenter({ region, name: region }, (err, datacenter) => { + if (err) { + console.error(err); + return; + } + + Triton.createClient( + { + profile: settings.triton + }, + (err, { cloudapi }) => { if (err) { console.error(err); return; } - data.createUser( - { firstName, lastName, email, login }, - (err, user) => { - if (err) { - console.error(err); - return; - } - - data.createPortal( - { - user, - datacenter - }, - (err, portal) => { - if (err) { - console.error(err); - return; - } - - console.log('data bootstrapped'); - process.exit(0); - } - ); + cloudapi.getAccount((err, { firstName, lastName, email, login }) => { + if (err) { + console.error(err); + return; } - ); - }); - } - ); + + data.createUser( + { firstName, lastName, email, login }, + (err, user) => { + if (err) { + console.error(err); + return; + } + + data.createPortal( + { + user, + datacenter + }, + (err, portal) => { + if (err) { + console.error(err); + return; + } + + console.log('data bootstrapped'); + process.exit(0); + } + ); + } + ); + }); + } + ); + }); }); }); }; diff --git a/docker/api/package.json b/docker/api/package.json index 35830009..387e7d70 100644 --- a/docker/api/package.json +++ b/docker/api/package.json @@ -21,7 +21,7 @@ "joi": "^10.6.0", "joyent-cp-gql-schema": "^1.7.0", "piloted": "^3.1.1", - "portal-api": "^1.7.0", + "portal-api": "^1.8.2", "toppsy": "^1.1.0", "triton": "^5.2.0" } diff --git a/docker/compose-api/Dockerfile b/docker/compose-api/Dockerfile index 1bf24c20..563eaf27 100644 --- a/docker/compose-api/Dockerfile +++ b/docker/compose-api/Dockerfile @@ -1,4 +1,4 @@ -FROM quay.io/yldio/docker-compose-api +FROM ramitos/docker-compose-api:1.0.0 RUN apk add --update bash diff --git a/packages/docker-compose-client/package.json b/packages/docker-compose-client/package.json index 26c22dc3..00504848 100644 --- a/packages/docker-compose-client/package.json +++ b/packages/docker-compose-client/package.json @@ -1,6 +1,6 @@ { "name": "docker-compose-client", - "version": "1.0.9", + "version": "1.1.0", "license": "MPL-2.0", "repository": "github:yldio/joyent-portal", "main": "lib", diff --git a/packages/portal-api/package.json b/packages/portal-api/package.json index 49589888..957bf53e 100644 --- a/packages/portal-api/package.json +++ b/packages/portal-api/package.json @@ -1,6 +1,6 @@ { "name": "portal-api", - "version": "1.8.0", + "version": "1.8.2", "description": "", "main": "./lib/index.js", "scripts": { @@ -34,7 +34,7 @@ "dependencies": { "boom": "^5.2.0", "cidr-matcher": "^1.0.5", - "docker-compose-client": "^1.0.9", + "docker-compose-client": "^1.1.0", "dockerode": "^2.5.0", "force-array": "^3.1.0", "graphi": "^3.0.0", diff --git a/triton-compose.yml b/triton-compose.yml index 8d30ca63..5642c5d3 100644 --- a/triton-compose.yml +++ b/triton-compose.yml @@ -63,7 +63,7 @@ rethinkdb: # FRONTEND ############################################################################# frontend: - image: joyent/copilot-frontend:1.0.0 + image: joyent/copilot-frontend:1.3.4 mem_limit: 512m labels: - triton.cns.services=copilot @@ -81,7 +81,7 @@ frontend: # BACKEND ############################################################################# api: - image: joyent/copilot-api:1.1.0 + image: joyent/copilot-api:1.8.2 mem_limit: 1g expose: - 3000 @@ -94,7 +94,7 @@ api: # Docker-compose wrapper # Create _env file from running ./setup.sh compose-api: - image: joyent/copilot-compose:1.0.0 + image: joyent/copilot-compose:1.1.0 expose: - 4242 env_file: