deis / workflow-cli

The CLI for Deis Workflow
http://deis.com
MIT License
31 stars 43 forks source link

feat(deploys): add deploy_now, deployed attributes #296

Closed kwent closed 7 years ago

kwent commented 7 years ago

Requires https://github.com/deis/controller-sdk-go Requires https://github.com/deis/controller/pull/1269

TODO

deis-bot commented 7 years ago

@Joshua-Anderson and @ultimateboy are potential reviewers of this pull request based on my analysis of git blame information. Thanks @kwent!

vdice commented 7 years ago

It looks like a correlating change will be needed to the controller-sdk-go api (unit tests failing as the api has not yet been updated to fully support this change.)

cmd\releases.go:62: r.Deployed undefined (type api.Release has no field or method Deployed)
kwent commented 7 years ago

@vdice Updated controller-sdk-go as well.

vdice commented 7 years ago

Refer to ci results in https://github.com/deis/controller/pull/1269 (runs with controller and workflow-cli+controller-sdk-go changes)

kwent commented 7 years ago

I think i can do a deis pull with a flag to allow to just do build and don't deploy easy. But what about git push. Any idea how we could prevent to do the deploy right away with git push. Maybe a global option in deis config:set ?

vdice commented 7 years ago

@kwent hmmm good question. I think indeed a global option/env var that can be used by builder might be a solution for git push.

So is the current thought to have a flag for deis pull and deis builds:create, e.g. deis pull deis/example-go --deploy-now false and then an app config/env var for doing same w/ git push deis master, e.g. deis config:set DEPLOY_NOW=false -a myapp; git push deis master? (Maybe DEPLOY_ON_BUILD might be better... not sure)

Also, we'll need a subsequent deis releases:deploy logic to be added here as well for when the user does want to deploy a build, right?

cc @mboersma @bacongobbler

kwent commented 7 years ago

I might need some help for the third checkbox. Not sure how to read configuration in the client. Some clues maybe ?

vdice commented 7 years ago

@kwent although I haven't coded in this area, it looks like a handy example may lie in ConfigList.

So added logic in builds.go might boil down to something like the following:

s, appID, err := load(d.ConfigFile, appID)
...
config, err := config.List(s.Client, appID)
...
// iterate through config listing; if DEIS_DEPLOY_NOW set, it should take priority
...
kwent commented 7 years ago

@vdice I believe this is done now

mboersma commented 7 years ago

These PRs haven't been updated in a few months. @kwent I'm going to close this, but please re-open if you can address the remaining issues, and thanks again!