Skip to content

Commit

Permalink
変数名を修正。
Browse files Browse the repository at this point in the history
  • Loading branch information
leak4mk0 committed Jun 26, 2017
1 parent 60d3a8b commit dbb723a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ Promise.resolve()
// 取得した設定を用いて、Dockerイメージをビルドする。
.then((config) => (new Promise((resolve, reject) => {
console.log('\nBuild Docker image.');
const machine = spawn('docker', [...config, 'build', '-t', `${meta.name}:${meta.version}`, '.'], {
const docker = spawn('docker', [...config, 'build', '-t', `${meta.name}:${meta.version}`, '.'], {
stdio: [null, process.stdout, process.stderr],
});
machine.on('error', reject);
machine.on('exit', (code) => {
docker.on('error', reject);
docker.on('exit', (code) => {
if (code !== 0) {
return reject(new Error('Docker failed.'));
}
Expand Down
20 changes: 10 additions & 10 deletions scripts/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@ Promise.resolve()
// Kubernetesの現在のコンテキストを取得する。
.then((config) => (new Promise((resolve, reject) => {
console.log('\nGet current context of Kubernetes.');
const machine = spawn('kubectl', ['config', 'current-context'], {
const kubectl = spawn('kubectl', ['config', 'current-context'], {
stdio: [null, null, process.stderr],
});
let out = '';
machine.stdout.on('data', (data) => { out += data; });
machine.on('error', reject);
machine.on('exit', (code) => {
kubectl.stdout.on('data', (data) => { out += data; });
kubectl.on('error', reject);
kubectl.on('exit', (code) => {
if (code !== 0) {
return reject(new Error('Kubernetes failed.'));
}
Expand All @@ -90,11 +90,11 @@ Promise.resolve()
const target = `${prefix}gcr.io/${context.project}/${source}`;
console.log(`Source: ${source}`);
console.log(`Target: ${target}`);
const machine = spawn('docker', [...config, 'tag', source , target], {
const docker = spawn('docker', [...config, 'tag', source , target], {
stdio: [null, process.stdout, process.stderr],
});
machine.on('error', reject);
machine.on('exit', (code) => {
docker.on('error', reject);
docker.on('exit', (code) => {
if (code !== 0) {
return reject(new Error('Docker failed.'));
}
Expand All @@ -104,12 +104,12 @@ Promise.resolve()
// Dockerイメージをレポジトリに送信する。
.then(([config, target]) => (new Promise((resolve, reject) => {
console.log('\nPush a tagged image to a repository.');
const machine = spawn('gcloud', ['docker', '--', ...config, 'push', target], {
const gcloud = spawn('gcloud', ['docker', '--', ...config, 'push', target], {
shell: true,
stdio: [null, process.stdout, process.stderr],
});
machine.on('error', reject);
machine.on('exit', (code) => {
gcloud.on('error', reject);
gcloud.on('exit', (code) => {
if (code !== 0) {
return reject(new Error('Docker failed.'));
}
Expand Down

0 comments on commit dbb723a

Please sign in to comment.