From e6f4d33f40fc50b07d8ad8b58fb8f41b78731799 Mon Sep 17 00:00:00 2001 From: Thomas Boerger Date: Fri, 16 Mar 2018 13:07:56 +0100 Subject: [PATCH] Updated to current build process --- .appveyor.yml | 14 ++++++++++---- .drone.yml | 32 ++++++++++++++++++-------------- .gitignore | 2 ++ Dockerfile.windows | 4 +++- Gopkg.toml | 23 ----------------------- 5 files changed, 33 insertions(+), 42 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index ac6de9b..0eebf56 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -1,11 +1,12 @@ version: '{build}' image: 'Visual Studio 2017' -platform: x64 +platform: 'x64' -clone_folder: 'c:\go\src\github.com\drone-plugins\drone-matrix' +clone_folder: 'c:\gopath\src\github.com\drone-plugins\drone-matrix' max_jobs: 1 environment: + GOPATH: c:\gopath DOCKER_USERNAME: secure: '4YzzahbEiMZQJpOCOd1LAw==' DOCKER_PASSWORD: @@ -15,14 +16,19 @@ install: - ps: | docker version go version + - ps: | + $env:Path = "c:\gopath\bin;$env:Path" build_script: - ps: | + go get -u github.com/golang/dep/cmd/dep + dep ensure + if ( $env:APPVEYOR_REPO_TAG -eq 'false' ) { - go build -ldflags "-X main.build=$env:APPVEYOR_BUILD_VERSION" -a -o drone-matrix.exe + go build -ldflags "-X main.build=$env:APPVEYOR_BUILD_VERSION" -a -o release/drone-matrix.exe } else { $version = $env:APPVEYOR_REPO_TAG_NAME.substring(1) - go build -ldflags "-X main.version=$version -X main.build=$env:APPVEYOR_BUILD_VERSION" -a -o drone-matrix.exe + go build -ldflags "-X main.version=$version -X main.build=$env:APPVEYOR_BUILD_VERSION" -a -o release/drone-matrix.exe } docker pull microsoft/nanoserver:10.0.14393.1593 diff --git a/.drone.yml b/.drone.yml index 8ea74cf..394f063 100644 --- a/.drone.yml +++ b/.drone.yml @@ -3,18 +3,22 @@ workspace: path: src/github.com/drone-plugins/drone-matrix pipeline: + deps: + image: golang:1.10 + pull: true + commands: + - go get -u github.com/golang/dep/cmd/dep + - dep ensure + test: - image: golang:1.9 + image: golang:1.10 pull: true commands: - - go vet - - | - for PKG in $(go list ./... | grep -v /vendor/); do - go test -cover -coverprofile $GOPATH/src/$PKG/coverage.out $PKG - done + - go vet ./... + - go test -cover ./... build_linux_amd64: - image: golang:1.9 + image: golang:1.10 pull: true group: build environment: @@ -30,7 +34,7 @@ pipeline: fi build_linux_i386: - image: golang:1.9 + image: golang:1.10 pull: true group: build environment: @@ -46,7 +50,7 @@ pipeline: fi build_linux_arm64: - image: golang:1.9 + image: golang:1.10 pull: true group: build environment: @@ -62,7 +66,7 @@ pipeline: fi build_linux_arm: - image: golang:1.9 + image: golang:1.10 pull: true group: build environment: @@ -79,7 +83,7 @@ pipeline: fi publish_linux_amd64: - image: plugins/docker:17.05 + image: plugins/docker:17.12 pull: true secrets: [ docker_username, docker_password ] group: docker @@ -91,7 +95,7 @@ pipeline: event: [ push, tag ] publish_linux_i386: - image: plugins/docker:17.05 + image: plugins/docker:17.12 pull: true secrets: [ docker_username, docker_password ] group: docker @@ -103,7 +107,7 @@ pipeline: event: [ push, tag ] publish_linux_arm64: - image: plugins/docker:17.05 + image: plugins/docker:17.12 pull: true secrets: [ docker_username, docker_password ] group: docker @@ -115,7 +119,7 @@ pipeline: event: [ push, tag ] publish_linux_arm: - image: plugins/docker:17.05 + image: plugins/docker:17.12 pull: true secrets: [ docker_username, docker_password ] group: docker diff --git a/.gitignore b/.gitignore index 57472fa..0779c6e 100644 --- a/.gitignore +++ b/.gitignore @@ -24,5 +24,7 @@ _testmain.go *.prof release/ +vendor/ + coverage.out drone-matrix diff --git a/Dockerfile.windows b/Dockerfile.windows index 910e01d..77d199a 100644 --- a/Dockerfile.windows +++ b/Dockerfile.windows @@ -6,5 +6,7 @@ LABEL maintainer="Drone.IO Community " ` org.label-schema.vendor="Drone.IO Community" ` org.label-schema.schema-version="1.0" -ADD drone-matrix.exe c:\drone-matrix.exe +SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] + +ADD release\drone-matrix.exe c:\drone-matrix.exe ENTRYPOINT [ "c:\\drone-matrix.exe" ] diff --git a/Gopkg.toml b/Gopkg.toml index 3edad83..d3a5c73 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -1,26 +1,3 @@ - -# Gopkg.toml example -# -# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md -# for detailed Gopkg.toml documentation. -# -# required = ["github.com/user/thing/cmd/thing"] -# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"] -# -# [[constraint]] -# name = "github.com/user/project" -# version = "1.0.0" -# -# [[constraint]] -# name = "github.com/user/project2" -# branch = "dev" -# source = "github.com/myfork/project2" -# -# [[override]] -# name = "github.com/x/y" -# version = "2.4.0" - - [[constraint]] name = "github.com/aymerick/raymond" version = "2.0.1"