@byu-oit/cbsetup
Advanced tools
Comparing version 1.0.0 to 1.1.0
28
cli.js
@@ -31,4 +31,4 @@ #!/usr/bin/env node | ||
choices: [ | ||
'Back End' | ||
// TODO: Add front end option | ||
'Back End', | ||
'Front End' | ||
] | ||
@@ -55,9 +55,10 @@ }, | ||
inquirer.prompt(questions).then(async answers => { | ||
try { | ||
AWS.config.update({ region: answers.region }) | ||
const codebuild = new AWS.CodeBuild({ apiVersion: '2016-10-06' }) | ||
await createCodeBuildProject(codebuild, answers.region, | ||
answers.repo, answers.end, answers.buildspec, answers.token, answers.whenToBuild) | ||
AWS.config.update({ region: answers.region }) | ||
const codebuild = new AWS.CodeBuild({ apiVersion: '2016-10-06' }) | ||
let success = await createCodeBuildProject(codebuild, answers.region, | ||
answers.repo, answers.end, answers.buildspec, answers.token, | ||
answers.whenToBuild) | ||
if (success) { | ||
console.log('CodeBuild project created successfully.') | ||
} catch (e) { | ||
} else { | ||
console.log('CodeBuild project creation failed.') | ||
@@ -69,3 +70,4 @@ console.log(e.message) | ||
async function createCodeBuildProject (codebuild, region, repo, end, buildspec, token, whenToBuild) { | ||
async function createCodeBuildProject ( | ||
codebuild, region, repo, end, buildspec, token, whenToBuild) { | ||
let currentAccountId = await getCurrentAccountId() | ||
@@ -140,6 +142,8 @@ currentAccountId = currentAccountId.Account | ||
codebuild.createWebhook(webhookParams).promise().catch(err => { | ||
throw err | ||
console.log(err.stack) | ||
process.exit(1) | ||
}) | ||
}).catch(err => { | ||
throw err | ||
console.log(err.stack) | ||
process.exit(1) | ||
}) | ||
@@ -163,5 +167,5 @@ } | ||
} else { | ||
// TODO: Front end image | ||
buildImage = 'aws/codebuild/standard:1.0' | ||
} | ||
return buildImage | ||
} |
{ | ||
"name": "@byu-oit/cbsetup", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "Create an AWS CodeBuild project from your command line", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -7,3 +7,3 @@ # cbsetup | ||
This tool is distributed in a private package on npm. To use it, you will need Node and npm on your machine. You can find install instructions on [the NodeJS website](https://nodejs.org/en/download/package-manager/). Then run `npm i -g @byu-oit/cbsetup` to install the script. | ||
This tool is distributed in a package on npm. To use it, you will need Node and npm on your machine. You can find install instructions on [the NodeJS website](https://nodejs.org/en/download/package-manager/). Then run `npm i -g @byu-oit/cbsetup` to install the script. | ||
@@ -10,0 +10,0 @@ ## How to use |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16482
158