Skip to content

Commit 8e67936

Browse files
committed
Setup goreleaser. Don't bother with dep in Makefile now that we're bundling dependencies in the repo.
1 parent 237d8b2 commit 8e67936

File tree

4 files changed

+24
-12
lines changed

4 files changed

+24
-12
lines changed

Diff for: .goreleaser.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@ nfpm:
3333
preremove: "packaging/scripts/preremove.sh"
3434
release:
3535
draft: false
36-
prerelease: false
36+
prerelease: true

Diff for: Dockerfile

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# Start from a Debian image with the latest version of Go installed
22
# and a workspace (GOPATH) configured at /go.
33
FROM golang:1.10 AS build
4-
RUN curl -L -s https://github.com/golang/dep/releases/download/v0.5.0/dep-linux-amd64 -o $GOPATH/bin/dep
5-
RUN chmod +x $GOPATH/bin/dep
4+
#RUN curl -L -s https://github.com/golang/dep/releases/download/v0.5.0/dep-linux-amd64 -o $GOPATH/bin/dep
5+
#RUN chmod +x $GOPATH/bin/dep
66
WORKDIR /go/src/github.com/ncabatoff/process-exporter
77
ADD . .
8-
RUN dep ensure
8+
#RUN dep ensure
99

1010
# Build the process-exporter command inside the container.
1111
RUN make

Diff for: cloudbuild.release.yaml

+18-6
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ steps:
1313
env: ['PROJECT_ROOT=github.com/ncabatoff/process-exporter']
1414
args: ['env']
1515

16+
# Build project
1617
- name: gcr.io/cloud-builders/docker
1718
args:
1819
- build
@@ -21,20 +22,31 @@ steps:
2122
- --tag=ncabatoff/process-exporter:$TAG_NAME
2223
- .
2324

25+
# Login to docker hub
2426
- name: gcr.io/cloud-builders/docker
2527
entrypoint: 'bash'
2628
args: ['-c', 'docker login --username=ncabatoff --password=$$DOCKER_PASSWORD']
2729
secretEnv: ['DOCKER_PASSWORD']
2830

29-
# - name: goreleaser/goreleaser
30-
# entrypoint: /bin/sh
31-
# dir: gopath/src/github.com
32-
# env: ['GOPATH=/workspace/gopath']
33-
# args: ['-c', 'cd ncabatoff/process-exporter && /goreleaser' ]
31+
# Push to docker hub
32+
# - name: gcr.io/cloud-builders/docker
33+
# args: ['push', 'ncabatoff/process-exporter:$TAG_NAME']
34+
35+
# Create github release
36+
- name: goreleaser/goreleaser
37+
entrypoint: /bin/sh
38+
dir: gopath/src/github.com
39+
env: ['GOPATH=/workspace/gopath']
40+
args: ['-c', 'cd ncabatoff/process-exporter && /goreleaser' ]
41+
secretEnv: ['GITHUB_TOKEN']
3442

3543
secrets:
3644
- kmsKeyName: projects/process-exporter/locations/global/keyRings/cloudbuild/cryptoKeys/mykey
3745
secretEnv:
3846
DOCKER_PASSWORD: |
3947
CiQAeHUuEinm1h2j9mp8r0NjPw1l1bBwzDG+JHPUPf3GvtmdjXESMAD3wUauaxWrxid/zPunG67x
40-
5+1CYedV5exh0XwQ32eu4UkniS7HHJNWBudklaG0JA==
48+
5+1CYedV5exh0XwQ32eu4UkniS7HHJNWBudklaG0JA==
49+
GITHUB_TOKEN: |
50+
CiQAeHUuEhEKAvfIHlUZrCgHNScm0mDKI8Z1w/N3OzDk8Ql6kAUSUQD3wUau7qRc+H7OnTUo6b2Z
51+
DKA1eMKHNg729KfHj2ZMqZXinrJloYMbZcZRXP9xv91xCq6QJB5UoFoyYDnXGdvgXC08YUstR6UB
52+
H0bwHhe1GQ==

Diff for: cloudbuild.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ steps:
2525
entrypoint: /bin/sh
2626
dir: gopath/src/github.com
2727
env: ['GOPATH=/workspace/gopath']
28-
args: ['-c', 'cd ncabatoff/process-exporter && make style vet test build integ install' ]
29-
- name: 'gcr.io/cloud-builders/docker'
28+
args: ['-c', 'make -C ncabatoff/process-exporter style vet test build integ install' ]
29+
- name: gcr.io/cloud-builders/docker
3030
args: ['build', '--tag=gcr.io/$PROJECT_ID/process-exporter', '.', '-f', 'Dockerfile.cloudbuild']
3131
images: ['gcr.io/$PROJECT_ID/process-exporter']
3232

0 commit comments

Comments
 (0)