Open Bug 1411598 Opened 9 years ago Updated 6 years ago

Add git shortref in deployment messages to cloudops slack bot

Categories

(Cloud Services :: Operations: AMO, task, P4)

task

Tracking

(Not tracked)

ASSIGNED

People

(Reporter: TheOne, Assigned: sven)

Details

It would be helpful if the 'cloudops-ansible' bot would include the git shortref that has been deployed, to messages like: "addons-server build #3404: tag latest deployed to -dev."
Assignee: nobody → wezhou
Assignee: wezhou → sven
Status: NEW → ASSIGNED
Priority: -- → P4

IRC is now Slack!

Summary: Add git shortref in deployment messages to cloudops irc bot → Add git shortref in deployment messages to cloudops slack bot

Will mentioned using docker object labels to pass the information down - we have the shortref in circleci when building the image.

Here's the information about a push that Docker Hub passes on to our Jenkins proxy:

  "push_data": {
    "images": [
        "27d47432a69bca5f2700e4dff7de0388ed65f9d3fb1ec645e2bc24c223dc1cc3",
        "51a9c7c1f8bb2fa19bcd09789a34e63f35abb80044bc10196e304f6634cc582c",
        "..."
    ],
    "pushed_at": 1.417566161e+09,
    "pusher": "trustedbuilder",
    "tag": "latest"
  }

So the only way to include the git commit hash indeed is to use it as the tag.

The tag is definitely passed on by the proxy, and the Slack message already contains the image tag, so we'd only need the following changes:

  • In the Circle CI config, push the image tagged with the git hash instead of latest (or maybe both, if you still want to have a latest tag). We can optionally prefix the git hash with some label like git-commit-<sha1> to make it easier to detect in Jenkins.
  • Modify the Jenkins pipeline configuration of the "meta-pipeline" to trigger the dev build when it encounters a SHA-1 hash rather than on latest.

That's actually a lot easier than I expected – only two out of the four steps need any changes. Let's go for it then. :)

I've submitted https://github.com/mozilla/addons-server/pull/14901 for the first bullet point above. The second bullet point can only be done once that PR is merged.

You need to log in before you can comment on or make changes to this bug.