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

WIP: release using goreleaser #516

Closed
wants to merge 3 commits into from
Closed

WIP: release using goreleaser #516

wants to merge 3 commits into from

Conversation

hilary
Copy link
Contributor

@hilary hilary commented Jul 24, 2019

TODO:

  • test the artifacts (there's a set in my github account)
  • revert commit with test settings

@hilary hilary requested review from kamaln7 and bentranter July 24, 2019 23:05
Copy link
Member

@bentranter bentranter left a comment

Choose a reason for hiding this comment

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

So far so good! I spent some time trying this against my own fork, and have a few pieces of feedback:

  • If make release fails during the scripts/release.sh step for some reason (ie, not being able to connect to Docker, repo is in a dirty state, access to Dockerhub is denied, etc), simply retrying the make release task could cause unexpected behaviour for the user invoking it. This is because the version is already bumped, and a tag on the repo is already created, so when make release is invoked again, a new version and tag is created, instead of re-trying scripts/release.sh on the existing version and tag. Maybe there's a way to detect this and retry scripts/releash.sh if that fails? Maybe checking if the branch name matches tags/x.x.x?
  • Related to the steps above, there might be a few more things we want to mention so that users can avoid failures related to goreleaser. In prerequisites, we should consider mentioning,
    • That you need Docker running on the machine you want to release from,
    • That you need to be logged in (via docker login, for example),
    • That your repo must not be in a dirty state (because goreleaser doesn't like that).

Keep in mind that my comments above assume that a human will use this script – if the intention is for this to only ever be done on CI, then my feedback may not apply.

@hilary
Copy link
Contributor Author

hilary commented Jul 25, 2019

For now, humans will run make release, which means we need the robustness. We'll get to travis running it, just not in one step.

I have multiple steps under the hood, I just need to rejigger / expose those steps, as well as annotate what to do if the process dies in an interim state.

@hilary
Copy link
Contributor Author

hilary commented Jul 25, 2019

Oh, and it isn't goreleaser that objects to your repo being in a dirty state. That's a check I put in in scripts/version.sh. We'll get stricter down the road. 😄

@bentranter
Copy link
Member

@hilary I think goreleaser performs that check as well. I've got a TODO.md in my local copy of the repo that I don't check in, and if I run goreleaser from the root of the repo, I get the following output:

   • releasing using goreleaser 0.113.0...
   • could not find a config file, using defaults...
   • RUNNING BEFORE HOOKS
   • LOADING ENVIRONMENT VARIABLES
   • GETTING AND VALIDATING GIT STATE
      • releasing v1.23.1, commit 749efc752f74e2c7f94253ce8255e7be8acb279e
   ⨯ release failed after 0.08s error=git is currently in a dirty state, please check in your pipeline what can be changing the following files:
?? TODO.md

@hilary
Copy link
Contributor Author

hilary commented Jul 25, 2019

Ah, right. I check for staged but uncommitted changes, iirc.

@hilary
Copy link
Contributor Author

hilary commented Jul 25, 2019

Ok, I've hardened quite a bit.

Re: dirty state. Releasing now defaults to BRANCH=master and checks out the branch at the start of the process.
Most of the rest should be clear from CONTRIBUTING.


You will also need a valid `GITHUB_TOKEN` environment variable with access to the `digitalocean/doctl` repo. You can generate a token [here](https://github.com/settings/tokens), it needs the `public_repo` access.
* a valid dockerhub login with access to the `digitalocean` account. Post
in #it_support to request access.
Copy link
Member

Choose a reason for hiding this comment

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

Post in #in_support to request access.

We might want to add a note that this is for DO employees only, just to avoid confusion for any public contributors.

@hilary
Copy link
Contributor Author

hilary commented Jul 26, 2019

Moving branch to digitalocean account, opened #521

@hilary hilary closed this Jul 26, 2019
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

Successfully merging this pull request may close these issues.

3 participants