profiler icon indicating copy to clipboard operation
profiler copied to clipboard

Write a script to simplify deployments and rollbacks

Open julienw opened this issue 5 years ago • 3 comments

Our deploy process is longer than it should be, because it involves going through a sequence of actions on Github Web UI.

Instead we can leverage the command line using git, github cli, and/or directly calling the github API, to make it easier.

Some tips:

  • generate a changelog (assumes moz is the upstream remote -- can we infer that?)
git fetch moz
git log --oneline --first-parent moz/production..moz/main | awk '{ $1 = "*"; print }'
  • checks that production doesn't have any unwanted commit
git fetch moz
git log --oneline moz/main..moz/production --no-merges
  • create a production deployment PR with the github cli
gh pr create --base production --head main -t "Deploy XXX" -b "body"

(would be good to put the result of "changelog" in the body)

┆Issue is synchronized with this Jira Task

julienw avatar Oct 08 '20 13:10 julienw

checks that production doesn't have any unwanted commit
create a production deployment PR with the github cli

It stroke me that we can also handle the merge locally using pure git, doing local checks, and directly push to github to the production branch.

julienw avatar Oct 12 '20 09:10 julienw

It stroke me that we can also handle the merge locally using pure git, doing local checks, and directly push to github to the production branch.

It would be preferable on my end to be able to automate this all from my terminal

gregtatum avatar Oct 13 '20 18:10 gregtatum

It would be preferable on my end to be able to automate this all from my terminal

Yeah this was always the goal :) The open question is: only git operations, or using the github CLI. Now that I gave it some thought, I think we can do it with only git operations.

julienw avatar Oct 19 '20 17:10 julienw