Move all to github actions

This commit is contained in:
Marc Campbell
2020-03-23 09:23:22 -07:00
parent 374856798f
commit 818f8b26dd
5 changed files with 83 additions and 234 deletions

View File

@@ -1,47 +0,0 @@
steps:
- label: build
command: "make"
plugins:
- docker#v3.2.0:
image: replicated/gitops-builder:buildkite-go12
always-pull: true
mount-checkout: true
workdir: /go/src/github.com/replicatedhq/troubleshoot
environment:
- SCOPE_DSN
- BUILDKITE_REPO
- BUILDKITE_COMMIT
- BUILDKITE_BUILD_ID
- BUILDKITE_BUILD_NUMBER
- BUILDKITE_BUILD_URL
- BUILDKITE_BUILD_CHECKOUT_PATH
- BUILDKITE
- wait
- commands:
- make snapshot-release
branches: "master"
plugins:
- docker#v3.2.0:
image: replicated/gitops-builder:buildkite-go12
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
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"
environment:
- GITHUB_TOKEN_TROUBLESHOOT

View File

@@ -0,0 +1,83 @@
on:
pull_request:
branches:
- master
push:
branches:
- "master"
tags:
- "v*.*.*"
jobs:
build:
runs-on: ubuntu-18.04
steps:
- uses: actions/setup-go@v1
with:
go-version: "1.12.14"
- name: setup env
run: |
echo "::set-env name=GOPATH::$(go env GOPATH)"
echo "::add-path::$(go env GOPATH)/bin"
shell: bash
- uses: actions/checkout@v2
- run: make
compile-preflight:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/setup-go@v1
with:
go-version: '1.12.14'
- name: setup env
run: |
echo "::set-env name=GOPATH::$(go env GOPATH)"
echo "::add-path::$(go env GOPATH)/bin"
shell: bash
- uses: actions/checkout@master
- run: make preflight
- uses: actions/upload-artifact@v1
with:
name: preflight
path: bin/preflight
validate-preflight:
runs-on: ubuntu-latest
needs: compile-preflight
steps:
- name: Download preflight binary
uses: actions/download-artifact@v1
with:
name: preflight
path: bin/
- uses: engineerd/setup-kind@v0.2.0
- run: chmod +x bin/preflight
- run: bin/preflight --interactive=false --format=json https://preflight.replicated.com
goreleaser:
runs-on: ubuntu-latest
needs:
- validate-preflight
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Unshallow
run: git fetch --prune --unshallow
- uses: actions/setup-go@v1
with:
go-version: "1.12.14"
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v1
with:
version: latest
args: release --rm-dist --config deploy/.goreleaser.yaml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -1,35 +0,0 @@
name: "Run preflights on a cluster"
on: [push]
jobs:
compile-preflight:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v1
with:
go-version: '1.12.14'
- name: setup env
run: |
echo "::set-env name=GOPATH::$(go env GOPATH)"
echo "::add-path::$(go env GOPATH)/bin"
shell: bash
- uses: actions/checkout@master
- run: make preflight
- uses: actions/upload-artifact@v1
with:
name: preflight
path: bin/preflight
run-preflights:
runs-on: ubuntu-latest
needs: compile-preflight
steps:
- name: Download preflight binary
uses: actions/download-artifact@v1
with:
name: preflight
path: bin/
- uses: engineerd/setup-kind@v0.2.0
- run: chmod +x bin/preflight
- run: bin/preflight --interactive=false --format=json https://preflight.replicated.com

View File

@@ -1,66 +0,0 @@
project_name: troubleshoot
release:
github:
owner: replicatedhq
name: troubleshoot
builds:
- 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: support-bundle
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: support-bundle
hooks: {}
archives:
- id: tar
format: tar.gz
name_template: '{{ .Binary }}_{{ .Os }}_{{ .Arch }}-alpha'
files:
- licence*
- LICENCE*
- license*
- LICENSE*
- readme*
- README*
- changelog*
- CHANGELOG*
dockers:
- dockerfile: ./deploy/Dockerfile.troubleshoot
image_templates:
- "replicated/troubleshoot:alpha"
binaries:
- support-bundle
- preflight
- dockerfile: ./deploy/Dockerfile.troubleshoot
image_templates:
- "replicated/preflight:alpha"
binaries:
- support-bundle
- preflight
snapshot:
name_template: SNAPSHOT-{{ .Commit }}

View File

@@ -1,86 +0,0 @@
project_name: troubleshoot
release:
github:
owner: replicatedhq
name: troubleshoot
builds:
- id: so
goos:
- linux
goarch:
- amd64
env:
- CGO_ENABLED=1
- GO111MODULE=on
main: ffi/main.go
flags: -buildmode=c-shared
binary: troubleshoot.so
hooks: {}
- id: preflight
goos:
- linux
- windows
- darwin
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: support-bundle
goos:
- linux
- windows
- darwin
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: support-bundle
hooks: {}
archives:
- id: so
builds:
- so
format: tar.gz
- id: tar
format: tar.gz
name_template: '{{ .Binary }}_{{ .Os }}_{{ .Arch }}-alpha'
files:
- licence*
- LICENCE*
- license*
- LICENSE*
- readme*
- README*
- changelog*
- CHANGELOG*
dockers:
- dockerfile: ./deploy/Dockerfile.troubleshoot
image_templates:
- "replicated/troubleshoot:alpha"
binaries:
- support-bundle
- preflight
- dockerfile: ./deploy/Dockerfile.troubleshoot
image_templates:
- "replicated/preflight:alpha"
binaries:
- support-bundle
- preflight
snapshot:
name_template: SNAPSHOT-{{ .Commit }}