Skip to content

Commit

Permalink
Initial release of github status plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
gboddin committed May 17, 2018
0 parents commit b9c22ee
Show file tree
Hide file tree
Showing 15 changed files with 666 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!release/
159 changes: 159 additions & 0 deletions .drone.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
workspace:
base: /go
path: src/github.com/gboo/drone-github-status

pipeline:
deps:
image: golang:1.10
pull: true
commands:
- go get -u github.com/golang/dep/cmd/dep
- dep ensure
- dep status

build_linux_amd64:
image: golang:1.10
pull: true
group: build
environment:
- GOOS=linux
- GOARCH=amd64
- CGO_ENABLED=0
commands:
- |
if test "${DRONE_TAG}" = ""; then
go build -v -ldflags "-X main.build=${DRONE_BUILD_NUMBER}" -a -o release/linux/amd64/github-status
else
go build -v -ldflags "-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}" -a -o release/linux/amd64/github-status
fi
build_linux_i386:
image: golang:1.10
pull: true
group: build
environment:
- GOOS=linux
- GOARCH=386
- CGO_ENABLED=0
commands:
- |
if test "${DRONE_TAG}" = ""; then
go build -v -ldflags "-X main.build=${DRONE_BUILD_NUMBER}" -a -o release/linux/i386/github-status
else
go build -v -ldflags "-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}" -a -o release/linux/i386/github-status
fi
build_linux_arm64:
image: golang:1.10
pull: true
group: build
environment:
- GOOS=linux
- GOARCH=arm64
- CGO_ENABLED=0
commands:
- |
if test "${DRONE_TAG}" = ""; then
go build -v -ldflags "-X main.build=${DRONE_BUILD_NUMBER}" -a -o release/linux/arm64/github-status
else
go build -v -ldflags "-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}" -a -o release/linux/arm64/github-status
fi
build_linux_arm:
image: golang:1.10
pull: true
group: build
environment:
- GOOS=linux
- GOARCH=arm
- CGO_ENABLED=0
- GOARM=7
commands:
- |
if test "${DRONE_TAG}" = ""; then
go build -v -ldflags "-X main.build=${DRONE_BUILD_NUMBER}" -a -o release/linux/arm/github-status
else
go build -v -ldflags "-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}" -a -o release/linux/arm/github-status
fi
publish_linux_amd64:
image: plugins/docker:17.12
pull: true
secrets: [ docker_username, docker_password ]
group: docker
repo: gboo/github-status
auto_tag: true
auto_tag_suffix: linux-amd64
dockerfile: Dockerfile
when:
event: [ push, tag ]

publish_linux_i386:
image: plugins/docker:17.12
pull: true
secrets: [ docker_username, docker_password ]
group: docker
repo: gboo/github-status
auto_tag: true
auto_tag_suffix: linux-i386
dockerfile: Dockerfile.i386
when:
event: [ push, tag ]

publish_linux_arm64:
image: plugins/docker:17.12
pull: true
secrets: [ docker_username, docker_password ]
group: docker
repo: gboo/github-status
auto_tag: true
auto_tag_suffix: linux-arm64
dockerfile: Dockerfile.arm64
when:
event: [ push, tag ]

publish_linux_arm:
image: plugins/docker:17.12
pull: true
secrets: [ docker_username, docker_password ]
group: docker
repo: gboo/github-status
auto_tag: true
auto_tag_suffix: linux-arm
dockerfile: Dockerfile.arm
when:
event: [ push, tag ]

manifests:
image: plugins/manifest:1
pull: true
secrets: [ docker_username, docker_password ]
spec: manifest.tmpl
auto_tag: true
ignore_missing: true
when:
event: [ push, tag ]

github_build:
image: golang:1.10
commands:
- mkdir build
- mv release/linux/amd64/github-status build/github-status-linux-amd64
- mv release/linux/i386/github-status build/github-status-linux-386
- mv release/linux/arm/github-status build/github-status-linux-arm
- mv release/linux/arm64/github-status build/github-status-linux-arm
- GOOS=darwin GOARCH=amd64 go build -v -ldflags "-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}" -a -o build/github-status-macos-amd64
- GOOS=darwin GOARCH=386 go build -v -ldflags "-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}" -a -o build/github-status-macos-386
- GOOS=windows GOARCH=amd64 go build -v -ldflags "-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}" -a -o build/github-status-amd64.exe
- GOOS=windows GOARCH=386 go build -v -ldflags "-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}" -a -o build/github-status-386.exe
when:
event: tag

github_release:
image: plugins/github-release
secrets: [ github_token ]
files: build/**
checksum:
- sha256
when:
event: tag
31 changes: 31 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Compiled Object files, Static and Dynamic libs (Shared Objects)
*.o
*.a
*.so

# Folders
_obj
_test

# Architecture specific extensions/prefixes
*.[568vq]
[568vq].out

*.cgo1.go
*.cgo2.c
_cgo_defun.c
_cgo_gotypes.go
_cgo_export.*

_testmain.go

*.exe
*.test
*.prof

release/
vendor/

coverage.out
drone-github-status
.idea
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM plugins/base:multiarch

LABEL maintainer="Gregory Boddin" \
org.label-schema.name="Drone Github Status" \
org.label-schema.vendor="Gregory Boddin" \
org.label-schema.schema-version="1.0"

ADD release/linux/amd64/github-status /bin/
ENTRYPOINT ["/bin/github-status"]
9 changes: 9 additions & 0 deletions Dockerfile.arm
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM plugins/base:multiarch

LABEL maintainer="Gregory Boddin" \
org.label-schema.name="Drone Github Status" \
org.label-schema.vendor="Gregory Boddin" \
org.label-schema.schema-version="1.0"

ADD release/linux/amd64/github-status /bin/
ENTRYPOINT ["/bin/github-status"]
9 changes: 9 additions & 0 deletions Dockerfile.arm64
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM plugins/base:multiarch

LABEL maintainer="Gregory Boddin" \
org.label-schema.name="Drone Github Status" \
org.label-schema.vendor="Gregory Boddin" \
org.label-schema.schema-version="1.0"

ADD release/linux/amd64/github-status /bin/
ENTRYPOINT ["/bin/github-status"]
9 changes: 9 additions & 0 deletions Dockerfile.i386
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM plugins/base:multiarch

LABEL maintainer="Gregory Boddin" \
org.label-schema.name="Drone Github Status" \
org.label-schema.vendor="Gregory Boddin" \
org.label-schema.schema-version="1.0"

ADD release/linux/amd64/github-status /bin/
ENTRYPOINT ["/bin/github-status"]
12 changes: 12 additions & 0 deletions Dockerfile.windows
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# escape=`
FROM microsoft/nanoserver:10.0.14393.1593

LABEL maintainer="Gregory Boddin" \
org.label-schema.name="Drone Github Status" \
org.label-schema.vendor="Gregory Boddin" \
org.label-schema.schema-version="1.0"

SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]

ADD release\github-status.exe c:\github-status.exe
ENTRYPOINT [ "c:\\github-status.exe" ]
86 changes: 86 additions & 0 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions Gopkg.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[[constraint]]
name = "github.com/Sirupsen/logrus"
version = "1.0.5"

[[constraint]]
name = "github.com/urfave/cli"
version = "1.20.0"

[[constraint]]
branch = "master"
name = "github.com/google/go-github"

[prune]
go-tests = true
unused-packages = true
7 changes: 7 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Copyright 2018 Gregory Boddin

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Loading

0 comments on commit b9c22ee

Please sign in to comment.