Skip to content

Commit

Permalink
Merge branch 'master' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
Audrius Karabanovas authored Oct 3, 2019
2 parents 0327e67 + 4f914ef commit 6cb9b4e
Show file tree
Hide file tree
Showing 15 changed files with 290 additions and 268 deletions.
9 changes: 0 additions & 9 deletions .github/main.workflow

This file was deleted.

53 changes: 53 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
on: push
name: test-and-build
jobs:
build:
runs-on: ubuntu-latest
steps:

- name: Set up Go 1.13
uses: actions/setup-go@v1
with:
go-version: 1.13
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v1

- name: Get dependencies
run: |
go mod download
- name: Run unit-tests
run: |
GO111MODULE=on CGO_ENABLED=0 go test ./...
- name: Build executables
run: |
./build.sh
- name: Upload artifact
uses: actions/[email protected]
with:
name: binaries
path: .build

dockerimage:
runs-on: ubuntu-latest
needs: build
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v1
with:
fetch-depth: 1

- name: Download artifact
uses: actions/[email protected]
with:
name: binaries
path: .build

- name: Build docker image
run: |
docker build . -t trustpilot/beat-exporter
79 changes: 79 additions & 0 deletions .github/workflows/release-published.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
on:
release:
types: [published]
name: handle-release
jobs:
artifacts:
name: Create and upload release artifacts
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.13
uses: actions/setup-go@v1
with:
go-version: 1.13
id: go

- name: Check out code at release tag
uses: actions/checkout@v1
with:
ref: ${{ github.ref }}
fetch-depth: 1

- name: Get dependencies
run: |
go mod download
- name: Build executables
run: |
./build.sh
- name: Create artifact archives
run: |
./create-artifacts.sh
- name: Upload artifacts archives
uses: skx/github-action-publish-binaries@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
args: './.release/beat-exporter-*'

docker:
name: Publish docker images
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.13
uses: actions/setup-go@v1
with:
go-version: 1.13
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v1
with:
ref: ${{ github.ref }}
fetch-depth: 1

- name: Get dependencies
run: |
go mod download
- name: Build executables
run: |
./build.sh
- name: Build and push docker image with version tags
uses: jerray/[email protected]
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: trustpilot/beat-exporter
auto_tag: true

- name: Build and push docker image with latest tag
uses: jerray/[email protected]
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: trustpilot/beat-exporter
tags: latest
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
vendor
.build
.tarballs
.release
.vscode
.DS_Store
beat-exporter
beat-exporter.exe
23 changes: 0 additions & 23 deletions .promu.yml

This file was deleted.

20 changes: 0 additions & 20 deletions .travis.yml

This file was deleted.

13 changes: 3 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
FROM quay.io/prometheus/golang-builder as builder
FROM quay.io/prometheus/busybox:latest
LABEL MAINTAINER="Audrius Karabanovas <[email protected]>"

ADD . /go/src/github.com/trustpilot/beat-exporter
WORKDIR /go/src/github.com/trustpilot/beat-exporter

RUN make

FROM quay.io/prometheus/busybox:latest
MAINTAINER Audrius Karabanovas <[email protected]>

COPY --from=builder /go/src/github.com/trustpilot/beat-exporter/beat-exporter /bin/beat-exporter
COPY .build/linux-amd64/beat-exporter /bin/beat-exporter

EXPOSE 9479
ENTRYPOINT [ "/bin/beat-exporter" ]
111 changes: 0 additions & 111 deletions Gopkg.lock

This file was deleted.

15 changes: 0 additions & 15 deletions Gopkg.toml

This file was deleted.

Loading

0 comments on commit 6cb9b4e

Please sign in to comment.