Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically alias commits on master #10

Open
mxstbr opened this issue May 9, 2017 · 5 comments
Open

Automatically alias commits on master #10

mxstbr opened this issue May 9, 2017 · 5 comments

Comments

@mxstbr
Copy link

mxstbr commented May 9, 2017

Let's say I have a pizza-app and deploy using stage-ci. Now I want all commits on master to automatically be deployed to production, i.e. be aliased to pizza-app.com.

Does that work?

@amccloud
Copy link
Collaborator

Not currently but it should be simple to do:

https://github.com/zpnk/stage-ci/blob/master/src/core.js#L71

The hardest part is deciding how to expose that functionality.

@mxstbr
Copy link
Author

mxstbr commented May 10, 2017

Environment variable on deploy of the webhook maybe? MASTER_ALIAS=pizza-app.com

That would be epic, it would essentially make stage-ci the most awesome deployment tool ever.

@zpnk
Copy link
Owner

zpnk commented May 10, 2017

I can see how this would be a really useful feature, and I like the idea a lot.

It's definitely do-able, but beyond configuration it would require adapting our implementation to respond to GitHub's PushEvent.

Quick background on how stage works currently:

  • when users configure the webhook we only ask them to select the "pull request" event.
  • only PullRequestEvents with either the opened or synchronize action trigger a deploy

If we add support for the push event my questions would be:

  • do we ask users to select the two events? or just the "send everything" option and we filter? (may be more future-proof)
  • should the configuration include the branch to auto deploy? (ie, production vs master)
  • how do we communicate the deployment status to the user? GitHub's status api is less useful outside a PR context because there is no UI to display it.

In terms of configuration, environment variables are the way to go. I'd propose two:

  • STAGE_AUTODEPLOY_BRANCH - set this to "master" to deploy commits on master
  • STAGE_AUTODEPLOY_ALIAS - set this to "pizza-app.com" to override the commit's deployment alias

I'd also propose we just allow all events and let the server filter based on what we need (PullRequest, Push).

Not sure about deployment status.

If I have time to work on this I will assign myself and remove the "help wanted" label. Otherwise, if someone else wants to grab this, just post here.

@mxstbr
Copy link
Author

mxstbr commented May 10, 2017

Yep that sounds absolutely brilliant!

@glambert
Copy link

glambert commented Sep 8, 2017

Would this also allow to have a static website always on the same URL for the latest master?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants