-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rework: remplace promu by goreleaser, replace travis by github actions
- Loading branch information
1 parent
5df5379
commit 3431224
Showing
10 changed files
with
179 additions
and
144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# To get started with Dependabot version updates, you'll need to specify which | ||
# package ecosystems to update and where the package manifests are located. | ||
# Please see the documentation for all configuration options: | ||
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: "gomod" # See documentation for possible values | ||
directory: "/" # Location of package manifests | ||
schedule: | ||
interval: "daily" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
name: goreleaser | ||
|
||
on: | ||
push: | ||
# not not consider simplec commit | ||
branches: | ||
- '!*' | ||
# consider only release and pre-release tags | ||
tags: | ||
- 'v[0-9]+.[0-9]+.[0-9]+' | ||
- 'v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: set up go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.18 | ||
|
||
- name: cache go modules | ||
uses: actions/cache@v1 | ||
with: | ||
path: ~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- name: tests modules | ||
run: | | ||
go mod vendor | ||
if [ ! -z "$(git status --porcelain)" ]; then | ||
echo "::error::vendor directory if not synched with go.mod, please run go mod vendor" | ||
exit 1 | ||
fi | ||
go mod tidy | ||
if [ ! -z "$(git status --porcelain)" ]; then | ||
echo "::error::modules are not tidy, please run go mod tidy" | ||
exit 1 | ||
fi | ||
- name: tests | ||
run: | | ||
go test -v ./... | ||
- name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: run goreleaser | ||
uses: goreleaser/goreleaser-action@v2 | ||
if: success() && startsWith(github.ref, 'refs/tags/') | ||
with: | ||
version: latest | ||
args: release --rm-dist | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
USER: github-actions | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
/.build | ||
/.release | ||
/.tarballs | ||
/dist | ||
/cf_exporter | ||
*.tar.gz | ||
*.test | ||
*-stamp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
project_name: cf_exporter | ||
|
||
builds: | ||
- id: binary | ||
dir: . | ||
main: ./main.go | ||
binary: cf_exporter | ||
env: | ||
- CGO_ENABLED=0 | ||
ldflags: | ||
- -s | ||
- -w | ||
- -X github.com/prometheus/common/version.Version={{.Version}} | ||
- -X github.com/prometheus/common/version.Revision={{.FullCommit}} | ||
- -X github.com/prometheus/common/version.Branch={{.Branch}} | ||
- -X github.com/prometheus/common/version.BuildUser={{.Env.USER}} | ||
- -X github.com/prometheus/common/version.BuildDate={{.Date}} | ||
- -X code.cloudfoundry.org/cli/version/binaryVersion={{.Version}} | ||
goos: | ||
- linux | ||
- darwin | ||
- windows | ||
goarch: | ||
- amd64 | ||
- 386 | ||
- arm | ||
- arm64 | ||
- ppc64 | ||
- ppc64le | ||
goarm: [5,6,7] | ||
ignore: | ||
- goos: darwin | ||
goarch: arm | ||
- goos: darwin | ||
goarch: arm64 | ||
- goos: darwin | ||
goarch: ppc64 | ||
- goos: darwin | ||
goarch: ppc64le | ||
- goos: darwin | ||
goarch: 386 | ||
- goos: windows | ||
goarch: arm | ||
- goos: windows | ||
goarch: arm64 | ||
- goos: windows | ||
goarch: ppc64 | ||
- goos: windows | ||
goarch: ppc64le | ||
|
||
archives: | ||
- id: archives | ||
builds: [binary] | ||
format: "tar.gz" | ||
name_template: '{{ .ProjectName }}_{{ .Version }}.{{ .Os }}-{{ .Arch }}{{ with .Arm }}v{{ . }}{{ end }}' | ||
wrap_in_directory: true | ||
files: | ||
- LICENSE | ||
- NOTICE | ||
- README* | ||
- CHANGELOG* | ||
- docs/* | ||
format_overrides: | ||
- goos: windows | ||
format: zip | ||
|
||
changelog: | ||
sort: asc | ||
use: github | ||
filters: | ||
exclude: | ||
- 'docs' | ||
- '\.md' | ||
|
||
checksum: | ||
name_template: checksums.txt | ||
algorithm: sha256 | ||
|
||
dockers: | ||
- goos: linux | ||
goarch: amd64 | ||
dockerfile: ./packages/docker/Dockerfile | ||
image_templates: | ||
- "boshprometheus/cf-exporter:latest" | ||
- "boshprometheus/cf-exporter:{{ .Tag }}" | ||
- "boshprometheus/cf-exporter:v{{ .Major }}" | ||
- "boshprometheus/cf-exporter:v{{ .Major }}.{{ .Minor }}" | ||
build_flag_templates: | ||
- "--label=org.opencontainers.image.created={{ .Date }}" | ||
- "--label=org.opencontainers.image.title={{ .ProjectName }}" | ||
- "--label=org.opencontainers.image.revision={{ .FullCommit }}" | ||
- "--label=org.opencontainers.image.version={{ .Version }}" | ||
- "--label=org.opencontainers.image.source={{ .GitURL }}" | ||
|
||
release: | ||
prerelease: auto | ||
name_template: '{{.Tag}}' |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
FROM quay.io/prometheus/busybox:latest | ||
MAINTAINER Ferran Rodenas <frodenas@gmail.com> | ||
|
||
COPY cf_exporter /bin/cf_exporter | ||
ADD cf_exporter /bin/cf_exporter | ||
|
||
ENTRYPOINT ["/bin/cf_exporter"] | ||
EXPOSE 9193 | ||
EXPOSE 9193 |