Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
language: go

sudo: false

go:
- 1.5.x
- 1.6.x
- 1.7.x
- 1.8.x
- 1.9.x
- tip

deploy:
provider: releases
api_key:
secure: 'kewugKeaEgDvNMaapSbhMTgWXO1tje4sbyF8D77lbceOviTfKZkDKuuwVSwTU1NTKuHk5DnC00Rrfy7d4HP1xPT94P4AnI6oEjUvQvi43U8Ub/YGbrwTAZpqUyZJWwmkHaEikeFRIRuyTnHztM8/IQaEQyOvxtu2NOFnMVCpagQ='
file:
- bin/certstrap-${TRAVIS_TAG}-linux-amd64
- bin/certstrap-${TRAVIS_TAG}-darwin-amd64
- bin/certstrap-${TRAVIS_TAG}-windows-amd64
skip_cleanup: true
on:
tags: true
go: 1.9
install:
- go get -d -t -v ./...
- go get github.com/tools/godep

before_script:
- ./build

script:
- ./test
5 changes: 4 additions & 1 deletion build
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

ORG_PATH="github.com/square"
REPO_PATH="${ORG_PATH}/certstrap"
BUILD_TAG="${TRAVIS_TAG:-$(git describe --all | sed -e's/.*\///g')}"

export GOPATH=${PWD}/gopath

Expand All @@ -13,4 +14,6 @@ ln -s ${PWD} $GOPATH/src/${REPO_PATH}

eval $(go env)

go build -o bin/certstrap ${REPO_PATH}
GOARCH=amd64 GOOS=linux go build -o bin/certstrap-${BUILD_TAG}-linux-amd64 ${REPO_PATH}
GOARCH=amd64 GOOS=darwin go build -o bin/certstrap-${BUILD_TAG}-darwin-amd64 ${REPO_PATH}
GOARCH=amd64 GOOS=windows go build -o bin/certstrap-${BUILD_TAG}-windows-amd64 ${REPO_PATH}
2 changes: 2 additions & 0 deletions test
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ if [ -z "$PKG" ]; then
PKG="cmd depot pkix tests"
fi

export BUILD_TAG="${TRAVIS_TAG:-$(git describe --all | sed -e's/.*\///g')}"

# Unit tests
echo
for mod in $PKG; do
Expand Down
12 changes: 8 additions & 4 deletions tests/basic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,19 @@ import (
"os/exec"
"strings"
"testing"
"runtime"
"fmt"
"os"
)

const (
binPath = "../bin/certstrap"
depotDir = ".certstrap-test"
hostname = "host1"
passphrase = "123456"
depotDir = ".certstrap-test"
hostname = "host1"
passphrase = "123456"
)

var binPath = fmt.Sprintf("../bin/certstrap-%s-%s-amd64", os.Getenv("BUILD_TAG"), runtime.GOOS)

func run(command string, args ...string) (string, string, error) {
var stdoutBytes, stderrBytes bytes.Buffer
args = append([]string{"--depot-path", depotDir}, args...)
Expand Down