fix: properly write to triton create
This commit is contained in:
parent
e2245dd9c0
commit
52a5a4b932
@ -16,7 +16,9 @@ const ROOT = path.join(__dirname, '..');
|
|||||||
const LOG = console.log;
|
const LOG = console.log;
|
||||||
|
|
||||||
const createTritonProfile = async ({ SDC_ACCOUNT = '', SDC_KEY_ID = '' }) => {
|
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({
|
const payload = JSON.stringify({
|
||||||
url: 'https://eu-ams-1.api.joyent.com',
|
url: 'https://eu-ams-1.api.joyent.com',
|
||||||
@ -26,9 +28,12 @@ const createTritonProfile = async ({ SDC_ACCOUNT = '', SDC_KEY_ID = '' }) => {
|
|||||||
curr: true
|
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;
|
return cp;
|
||||||
};
|
};
|
||||||
@ -47,15 +52,19 @@ const login = ({
|
|||||||
_DOCKER_REGISTRY
|
_DOCKER_REGISTRY
|
||||||
}) => async () => {
|
}) => async () => {
|
||||||
LOG(`${figures.arrowRight} login`);
|
LOG(`${figures.arrowRight} login`);
|
||||||
return execa('docker', [
|
return execa(
|
||||||
|
'docker',
|
||||||
|
[
|
||||||
'login',
|
'login',
|
||||||
'--email="."',
|
'--email="."',
|
||||||
`--username="${_DOCKER_LOGIN_USERNAME}"`,
|
`--username="${_DOCKER_LOGIN_USERNAME}"`,
|
||||||
`--password="${_DOCKER_LOGIN_PASSWORD}"`,
|
`--password="${_DOCKER_LOGIN_PASSWORD}"`,
|
||||||
_DOCKER_REGISTRY
|
_DOCKER_REGISTRY
|
||||||
], {
|
],
|
||||||
|
{
|
||||||
stdio: 'inherit'
|
stdio: 'inherit'
|
||||||
});
|
}
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const build = ({ CIRCLE_BRANCH }) => async () => {
|
const build = ({ CIRCLE_BRANCH }) => async () => {
|
||||||
@ -117,7 +126,7 @@ const run = async () => {
|
|||||||
LOG(`${figures.arrowRight} .env`);
|
LOG(`${figures.arrowRight} .env`);
|
||||||
LOG(JSON.stringify(Object.keys(env), null, 2));
|
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`);
|
LOG(`${figures.arrowRight} DEPLOY`);
|
||||||
|
Loading…
Reference in New Issue
Block a user