Finish repository migration

This commit is contained in:
Michael de Wit
2017-01-16 15:06:10 +01:00
parent f128c947ab
commit 6917c02a54
8 changed files with 58 additions and 53 deletions
-30
View File
@@ -1,30 +0,0 @@
workspace:
base: /go
path: src/github.com/drone-plugins/drone-email
pipeline:
test:
image: golang:1.6
environment:
- CGO_ENABLED=0
- GOPATH=/go
commands:
- go vet
- go test -cover -coverprofile=coverage.out
- go build -ldflags "-s -w -X main.build=$DRONE_BUILD_NUMBER" -a -tags netgo
latest:
image: plugins/docker
repo: plugins/email
tags: [ "latest", "1.0", "1" ]
when:
branch: master
event: push
plugin:
name: Email
desc: Send build status notifications via Email
type: notify
image: plugins/drone-email
labels:
- email
+8 -8
View File
@@ -21,7 +21,7 @@ The following is a sample configuration in your .drone.yml file:
```yaml
pipeline:
notify:
image: plugins/email
image: drillster/drone-email
from: noreply@github.com
host: smtp.mailgun.org
username: octocat
@@ -36,7 +36,7 @@ The Email plugin supports reading credentials and other parameters from the Dron
```diff
pipeline:
notify:
image: plugins/email
image: drillster/drone-email
from: noreply@github.com
host: smtp.mailgun.org
- username: octocat
@@ -48,9 +48,9 @@ pipeline:
Use the command line utility to add the secrets to the store:
```sh
drone secret add --image=plugins/email \
drone secret add --image=drillster/drone-email \
octocat/hello-world EMAIL_USERNAME octocat
drone secret add --image=plugins/email \
drone secret add --image=drillster/drone-email \
octocat/hello-world EMAIL_PASSWORD 12345
```
@@ -78,17 +78,17 @@ provided as a string or as a remote URL which gets fetched and parsed:
* **subject** - A handlebars template to create a custom subject. For more
details take a look at the [docs](http://handlebarsjs.com/). You can see the
default template [here](https://github.com/drone-plugins/drone-email/blob/master/defaults.go#L14)
default template [here](https://github.com/Drillster/drone-email/blob/master/defaults.go#L14)
* **body** - A handlebars template to create a custom template. For more
details take a look at the [docs](http://handlebarsjs.com/). You can see the
default template [here](https://github.com/drone-plugins/drone-email/blob/master/defaults.go#L19-L267)
default template [here](https://github.com/Drillster/drone-email/blob/master/defaults.go#L19-L267)
Example configuration that generate a custom email:
```yaml
pipeline:
notify:
image: plugins/email
image: drillster/drone-email
from: noreply@github.com
host: smtp.mailgun.org
username: octocat
@@ -115,7 +115,7 @@ Example configuration that skips SSL verification:
```yaml
pipeline:
notify:
image: plugins/email
image: drillster/drone-email
from: noreply@github.com
host: smtp.mailgun.org
username: octocat
+1 -2
View File
@@ -1,7 +1,6 @@
FROM alpine:3.4
RUN apk update && \
apk add --no-cache ca-certificates
RUN apk add --no-cache ca-certificates
ADD drone-email /bin/
ENTRYPOINT ["/bin/drone-email"]
+6 -1
View File
@@ -31,6 +31,10 @@
name = "Aurélien Thieriot"
email = "a.thieriot@gmail.com"
login = "athieriot"
[people.mjwwit]
name = "Michael de Wit"
email = "mjwwit@gmail.com"
login = "mjwwit"
[org]
[org.core]
@@ -42,5 +46,6 @@
"msteinert",
"nlf",
"tboerger",
"athieriot"
"athieriot",
"mjwwit"
]
+12
View File
@@ -0,0 +1,12 @@
all: test build publish
test:
go vet
go test -cover -coverprofile=coverage.out
build:
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build
docker build -t drillster/drone-email:latest .
publish:
publish.sh
+5 -8
View File
@@ -1,10 +1,7 @@
# drone-email
[![Build Status](http://beta.drone.io/api/badges/drone-plugins/drone-email/status.svg)](http://beta.drone.io/drone-plugins/drone-email)
[![Go Doc](https://godoc.org/github.com/drone-plugins/drone-email?status.svg)](http://godoc.org/github.com/drone-plugins/drone-email)
[![Go Report](https://goreportcard.com/badge/github.com/drone-plugins/drone-email)](https://goreportcard.com/report/github.com/drone-plugins/drone-email)
[![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/Drillster/drone-email?status.svg)](http://godoc.org/github.com/Drillster/drone-email)
[![Go Report](https://goreportcard.com/badge/github.com/Drillster/drone-email)](https://goreportcard.com/report/github.com/Drillster/drone-email)
Drone plugin to send build status notifications via Email. For the usage information and a listing of the available options please take a look at [the docs](DOCS.md).
@@ -21,10 +18,10 @@ go build
Build the docker image with the following commands:
```
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -tags netgo
docker build -t plugins/email .
make build
```
This will create a Docker image called `drillster/drone-email:latest`.
Please note incorrectly building the image for the correct x64 linux and with GCO disabled will result in an error when running the Docker image:
```
@@ -53,5 +50,5 @@ docker run --rm \
-e DRONE_COMMIT_MESSAGE="Hello world!" \
-v $(pwd):$(pwd) \
-w $(pwd) \
plugins/email
drillster/drone-email
```
+1 -4
View File
@@ -1,7 +1,6 @@
package main
import (
"fmt"
"os"
log "github.com/Sirupsen/logrus"
@@ -9,8 +8,6 @@ import (
"github.com/urfave/cli"
)
var build = "0" // build number set at compile-time
func main() {
// Load env-file if it exists first
if env := os.Getenv("PLUGIN_ENV_FILE"); env != "" {
@@ -21,7 +18,7 @@ func main() {
app.Name = "email plugin"
app.Usage = "email plugin"
app.Action = run
app.Version = fmt.Sprintf("1.0.%s", build)
app.Version = "1.0.0"
app.Flags = []cli.Flag{
// Plugin environment
cli.StringFlag{
Executable
+25
View File
@@ -0,0 +1,25 @@
#!/bin/bash
tags=$(git tag --points-at HEAD)
IFS=$'\n' read -rd '' -a taglist <<<"$tags"
if [ ${#taglist[@]} -gt 0 ]; then
echo "Tagging Docker images with: ${taglist[@]}"
for tag in "${taglist[@]}"; do
docker tag drillster/drone-email:latest drillster/drone-email:$tag
done
fi
echo "Pushing Docker images..."
docker push drillster/drone-email:latest
if [ "$?" -ne "0" ]; then
echo "Failed to push image, exiting!"
exit 1
fi
if [ ${#taglist[@]} -gt 0 ]; then
for tag in "${taglist[@]}"; do
docker push drillster/drone-email:$tag
done
fi