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

GoReleaser build and release support #140

Merged
merged 2 commits into from
Mar 12, 2019
Merged

GoReleaser build and release support #140

merged 2 commits into from
Mar 12, 2019

Conversation

karlskewes
Copy link
Contributor

@karlskewes karlskewes commented Jan 27, 2019

GoReleaser build and release support

Simplified build (and release?) per #134.
Not automatically hooked into Travis or anything (yet).

Binaries tested with --version:

  • linux (docker images as well)
  • windows

Binaries not tested:

  • darwin (don't have mac)

Build and Publish tested:

  • Create GitHub Token
  • In .goreleaser.yml comment out release.disable: true
  • git commit
  • git tag v0.7.1 && git push
  • make publish
  • single archive per platform contains both controller and kubeseal binaries, plus kubernetes yaml's
  • locally docker images are created

Not Tested:

  • docker image push - In .goreleaser.yml comment out docker.skip_push: true

Build fork/dirty/etc: (assuming merged, patch on upstream or blog link below)

make snapshot

This results in binaries, archives and docker images tagged with full git commit hash.

To Do:

  • TODO: comment added for brew to change to published formula
  • confirm ok publishing archive instead of binaries
  • yamls added to archive
  • DOCS update and simplification

First time using goreleaser so... :)

@karlskewes
Copy link
Contributor Author

Thanks very much for reviewing Gus.

@karlskewes
Copy link
Contributor Author

karlskewes commented Feb 23, 2019

Have had a go at docs tidy up to go with goreleaser use.
Easiest to preview here on my fork here: https://github.com/kskewes/sealed-secrets/tree/goreleaser

Specifically:

TBD:

  • controller.yaml generation from jsonnet - update Makefile and store in /examples/ ?
  • CONTRIBUTING and MIGRATION updates for goreleaser based install flow.
  • MIGRATION could also home the kube-system to sealed-secrets namespace change info.

@karlskewes
Copy link
Contributor Author

Seems pretty complete. Happy to amend as needed.
Goreleaser doesn't generate yaml from jsonnet hence add /examples/controller*.yaml with no image tag (:latest).
Follow up task to enable release pushing to github & docker when you're ready, or I can set like that as part of this PR.
Haven't touched Makefile.

Copy link
Contributor

@anguslees anguslees left a comment

Choose a reason for hiding this comment

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

oh, I didn't hit send on these comments from earlier. I think you mostly already replied to them..

README.md Outdated
# Install server-side controller into kube-system namespace (by default)
$ kubectl create -f https://github.com/bitnami-labs/sealed-secrets/releases/download/$release/controller.yaml
# For clusters with RBAC
$ wget https://github.com/bitnami-labs/sealed-secrets/examples/controller.yaml
Copy link
Contributor

Choose a reason for hiding this comment

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

Hrm. I don't think we can just do this, since this controller.yaml doesn't have any embedded version tag, so it will just install :latest controller image. I think we need to add builds.hooks.post: make controller.yaml controller-norbac.yaml and then copy those generated yaml files either to github release artefacts (preferred), or into the goreleaser archive.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay, sure will try that and verify flow with new tag in my fork.

Copy link
Contributor Author

@karlskewes karlskewes Mar 1, 2019

Choose a reason for hiding this comment

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

Generating and adding YAML's to archive with builds.hooks.post was straight forward with two exceptions:

  1. Makefile target builds docker image as part of generating YAML, this duplicates goreleaser and could lead to different docker images, see proposed change
  2. Makefile adds +dirty to $(VERSION) if repo dirty but + is invalid image tag character, see proposed change
    I'm trying not to alter existing flow too much but there is overlapping functionality.
    EDIT: This broke Travis so had to add controller.image target in .travis.yml, now builds again.

RE: Publishing to GitHub as part of Release:
Looks like the Release struct in Goreleaser doesn't have a Files var like some of the others.
I've asked on their Slack channel about it. Imagine it would take a bit of plumbing to wire it through if they are open to a PR. Maybe there's an alternate method?

Example release on my fork - (Squashed commits for this PR)

@anguslees
Copy link
Contributor

I think this is mostly awesome, and ready to merge (with the above comments).

