Skip to content

Commit

Permalink
Merge pull request 99designs#284 from 99designs/update-travis
Browse files Browse the repository at this point in the history
Update travis config and Makefile for go 1.11
  • Loading branch information
mtibben authored Sep 2, 2018
2 parents 51451d9 + 8b777d9 commit 77088c6
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 26 deletions.
18 changes: 9 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
language: go
go_import_path: github.com/99designs/aws-vault

install:
- go get -u github.com/kardianos/govendor
- govendor status

go:
- "1.8.x"
- "1.9.x"
- "1.10.x"
- "master"
- "1.11.x"

os:
- linux
- osx

osx_image: xcode7.3
before_install:
- go get -u github.com/kardianos/govendor

script:
- govendor status
- diff -u <(echo -n) <(gofmt -d $(git ls-files '*.go' | grep -v ^vendor/))
- go vet
- go test -race ./...
20 changes: 7 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
BIN=aws-vault
OS=$(shell uname -s)
ARCH=$(shell uname -m)
GOVERSION=$(shell go version)
GOBIN=$(shell go env GOBIN)
VERSION=$(shell git describe --tags --candidates=1 --dirty)
FLAGS=-X main.Version=$(VERSION) -s -w
CERT="Developer ID Application: 99designs Inc (NRM9HVJ62Z)"
SRC=$(shell find . -name '*.go')

test:
go test -v $(shell go list ./... | grep -v /vendor/)
.PHONY: build install sign release clean

build:
go build -o aws-vault -ldflags="$(FLAGS)" .
Expand All @@ -20,17 +14,17 @@ install:
sign:
codesign -s $(CERT) ./aws-vault

$(BIN)-linux-amd64: $(SRC)
aws-vault-linux-amd64: $(SRC)
GOOS=linux GOARCH=amd64 go build -o $@ -ldflags="$(FLAGS)" .

$(BIN)-darwin-amd64: $(SRC)
aws-vault-darwin-amd64: $(SRC)
GOOS=darwin GOARCH=amd64 go build -o $@ -ldflags="$(FLAGS)" .
codesign -s $(CERT) $@

$(BIN)-windows-386.exe: $(SRC)
aws-vault-windows-386.exe: $(SRC)
GOOS=windows GOARCH=386 go build -o $@ -ldflags="$(FLAGS)" .

release: $(BIN)-linux-amd64 $(BIN)-darwin-amd64 $(BIN)-windows-386.exe
codesign -s $(CERT) $(BIN)-darwin-amd64
release: aws-vault-linux-amd64 aws-vault-darwin-amd64 aws-vault-windows-386.exe

clean:
rm -f $(BIN)-*-*
rm -f aws-vault aws-vault-linux-amd64 aws-vault-darwin-amd64 aws-vault-windows-386.exe
4 changes: 2 additions & 2 deletions vault/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func ConfigPath() (string, error) {
}

// CreateConfig will create the config directory and file if they do not exist
func CreateConfig() (error) {
func CreateConfig() error {
file, err := ConfigPath()
if err != nil {
return err
Expand All @@ -57,7 +57,7 @@ func CreateConfig() (error) {
}
newFile.Close()
log.Printf("Config file %s created", file)
}
}
return nil
}

Expand Down
4 changes: 2 additions & 2 deletions vault/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,8 +323,8 @@ func (p *VaultProvider) assumeRole(creds credentials.Value, profile Profile) (st
}

if profile.ExternalID != "" {
input.ExternalId = aws.String(profile.ExternalID)
}
input.ExternalId = aws.String(profile.ExternalID)
}

// if we don't have a session, we need to include MFA token in the AssumeRole call
if profile.MFASerial != "" {
Expand Down

0 comments on commit 77088c6

Please sign in to comment.