Skip to content

Commit

Permalink
Merge 71255cd into bf2d937
Browse files Browse the repository at this point in the history
  • Loading branch information
ColinSullivan1 committed Feb 22, 2018
2 parents bf2d937 + 71255cd commit 6c11f0e
Show file tree
Hide file tree
Showing 12 changed files with 65 additions and 49 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ _testmain.go
*.exe
*.test
*.prof
travis_wait*.log
3 changes: 2 additions & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
project_name: prometheus-nats-exporter

release:
draft: true
github:
owner: nats-io
name: prometheus-nats-exporter

name_template: 'Release {{.Tag}}'

builds:
Expand Down
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
language: go
go:
- 1.8.5
- 1.9.2
- 1.9.4

addons:
apt:
packages:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ For further information, refer to the [walkthough](walkthrough/README.md) of mon

[License-Url]: http://opensource.org/licenses/MIT
[License-Image]: https://img.shields.io/badge/License-MIT-blue.svg
[Build-Status-Url]: http://travis-ci.com/nats-io/prometheus-nats-exporter
[Build-Status-Image]: https://travis-ci.com/nats-io/prometheus-nats-exporter.svg?token=bQqsBkZfycgqwrXTwekn&branch=master
[Build-Status-Url]: http://travis-ci.org/nats-io/prometheus-nats-exporter
[Build-Status-Image]: https://travis-ci.org/nats-io/prometheus-nats-exporter.svg?branch=master
[Coverage-Url]: https://coveralls.io/r/nats-io/prometheus-nats-exporter?branch=master
[Coverage-image]: https://coveralls.io/repos/github/nats-io/prometheus-nats-exporter/badge.svg?branch=master
44 changes: 44 additions & 0 deletions RELEASING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# The Prometheus NATS exporter release process

The Prometheus NATS exporter release process creates releases when a new Github tag is generated and pushed. It uses [goreleaser](https://goreleaser.com/) to to do this. To add plaforms, architectures, and assets, modify [.goreleaser.yaml](.goreleaser.yml).

## Steps to create a new release

### 1) Create and push a tag to the repository

**NEVER DUPLICATE AN EXISTING TAG!**

From your local repository, you'll want to be on *master* branch. Create a local tag and push:

```text
git tag -a vX.Y.Z
git push origin vX.Y.Z
```

e.g.

```text
$ git tag -a v0.0.1-test
$ git push origin v0.0.1-test
Counting objects: 1, done.
Writing objects: 100% (1/1), 173 bytes | 173.00 KiB/s, done.
Total 1 (delta 0), reused 0 (delta 0)
To github.com:nats-io/prometheus-nats-exporter
* [new tag] v0.0.1-test -> v0.0.1-test
```

This will trigger Travis-CI to start a build from the creation of the new tags. Goreleaser will create a draft release using the NATS continuous integration user. This can take awhile.

**NOTE:** If modifying the release process itself, you can test by pushing a tag from a branch. Use a tag like `v0.0.1-test` to do this. No need to test on master.

### 2) Edit the Release on Github

Check the the [releases](https://github.com/nats-io/prometheus-nats-exporter/releases) page, and you should see a draft release generated from your tag, along with compiled binaries. If the release and assets aren't present, check the Travis CI logs for errors. Edit the release notes and publish. You have a github release!

### 3) Edit docker files

Modify the docker files to pull down the latest release, and test them. After committing and merging, use the commit hash from the docker file updates in the docker library. This means the official docker files for a release will be at least one commit ahead, but that's OK; we have to test.

### 4) Update other distribution channels

Don't forget to update Homebrew, Chocolatey, etc if applicable.
2 changes: 1 addition & 1 deletion docker/linux/amd64/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Golang binary building stage
FROM golang:1.9.2
FROM golang:1.9.4

# download the source
WORKDIR /go/src/github.com/nats-io/prometheus-nats-exporter
Expand Down
2 changes: 1 addition & 1 deletion docker/linux/arm32v7/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Golang binary building stage
FROM golang:1.9.2
FROM golang:1.9.4

# download the source
WORKDIR /go/src/github.com/nats-io/prometheus-nats-exporter
Expand Down
2 changes: 1 addition & 1 deletion docker/linux/arm64v8/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Golang binary building stage
FROM golang:1.9.2
FROM golang:1.9.4

# download the source
WORKDIR /go/src/github.com/nats-io/prometheus-nats-exporter
Expand Down
2 changes: 1 addition & 1 deletion docker/windows/amd64/nanoserver/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Golang binary building stage
FROM golang:1.9.2
FROM golang:1.9.4

# download the source
WORKDIR /go/src/github.com/nats-io/prometheus-nats-exporter
Expand Down
2 changes: 1 addition & 1 deletion docker/windows/amd64/windowsservercore/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Golang binary building stage
FROM golang:1.9.2
FROM golang:1.9.4

# download the source
WORKDIR /go/src/github.com/nats-io/prometheus-nats-exporter
Expand Down
18 changes: 9 additions & 9 deletions scripts/cov.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
#!/bin/bash -e
# Run from directory above via ./scripts/cov.sh

rm -rf ./cov
mkdir cov
go test -v -covermode=atomic -coverprofile=./cov/collector.out ./collector
go test -v -covermode=atomic -coverprofile=./cov/exporter.out ./exporter
gocovmerge ./cov/*.out > acc.out
rm -rf ./cov
rm -rf /tmp/cov
mkdir -p /tmp/cov
go test -v -covermode=atomic -coverprofile=/tmp/cov/collector.out ./collector
go test -v -covermode=atomic -coverprofile=/tmp/cov/exporter.out ./exporter
gocovmerge /tmp/cov/*.out > /tmp/acc.out
rm -rf /tmp/cov

# If we have an arg, assume travis run and push to coveralls. Otherwise launch browser results
if [[ -n $1 ]]; then
$HOME/gopath/bin/goveralls -coverprofile=acc.out -service travis-ci
rm -rf ./acc.out
$HOME/gopath/bin/goveralls -coverprofile=/tmp/acc.out -service travis-ci
rm -rf /tmp/acc.out
else
go tool cover -html=acc.out
go tool cover -html=/tmp/acc.out
fi
30 changes: 0 additions & 30 deletions scripts/cross_compile.sh

This file was deleted.

0 comments on commit 6c11f0e

Please sign in to comment.