You haven't hooked this into anything that actually invokes goreleaser yet, so nothing will change immediately as part of this PR (good). I think we need to wrap invoking goreleaser with something that generates versioned k8s manifests, and pushes those manifests to github release artefacts. Easiest to do that after we have some experience with driving the tool/workflow manually.

@karlskewes karlskewes changed the title [WIP] GoReleaser GoReleaser build and release support Mar 2, 2019
@karlskewes
Copy link
Contributor Author

  • Added Makefile targets to wrap typical goreleaser commands.
    Actual publishing to GitHub and docker push still prohibited by couple lines in .goreleaser.yml, please see PR message at top.

  • YAML's get generated and added to archive now. Details here

Simplified build (and release?) per #134.
Not automatically hooked into Travis or anything (yet).

**Binaries tested with `--version`:**
- linux (docker images as well)
- windows

**Binaries not tested:**
- darwin (don't have mac)

**Build and Publish tested:**
- Create [GitHub Token](https://goreleaser.com/environment/)
- In `.goreleaser.yml` comment out `release.disable: true`
- `git commit`
- `git tag v0.7.1 && git push`
- `make publish`
- single archive per platform contains both `controller` and `kubeseal` binaries, plus kubernetes yaml's
- locally docker images are created

**Not Tested:**
- docker image push - In `.goreleaser.yml` comment out `docker.skip_push: true`

**Build fork/dirty/etc:** (assuming merged, patch on upstream or blog link below)
```
make snapshot
```
This results in binaries, archives and docker images tagged with full git commit hash.

**To Do:**
- [x] TODO: comment added for brew to change to [published formula](https://github.com/Homebrew/homebrew-core/blob/master/Formula/kubeseal.rb)
- [x] confirm ok publishing archive instead of binaries
- [x] yamls added to archive
- [x] DOCS update and simplification

First time using goreleaser so... :)
@karlskewes
Copy link
Contributor Author

Rebased on master with TPR removed.

Copy link
Contributor

@anguslees anguslees left a comment

Choose a reason for hiding this comment

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

lgtm! Are we ready to merge this?

In particular: I think nothing changes immediately/automatically. The new release process needs to be triggered manually when the time comes (good, means we can check it over first).

@karlskewes
Copy link
Contributor Author

Yes! Thanks for your patience.

@anguslees
Copy link
Contributor

Merging!

bors r+

bors bot added a commit that referenced this pull request Mar 12, 2019
140: GoReleaser build and release support r=anguslees a=kskewes

GoReleaser build and release support

Simplified build (and release?) per #134.
Not automatically hooked into Travis or anything (yet).

**Binaries tested with `--version`:**
- linux (docker images as well)
- windows

**Binaries not tested:**
- darwin (don't have mac)

**Build and Publish tested:**
- Create [GitHub Token](https://goreleaser.com/environment/)
- In `.goreleaser.yml` comment out `release.disable: true`
- `git commit`
- `git tag v0.7.1 && git push`
- `make publish`
- single archive per platform contains both `controller` and `kubeseal` binaries, plus kubernetes yaml's
- locally docker images are created

**Not Tested:**
- docker image push - In `.goreleaser.yml` comment out `docker.skip_push: true`

**Build fork/dirty/etc:** (assuming merged, patch on upstream or blog link below)
```
make snapshot
```
This results in binaries, archives and docker images tagged with full git commit hash.

**To Do:**
- [x] TODO: comment added for brew to change to [published formula](https://github.com/Homebrew/homebrew-core/blob/master/Formula/kubeseal.rb)
- [x] confirm ok publishing archive instead of binaries
- [x] yamls added to archive
- [x] DOCS update and simplification

First time using goreleaser so... :)

Co-authored-by: Karl Skewes <karl.skewes@gmail.com>
Co-authored-by: Karl <karl.skewes@gmail.com>
@bors
Copy link
Contributor

bors bot commented Mar 12, 2019

Build succeeded

@bors bors bot merged commit fb8415a into bitnami-labs:master Mar 12, 2019
@karlskewes
Copy link
Contributor Author

We actually will need to release due to the included docs changes. Or revert.
Apologies for the scope creep on this PR.

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

Successfully merging this pull request may close these issues.

2 participants