Skip to content
This repository has been archived by the owner on Aug 13, 2019. It is now read-only.

Make release script #422

Merged
merged 5 commits into from
Apr 24, 2018
Merged

Make release script #422

merged 5 commits into from
Apr 24, 2018

Conversation

peterbe
Copy link
Contributor

@peterbe peterbe commented Apr 23, 2018

This is work in progress but would be nice to have some eyes on it. Basically, I'm trying to completely automate the steps in the README.

I used this script to generate this: https://github.com/mozilla-services/buildhub/releases/tag/v1.2.0

The only thing it doesn't do is the pinging on Bugzilla to ask OPs(*) to deploy it on prod. As far as I can understand, simply making a release will upgrade Stage. So I want to test that first.

Thing is, if I make a tag & release, it's very unlikely that I want to ask OPs to take that to prod. As soon as I've made a tag, I want to watch/watching Stage to see that the release works there. Then, perhaps a day later or so I'll go to OPs and say "I've been watching release v1.2.0 on Stage. It seems to work. Please go ahead and put this in Prod."

(*) By that I mean, filing a bug.

@peterbe peterbe requested a review from leplatrem April 23, 2018 18:46
@peterbe peterbe mentioned this pull request Apr 23, 2018
@peterbe
Copy link
Contributor Author

peterbe commented Apr 23, 2018

UPDATE: When you make a new Release on GitHub the Stage cron job is automatically upgraded. But the Stage Lambda job is not. That requires filing a bug. Will amend the script to help with that.

@peterbe
Copy link
Contributor Author

peterbe commented Apr 23, 2018

Instead of pinging OPs on bugzilla about the lambda zip. Issue #423 is about instead "baking" the lambda code into the release (via Circle) process directly.

We still need a Bugzilla bug for every Prod deployment.

@peterbe
Copy link
Contributor Author

peterbe commented Apr 24, 2018

Also, I used:

▶ ./bin/deployment-bug.py stage lambda
To file this bug, click (or copy) this URL:
👇
https://bugzilla.mozilla.org/enter_bug.cgi?qa_contact=chartjes%40mozilla.com&comment=Could+you+please+update+the+Lambda+function+for+Buildhub+Stage+with+the+following+one%3F%0A%0Ahttps%3A%2F%2Fgithub.com%2Fmozilla-services%2Fbuildhub%2Freleases%2Ftag%2Fv1.2.0%0A%0Ahttps%3A%2F%2Fgithub.com%2Fmozilla-services%2Fbuildhub%2Freleases%2Fdownload%2Fv1.2.0%2Fbuildhub-lambda-v1.2.0.zip%0A%0AThanks%21&short_desc=On+Stage%2C+please+deploy+Buildhub+Lambda+function+v1.2.0&component=Operations%3A+Storage&product=Cloud+Services&bug_file_loc=https%3A%2F%2Fgithub.com%2Fmozilla-services%2Fbuildhub%2Freleases%2Ftag%2Fv1.2.0
👆

To help me make this bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1456446

Copy link
Collaborator

@leplatrem leplatrem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the buildhub repo never received so much love 😄

Thanks for this!!


To upgrade the cron job _and_ Lambda job on **Prod** run:

./bin/deployment-bug.py prod
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

return
if ok.lower().strip() == 'n':
print('Tip! Generate it by running: make lambda.zip ')
return
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here you may want to return a value

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/me done.

'-s',
'-a', tag_name,
'-m', tag_body,
])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of having several places with check_call / check_output + decode, and a if dry_run switch, you could have a small helper :

output = run_command(f"git tag -s -a {tag_name} -m {tag_body}", dry_run=dry_run)\

if args.part not in ('major', 'minor', 'patch'):
parser.error("invalid part. Must be 'major', 'minor', or 'patch'")
args = vars(args)
main(args.pop('part'), **args)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sys.exit(main(...)) ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep. Fixed now.

▶ GITHUB_API_KEY=895fxxxxxce09 ./bin/make-release.py patch -d
The lambda.zip...

	Last modified: 23 April 2018 - 14:07:37
	Age: 22 hours 18 minutes ago

Is this lambda.zip recently generated? [Y/n] n
Tip! Generate it by running: make lambda.zip
(buildhub)
MOZILLA/BUILDHUB/buildhub  make-release-script ✗                                                                                                                                                            ▶ echo $?
3

@peterbe
Copy link
Contributor Author

peterbe commented Apr 24, 2018

It's not perfect but I'll land it now. It works and can be improved later.

@peterbe peterbe merged commit 72b919a into mozilla-services:master Apr 24, 2018
@peterbe peterbe deleted the make-release-script branch April 24, 2018 16:47
@leplatrem
Copy link
Collaborator

👍

@peterbe peterbe mentioned this pull request Apr 26, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants