diff --git a/.drone.yml b/.drone.yml index b90ee66..025ed07 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,12 +1,24 @@ -build: - image: golang:1.5 - environment: - - GO15VENDOREXPERIMENT=1 - - CGO_ENABLED=0 - commands: - - go test -cover -coverprofile coverage.out +pipeline: + build: + image: ${IMAGE} + commands: + - go build + - go test -publish: - coverage: - when: - branch: master + ecr: + image: plugins/ecr + region: us-east-1 + access_key: ${ECR_ACCESS_KEY} + secret_key: ${ECR_SECRET_KEY} + repo: 995121555896.dkr.ecr.us-east-1.amazonaws.com/cloudlock/test-sit-ci-built-svc + dockerfile: ./Dockerfile + context: . + volumes: + - /var/run/docker.sock:/var/run/docker.sock + environment: + - DOCKER_LAUNCH_DEBUG=true +matrix: + IMAGE: +# - golang:1.7 +# - golang:1.8 + - golang:latest diff --git a/.drone.yml.sig b/.drone.yml.sig new file mode 100644 index 0000000..5b77fca --- /dev/null +++ b/.drone.yml.sig @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..015b7cb --- /dev/null +++ b/Dockerfile @@ -0,0 +1,6 @@ +FROM golang:latest +RUN mkdir /app +ADD . /app/ +WORKDIR /app +RUN go build -o main . +CMD ["/app/main"] diff --git a/README.md b/README.md index 38ed11d..0df7a67 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ # drone-with-go [![Build Status](http://beta.drone.io/api/badges/drone-demos/drone-with-go/status.svg)](http://beta.drone.io/drone-demos/drone-with-go) [![Build Status](https://aircover.co/badges/drone-demos/drone-with-go/coverage.svg)](https://aircover.co/drone-demos/drone-with-go) An example of how to test Go code with Drone. + +Inspect the .drone.yml file for details on the build steps for this simple go project. diff --git a/main.go b/main.go index 4d35264..67d7c2b 100644 --- a/main.go +++ b/main.go @@ -8,5 +8,5 @@ func main() { // HelloWorld is a function that returns a string containing "hello world". func HelloWorld() string { - return "hello world" + return "hello joseph" } diff --git a/main_test.go b/main_test.go index 887a4df..926c769 100644 --- a/main_test.go +++ b/main_test.go @@ -1,5 +1,5 @@ package main - + import ( "os" "testing" @@ -10,7 +10,7 @@ func TestMain(m *testing.M) { } func TestHelloWorld(t *testing.T) { - if HelloWorld() != "hello world" { + if HelloWorld() != "hello joseph" { t.Errorf("got %s expected %s", HelloWorld(), "hello world") } }