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

Build and CI rework #35

Closed
wants to merge 7 commits into from
Closed

Conversation

dzeban
Copy link

@dzeban dzeban commented Mar 25, 2019

This PR adds publishing of clickhouse_exporter to GitHub releases to allow users downloading ready-made binaries or rpm/deb package.

The solution was proposed in #34 and consists of the following:

  • Remove promu usage because it's not really needed
  • Update Travis configuration to use supported Go versions
  • Launch tests recursively for all packages with docker-compose up for Clickhouse
  • Adds deploy step to Travis CI that creates GitHub release

Fixes #34, #32

promu is useless in Makefile because it builds but we already do
`go install`.
Current CI configuration uses outdated Ubuntu Trusty and unsupported Go
versions.

This change updates version to Ubuntu Xenial and latest (at the moment
of commit) supported versions of Go.
Currently `go test` is running in "local directory mode". Citing the
`go help test`:

> The first, called local directory mode, occurs when go test is
invoked with no package arguments (for example, 'go test' or 'go
test -v'). In this mode, go test compiles the package sources and
tests found in the current directory and then runs the resulting
test binary.

So no actual tests are run because main package doesn't have any.

This commit adds testing of all packages by adding `./...` argument to
test command. It also adds spinning up docker-compose to make tests pass
because the tests need to query real Clickhouse instance.
goreleaser is used for making GitHub releases on tag push so people
could download the prebuilt binaries and Linux packages.

goreleaser will create GitHub release with:

* Binaries for Linux and Darwin for amd64 and i386
* Deb and RPM packages for amd64 and i386
Travis CI will invoke goreleaser on tag push that will create GitHub
release with artifacts described in goreleaser config.
To avoid deploy job failure we have to invoke goreleaser from one job
because otherwise GitHub release is already created.

In this commit we add second condition to deploy with the last Go
version.
@dzeban
Copy link
Author

dzeban commented Mar 25, 2019

You can check how GitHub release would look like in my fork - https://github.com/dzeban/clickhouse_exporter/releases

The release is created only for git tags.

@dzeban
Copy link
Author

dzeban commented Mar 25, 2019

Oh, and also to make deploy work, you need to create token and add it to Travis CI GITHUB_TOKEN env variable. I can show you how to do this.

@Slach
Copy link
Collaborator

Slach commented Jun 17, 2021

@dzeban thanks a lot for your contributing, currelty we switched to github actions, so I close this PR

@Slach Slach closed this Jun 17, 2021
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.

Publishing releases
2 participants