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

Trigger staging deploy whenever a PR is merged to master #63

Closed
barrymcgee opened this issue Mar 14, 2019 · 7 comments
Closed

Trigger staging deploy whenever a PR is merged to master #63

barrymcgee opened this issue Mar 14, 2019 · 7 comments
Assignees

Comments

@barrymcgee
Copy link
Contributor

barrymcgee commented Mar 14, 2019

Feature request

I'd like Jenkins to auto-deploy staging.jaas.ai whenever a new feature branch is merged to the master branch.

Reasons

In order to improve collaboration and communication with the design team, I want them to be able to quickly be able to view the staging site and know immediately what work has landed.

@barrymcgee
Copy link
Contributor Author

@tbille Would you be able to help me with this, please? I'm hoping it's a quick settings change in the Jenkins config? I had a quick look and fiddled with some settings but it doesn't seem to be working?

@barrymcgee barrymcgee changed the title Trigger staging deploy whenever Pr is merged to develop Trigger staging deploy whenever a PR is merged to develop Mar 14, 2019
@tbille tbille self-assigned this Mar 14, 2019
@tbille
Copy link
Contributor

tbille commented Mar 14, 2019

@barrymcgee added a few tasks to check what can be done with it

Needs to be done

  • Investigate where github webhook endpoint is on jenkins
  • Add webhook on organisation to push merges on master to jenkins
  • Test it 😄 #winning

@barrymcgee barrymcgee changed the title Trigger staging deploy whenever a PR is merged to develop Trigger staging deploy whenever a PR is merged to master Mar 19, 2019
@nottrobin
Copy link
Contributor

So this has been the ultimate plan for every site for a while, but I'm worried that Just Doing It will actually produce a worse experience for developers. Here's why (#clickbait):

At the moment, the flow from master to production is:

  • trigger the staging build
  • follow the log output
  • when it's finished, click the link - which takes you over to the product job with the image_tag filled in for you
  • build the production job

If we simply automated the staging build step then instead the flow becomes:

  • open the staging build
  • find the latest build, that was run automatically
  • open the log
  • scroll to the bottom
  • click the link to take you to production job with the image_tag filled in for you
  • build the production job

This seems to me clunky and fundamentally less intuitive - it will feel unnatural and constantly annoying to have to open the staging job log, for a job you didn't start - and also doesn't really save you a whole lot of time.

So my plan for fixing this is to develop a page, similar to http://project-builds.demo.haus, which would know what version was on staging and provide you with a simple "deploy to production" link to start the job, reducing the production deployment steps significantly:

  • open the production builds page
  • click the link
  • build the production job

I think now would be a good time to schedule the building of that webpage in the base squad. @tbille could you help me put that in the plan?

@nottrobin
Copy link
Contributor

nottrobin commented Apr 10, 2019

Actually, sorry, I just properly read the Reasons:

@barrymcgee: In order to improve collaboration and communication with the design team, I want them to be able to quickly be able to view the staging site and know immediately what work has landed.

For this reason I imagine @barrymcgee will tell me the clunky developer release experience is tolerable so you get the benefit of designers immediately seeing the state of master. So we could Just Enable It. But we should still prioritise the building of that page to smooth the production release process.

@nottrobin
Copy link
Contributor

nottrobin commented Apr 10, 2019

Okay I think I've achieved this:

So I think we can call that success.

I filed https://github.com/ubuntudesign/base-squad/issues/471 to track the next step, which is to create a portal to make it easier to trigger production deployments.

@barrymcgee
Copy link
Contributor Author

@nottrobin Excellent - thank you! I would also add that your first step assumption assumes that a developer deploys to staging but never actually leaves the Jenkins portal to check the site in their browser.

In my experience, there is always a step to return to Jenkins to find the last completed job to staging before deploying to prod.

Delighted this is done though and new status page is a great idea! 👌🏻👌🏻👌🏻

@nottrobin
Copy link
Contributor

@barrymcgee yeah fair enough. I always keep the staging deployment log open after running it, so it all seems a bit more linked to me than if it was automatically triggered, but I can appreciate that YMMV.

Which kinda means we need the portal even more ;)

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

No branches or pull requests

3 participants