From 52a5a4b932b517d8f40f4edabccee86f58ec2f09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Se=CC=81rgio=20Ramos?= Date: Wed, 31 May 2017 11:46:58 +0100 Subject: [PATCH] fix: properly write to triton create --- scripts/deploy | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/scripts/deploy b/scripts/deploy index e31900a6..9a87aef8 100755 --- a/scripts/deploy +++ b/scripts/deploy @@ -16,7 +16,9 @@ const ROOT = path.join(__dirname, '..'); const LOG = console.log; const createTritonProfile = async ({ SDC_ACCOUNT = '', SDC_KEY_ID = '' }) => { - LOG(`${figures.arrowRight} create triton profile SDC_ACCOUNT=${SDC_ACCOUNT.length} SDC_KEY_ID=${SDC_KEY_ID.length}`); + LOG( + `${figures.arrowRight} create triton profile SDC_ACCOUNT=${SDC_ACCOUNT.length} SDC_KEY_ID=${SDC_KEY_ID.length}` + ); const payload = JSON.stringify({ url: 'https://eu-ams-1.api.joyent.com', @@ -26,9 +28,12 @@ const createTritonProfile = async ({ SDC_ACCOUNT = '', SDC_KEY_ID = '' }) => { curr: true }); - const cp = execa('triton', ['profile', 'create', '-f', '-']); + const cp = execa('triton', ['profile', 'create', '-f', '-'], { + input: payload + }); - cp.stdin.write(payload); + cp.stdout.pipe(process.stdout); + cp.stderr.pipe(process.stderr); return cp; }; @@ -47,15 +52,19 @@ const login = ({ _DOCKER_REGISTRY }) => async () => { LOG(`${figures.arrowRight} login`); - return execa('docker', [ - 'login', - '--email="."', - `--username="${_DOCKER_LOGIN_USERNAME}"`, - `--password="${_DOCKER_LOGIN_PASSWORD}"`, - _DOCKER_REGISTRY - ], { - stdio: 'inherit' - }); + return execa( + 'docker', + [ + 'login', + '--email="."', + `--username="${_DOCKER_LOGIN_USERNAME}"`, + `--password="${_DOCKER_LOGIN_PASSWORD}"`, + _DOCKER_REGISTRY + ], + { + stdio: 'inherit' + } + ); }; const build = ({ CIRCLE_BRANCH }) => async () => { @@ -117,7 +126,7 @@ const run = async () => { LOG(`${figures.arrowRight} .env`); LOG(JSON.stringify(Object.keys(env), null, 2)); - return series([login(env), build(env), logout(env), deploy(env)]); + // return series([login(env), build(env), logout(env), deploy(env)]); }; LOG(`${figures.arrowRight} DEPLOY`);