Updates per comments
move .drone.sh to .drone.yml Fix Dockerfiles to match S3-cache Add badges to readme Couple minor updates to fix variable name and extra space
This commit is contained in:
parent
a21b227426
commit
17fe62356c
|
@ -1,9 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
set -x
|
||||
|
||||
# compile the main binary
|
||||
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags "-X main.build=${DRONE_BUILD_NUMBER}" -a -tags netgo -o release/linux/amd64/drone-webhook
|
||||
GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go build -ldflags "-X main.build=${DRONE_BUILD_NUMBER}" -a -tags netgo -o release/linux/arm64/drone-webhook
|
||||
GOOS=linux GOARCH=arm CGO_ENABLED=0 GOARM=7 go build -ldflags "-X main.build=${DRONE_BUILD_NUMBER}" -a -tags netgo -o release/linux/arm/drone-webhook
|
28
.drone.yml
28
.drone.yml
|
@ -11,8 +11,34 @@ pipeline:
|
|||
|
||||
build_linux_amd64:
|
||||
image: golang:1.9
|
||||
group: build
|
||||
environment:
|
||||
- GOOS=linux
|
||||
- GOARCH=amd64
|
||||
- CGO_ENABLED=0
|
||||
commands:
|
||||
- sh .drone.sh
|
||||
- go build -v -ldflags "-X main.build=${DRONE_BUILD_NUMBER}" -a -o release/linux/amd64/drone-webhook
|
||||
|
||||
build_linux_arm64:
|
||||
image: golang:1.9
|
||||
group: build
|
||||
environment:
|
||||
- GOOS=linux
|
||||
- GOARCH=arm64
|
||||
- CGO_ENABLED=0
|
||||
commands:
|
||||
- go build -v -ldflags "-X main.build=${DRONE_BUILD_NUMBER}" -a -o release/linux/arm64/drone-webhook
|
||||
|
||||
build_linux_arm:
|
||||
image: golang:1.9
|
||||
group: build
|
||||
environment:
|
||||
- GOOS=linux
|
||||
- GOARCH=arm
|
||||
- CGO_ENABLED=0
|
||||
- GOARM=7
|
||||
commands:
|
||||
- go build -v -ldflags "-X main.build=${DRONE_BUILD_NUMBER}" -a -o release/linux/arm/drone-webhook
|
||||
|
||||
publish_linux_amd64:
|
||||
image: plugins/docker
|
||||
|
|
|
@ -22,7 +22,6 @@ _testmain.go
|
|||
*.exe
|
||||
*.test
|
||||
*.prof
|
||||
.idea/
|
||||
release/
|
||||
coverage.out
|
||||
drone-webhook
|
||||
|
|
18
Dockerfile
18
Dockerfile
|
@ -1,10 +1,18 @@
|
|||
FROM alpine:3.3
|
||||
FROM alpine:3.6 as alpine
|
||||
RUN apk add -U --no-cache ca-certificates
|
||||
|
||||
FROM scratch
|
||||
MAINTAINER Drone.IO Community <drone-dev@googlegroups.com>
|
||||
|
||||
RUN apk update && \
|
||||
apk add \
|
||||
ca-certificates && \
|
||||
rm -rf /var/cache/apk/*
|
||||
ENV GODEBUG=netdns=go
|
||||
|
||||
COPY --from=alpine /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
||||
|
||||
LABEL org.label-schema.version=latest
|
||||
LABEL org.label-schema.vcs-url="https://github.com/drone-plugins/drone-webhook.git"
|
||||
LABEL org.label-schema.name="Drone S3 Webhook"
|
||||
LABEL org.label-schema.vendor="Drone.IO Community"
|
||||
|
||||
|
||||
ADD release/linux/amd64/drone-webhook /bin/
|
||||
ENTRYPOINT ["/bin/drone-webhook"]
|
||||
|
|
|
@ -1,10 +1,18 @@
|
|||
FROM alpine:3.3
|
||||
FROM alpine:3.6 as alpine
|
||||
RUN apk add -U --no-cache ca-certificates
|
||||
|
||||
FROM scratch
|
||||
MAINTAINER Drone.IO Community <drone-dev@googlegroups.com>
|
||||
|
||||
RUN apk update && \
|
||||
apk add \
|
||||
ca-certificates && \
|
||||
rm -rf /var/cache/apk/*
|
||||
ENV GODEBUG=netdns=go
|
||||
|
||||
COPY --from=alpine /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
||||
|
||||
LABEL org.label-schema.version=latest
|
||||
LABEL org.label-schema.vcs-url="https://github.com/drone-plugins/drone-webhook.git"
|
||||
LABEL org.label-schema.name="Drone Webhook"
|
||||
LABEL org.label-schema.vendor="Drone.IO Community"
|
||||
LABEL org.label-schema.schema-version="1.0"
|
||||
|
||||
ADD release/linux/arm/drone-webhook /bin/
|
||||
ENTRYPOINT ["/bin/drone-webhook"]
|
|
@ -1,10 +1,20 @@
|
|||
FROM alpine:3.3
|
||||
|
||||
FROM alpine:3.6 as alpine
|
||||
RUN apk add -U --no-cache ca-certificates mailcap
|
||||
|
||||
FROM scratch
|
||||
MAINTAINER Drone.IO Community <drone-dev@googlegroups.com>
|
||||
|
||||
RUN apk update && \
|
||||
apk add \
|
||||
ca-certificates && \
|
||||
rm -rf /var/cache/apk/*
|
||||
ENV GODEBUG=netdns=go
|
||||
|
||||
COPY --from=alpine /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
||||
COPY --from=alpine /etc/mime.types /etc/
|
||||
|
||||
LABEL org.label-schema.version=latest
|
||||
LABEL org.label-schema.vcs-url="https://github.com/drone-plugins/drone-webhook.git"
|
||||
LABEL org.label-schema.name="Drone Webhook"
|
||||
LABEL org.label-schema.vendor="Drone.IO Community"
|
||||
LABEL org.label-schema.schema-version="1.0"
|
||||
|
||||
ADD release/linux/arm64/drone-webhook /bin/
|
||||
ENTRYPOINT ["/bin/drone-webhook"]
|
|
@ -1,6 +1,10 @@
|
|||
# drone-webhook
|
||||
|
||||
[![Build Status](http://beta.drone.io/api/badges/drone-plugins/drone-webhook/status.svg)](http://beta.drone.io/drone-plugins/drone-webhook)
|
||||
[![Join the chat at https://gitter.im/drone/drone](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/drone/drone)
|
||||
[![Go Doc](https://godoc.org/github.com/drone-plugins/drone-webhook?status.svg)](http://godoc.org/github.com/drone-plugins/drone-webhook)
|
||||
[![Go Report](https://goreportcard.com/badge/github.com/drone-plugins/drone-webhook)](https://goreportcard.com/report/github.com/drone-plugins/drone-webhook)
|
||||
[![](https://images.microbadger.com/badges/image/plugins/webhook.svg)](https://microbadger.com/images/plugins/webhook "Get your own image badge on microbadger.com")
|
||||
|
||||
Drone plugin to send build status notifications via Webhook. For the usage information and a listing of the available options please take a look at [the docs](DOCS.md).
|
||||
|
||||
|
|
10
main.go
10
main.go
|
@ -11,14 +11,14 @@ const (
|
|||
respFormat = "Webhook %d\n URL: %s\n RESPONSE STATUS: %s\n RESPONSE BODY: %s\n"
|
||||
debugRespFormat = "Webhook %d\n URL: %s\n METHOD: %s\n HEADERS: %s\n REQUEST BODY: %s\n RESPONSE STATUS: %s\n RESPONSE BODY: %s\n"
|
||||
)
|
||||
var version string
|
||||
var build string
|
||||
|
||||
func main() {
|
||||
app := cli.NewApp()
|
||||
app.Name = "rancher publish"
|
||||
app.Usage = "rancher publish"
|
||||
app.Action = run
|
||||
app.Version = version
|
||||
app.Version = fmt.Sprintf("1.0.0+%s", build)
|
||||
app.Flags = []cli.Flag{
|
||||
cli.StringFlag{
|
||||
Name: "method",
|
||||
|
@ -29,12 +29,12 @@ func main() {
|
|||
cli.StringFlag{
|
||||
Name: "username",
|
||||
Usage: "Username for basic auth",
|
||||
EnvVar: "PLUGIN_USERNAME, WEBHOOK_USERNAME",
|
||||
EnvVar: "PLUGIN_USERNAME,WEBHOOK_USERNAME",
|
||||
},
|
||||
cli.StringFlag{
|
||||
Name: "password",
|
||||
Usage: "Password for basic auth",
|
||||
EnvVar: "PLUGIN_PASSWORD, WEBHOOK_PASSWORD",
|
||||
EnvVar: "PLUGIN_PASSWORD,WEBHOOK_PASSWORD",
|
||||
},
|
||||
cli.StringFlag{
|
||||
Name: "content-type",
|
||||
|
@ -157,7 +157,7 @@ func main() {
|
|||
}
|
||||
|
||||
func run(c *cli.Context) error {
|
||||
fmt.Printf("Drone Webhook Plugin built from %s\n", version)
|
||||
fmt.Printf("Drone Webhook Plugin built from %s\n", build)
|
||||
|
||||
plugin := Plugin{
|
||||
Repo: Repo{
|
||||
|
|
Loading…
Reference in New Issue