Skip to content
This repository has been archived by the owner on Aug 30, 2022. It is now read-only.

Commit

Permalink
feat(build-name): add build-name option
Browse files Browse the repository at this point in the history
BREAKING CHANGE: --externalBuildId is now --external-build-id
  • Loading branch information
gregberge committed Jun 23, 2020
1 parent 952dfbf commit 5b833d1
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 19 deletions.
19 changes: 10 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,19 @@ Commands:
### Upload

```sh
Usage: argos upload [options] <directory>
Usage: index upload [options] <directory>

Upload screenshots

Options:
-T, --token <token> Repository token
-C, --commit <commit> Git commit
-B, --branch <branch> Git branch
--externalBuildId [string] ID of the build (batch mode only)
--batchCount [int] Number of batches expected (batch mode)
--ignore <list> List of glob files to ignore (ex: "**/*.png,**/diff.jpg")
-h, --help output usage information
-T, --token <token> Repository token
-C, --commit <commit> Git commit
-B, --branch <branch> Git branch
--external-build-id [string] ID of the build (batch mode only)
--batchCount [int] Number of batches expected (batch mode)
--build-name [string] Name of the build
--ignore <list> List of glob files to ignore (ex: "**/*.png,**/diff.jpg")
-h, --help display help for command
```

### Cancel
Expand All @@ -49,7 +50,7 @@ Cancel the build (batch mode only)

Options:
-T, --token <token> Repository token
--externalBuildId [string] ID of the build (batch mode only)
--external-build-id [string] ID of the build (batch mode only)
-h, --help output usage information
```

Expand Down
2 changes: 1 addition & 1 deletion src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const config = convict({
default: '',
env: 'ARGOS_BATCH_COUNT',
},
name: {
buildName: {
doc: 'Build name',
format: String,
default: '',
Expand Down
12 changes: 6 additions & 6 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ updateNotifier({ pkg }).notify()
initializeErrorReporter()

if (process.env.NODE_ENV !== 'production') {
process.on('exit', code => {
process.on('exit', (code) => {
console.info(`exit code: ${code}`)
})
}

const list = value => value.split(',')
const list = (value) => value.split(',')

program.version(pkg.version)

Expand All @@ -28,13 +28,13 @@ program
.option('-T, --token <token>', 'Repository token')
.option('-C, --commit <commit>', 'Git commit')
.option('-B, --branch <branch>', 'Git branch')
.option('--externalBuildId [string]', 'ID of the build (batch mode only)')
.option('--external-build-id [string]', 'ID of the build (batch mode only)')
.option(
'--batchCount [int]',
'Number of batches expected (batch mode)',
parseInt,
)
.option('--name [string]', 'Name of the build')
.option('--build-name [string]', 'Name of the build')
.option(
'--ignore <list>',
'List of glob files to ignore (ex: "**/*.png,**/diff.jpg")',
Expand Down Expand Up @@ -78,8 +78,8 @@ program
.command('cancel')
.description('Cancel the build (batch mode only)')
.option('-T, --token <token>', 'Repository token')
.option('--externalBuildId [string]', 'ID of the build (batch mode only)')
.action(async command => {
.option('--external-build-id [string]', 'ID of the build (batch mode only)')
.action(async (command) => {
console.log(`=== argos-cli: canceling build`)

let json
Expand Down
6 changes: 3 additions & 3 deletions src/upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ async function upload(options) {
branch: branchOption,
commit: commitOption,
externalBuildId: externalBuildIdOption,
name: nameOption,
buildName: buildNameOption,
batchCount: batchCountOption,
} = options

Expand All @@ -35,9 +35,9 @@ async function upload(options) {
externalBuildIdOption ||
config.get('externalBuildId') ||
environment.externalBuildId
const name = nameOption || config.get('name') || environment.name
const batchCount =
batchCountOption || config.get('batchCount') || environment.batchCount
const name = buildNameOption || config.get('buildName')

if (environment.ci) {
displayInfo(`identified \`${environment.ci}\` environment`)
Expand Down Expand Up @@ -94,7 +94,7 @@ async function upload(options) {
token,
externalBuildId,
batchCount,
names: screenshots.map(screenshot => screenshot.name),
names: screenshots.map((screenshot) => screenshot.name),
}),
)

Expand Down

0 comments on commit 5b833d1

Please sign in to comment.