Skip to content

Commit

Permalink
release
Browse files Browse the repository at this point in the history
  • Loading branch information
marccampbell committed Jul 18, 2019
1 parent 3649058 commit fd05585
Show file tree
Hide file tree
Showing 3 changed files with 151 additions and 1 deletion.
39 changes: 39 additions & 0 deletions .buildkite/pipeline.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
steps:
- label: build
commands:
- make
plugins:
- docker#v3.2.0:
image: replicated/gitops-builder:buildkite-go12-node10
always-pull: true
mount-checkout: true
workdir: /go/src/github.com/replicatedhq/troubleshoot

- wait

- commands:
- make snapshot-release
branches: "master"
plugins:
- docker#v3.2.0:
image: replicated/gitops-builder:buildkite-go12-node10
always-pull: true
mount-checkout: true
workdir: /go/src/github.com/replicatedhq/troubleshoot
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
- "/var/lib/buildkite-agent/.docker/config.json:/home/builder/.docker/config.json"

- label: release
commands:
- if [ -z "$BUILDKITE_TAG" ]; then echo "Not a tag, not releasing"; else git tag -f "$BUILDKITE_TAG" && make release; fi
plugins:
- docker#v3.2.0:
always-pull: true
image: replicated/gitops-builder:buildkite-go12-node10
workdir: /go/src/github.com/replicatedhq/troubleshoot
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
environment:
- "GITHUB_TOKEN"
- "/var/lib/buildkite-agent/.docker/config.json:/home/builder/.docker/config.json"
10 changes: 9 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,17 @@ endif
.PHONY: snapshot-release
snapshot-release:
curl -sL https://git.io/goreleaser | bash -s -- --rm-dist --snapshot --config deploy/.goreleaser.snapshot.yml
docker push replicated/troubleshoot:alpha
docker push replicated/preflight:alpha
docker push replicated/troubleshoot-manager:alpha

.PHONY: release
release:
curl -sL https://git.io/goreleaser | bash -s -- --rm-dist --config deploy/.goreleaser.yml

.PHONY: local-release
local-release: snapshot-release
local-release:
curl -sL https://git.io/goreleaser | bash -s -- --rm-dist --snapshot --config deploy/.goreleaser.snapshot.yml
docker tag replicated/troubleshoot:alpha localhost:32000/troubleshoot:alpha
docker tag replicated/preflight:alpha localhost:32000/preflight:alpha
docker tag replicated/troubleshoot-manager:alpha localhost:32000/troubleshoot-manager:alpha
Expand Down
103 changes: 103 additions & 0 deletions deploy/.goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
project_name: troubleshoot
release:
github:
owner: replicatedhq
name: troubleshoot
builds:
- id: collector
goos:
- linux
goarch:
- amd64
env:
- CGO_ENABLED=0
main: cmd/collector/main.go
ldflags: -s -w
-X github.com/replicatedhq/troubleshoot/pkg/version.version={{.Version}}
-X github.com/replicatedhq/troubleshoot/pkg/version.gitSHA={{.Commit}}
-X github.com/replicatedhq/troubleshoot/pkg/version.buildTime={{.Date}}
-extldflags "-static"
flags: -tags netgo -installsuffix netgo
binary: collector
hooks: {}
- id: preflight
goos:
- linux
goarch:
- amd64
env:
- CGO_ENABLED=0
main: cmd/preflight/main.go
ldflags: -s -w
-X github.com/replicatedhq/troubleshoot/pkg/version.version={{.Version}}
-X github.com/replicatedhq/troubleshoot/pkg/version.gitSHA={{.Commit}}
-X github.com/replicatedhq/troubleshoot/pkg/version.buildTime={{.Date}}
-extldflags "-static"
flags: -tags netgo -installsuffix netgo
binary: preflight
hooks: {}
- id: troubleshoot
goos:
- linux
goarch:
- amd64
env:
- CGO_ENABLED=0
main: cmd/troubleshoot/main.go
ldflags: -s -w
-X github.com/replicatedhq/troubleshoot/pkg/version.version={{.Version}}
-X github.com/replicatedhq/troubleshoot/pkg/version.gitSHA={{.Commit}}
-X github.com/replicatedhq/troubleshoot/pkg/version.buildTime={{.Date}}
-extldflags "-static"
flags: -tags netgo -installsuffix netgo
binary: troubleshoot
hooks: {}
- id: manager
goos:
- linux
goarch:
- amd64
env:
- CGO_ENABLED=0
main: cmd/manager/main.go
ldflags: -s -w
-X github.com/replicatedhq/troubleshoot/pkg/version.version={{.Version}}
-X github.com/replicatedhq/troubleshoot/pkg/version.gitSHA={{.Commit}}
-X github.com/replicatedhq/troubleshoot/pkg/version.buildTime={{.Date}}
-extldflags "-static"
flags: -tags netgo -installsuffix netgo
binary: manager
hooks: {}
archives:
- id: tar
format: tar.gz
name_template: '{{ .Binary }}_{{.Version}}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{.Arm }}{{ end }}-alpha'
files:
- licence*
- LICENCE*
- license*
- LICENSE*
- readme*
- README*
- changelog*
- CHANGELOG*
dockers:
- dockerfile: ./deploy/Dockerfile.troubleshoot
image_templates:
- "replicated/troubleshoot:alpha"
binaries:
- collector
- troubleshoot
- preflight
- dockerfile: ./deploy/Dockerfile.troubleshoot
image_templates:
- "replicated/preflight:alpha"
binaries:
- collector
- troubleshoot
- preflight
- dockerfile: ./deploy/Dockerfile.manager
image_templates:
- "replicated/troubleshoot-manager:alpha"
binaries:
- manager

0 comments on commit fd05585

Please sign in to comment.