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

Commit

Permalink
Add support for -t flag for teams
Browse files Browse the repository at this point in the history
  • Loading branch information
appleton committed Jan 19, 2017
1 parent 8428d39 commit 65d3e08
Showing 1 changed file with 25 additions and 8 deletions.
33 changes: 25 additions & 8 deletions commands/pipelines/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,20 @@ module.exports = {
topic: 'pipelines',
command: 'setup',
description: 'bootstrap a new pipeline with common settings',
help: 'create a new pipeline and set up common features such as review apps',
help: `Example:
heroku pipelines:setup example githuborg/reponame -o example-org
? Automatically deploy the master branch to staging? Yes
? Wait for CI to pass before deploying the master branch to staging? Yes
? Enable review apps? Yes
? Automatically create review apps for every PR? Yes
? Automatically destroy idle review apps after 5 days? Yes
Creating pipeline... done
Linking to repo... done
Creating ⬢ example (production app)... done
Creating ⬢ example-staging (staging app)... done
Configuring pipeline... done
View your new pipeline by running \`heroku pipelines:open e5a55ffa-de3f-11e6-a245-3c15c2e6bc1e\``,
needsApp: false,
needsAuth: true,
args: [
Expand All @@ -149,24 +162,28 @@ module.exports = {
{
name: 'organization',
char: 'o',
description: 'the organization or team which will own the apps',
description: 'the organization which will own the apps (aliased as --team)',
hasValue: true
},
{
name: 'team',
char: 't',
description: 'the team which will own the apps (aliased as --organization)',
hasValue: true
}
],
run: cli.command(co.wrap(function*(context, heroku) {
// TODO:
// - Enable CI
//
const herokuToken = heroku.options.token
const githubToken = yield getGitHubToken(herokuToken)
const organization = context.flags.organization || context.flags.team

const { name: pipelineName, repo: repoName } = yield getNameAndRepo(context.args)
const repo = yield getRepo(githubToken, repoName)
const settings = yield getSettings(repo.default_branch)

let ciSettings
if (yield hasCIFlag(heroku)) {
ciSettings = yield getCISettings(context.flags.organization)
ciSettings = yield getCISettings(organization)
}

const pipeline = yield cli.action(
Expand All @@ -188,7 +205,7 @@ module.exports = {
pipeline,
name: pipelineName,
stage: 'production',
organization: context.flags.organization
organization
})
)

Expand All @@ -200,7 +217,7 @@ module.exports = {
pipeline,
name: stagingAppName,
stage: 'staging',
organization: context.flags.organization
organization
})
)

Expand Down

0 comments on commit 65d3e08

Please sign in to comment.