Merge pull request #7623 from hashicorp/remove_travis
remove travis from our builds since we now use circle ci
This commit is contained in:
commit
b19d5c02d5
12
.travis.yml
12
.travis.yml
|
@ -2,8 +2,6 @@ env:
|
|||
- USER=travis GO111MODULE=off
|
||||
|
||||
os:
|
||||
- windows
|
||||
- linux
|
||||
- osx
|
||||
|
||||
sudo: false
|
||||
|
@ -13,21 +11,13 @@ language: go
|
|||
go:
|
||||
- 1.12.x
|
||||
|
||||
before_install:
|
||||
- >
|
||||
if [[ "$TRAVIS_OS_NAME" == "windows" ]];
|
||||
then choco install -y make;
|
||||
fi
|
||||
|
||||
script:
|
||||
- df -h
|
||||
- make ci
|
||||
- travis_wait make ci
|
||||
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
|
||||
matrix:
|
||||
allow_failures:
|
||||
- os: windows
|
||||
fast_finish: true
|
||||
|
|
|
@ -4,6 +4,7 @@ import (
|
|||
"context"
|
||||
"log"
|
||||
"net/rpc"
|
||||
"sync"
|
||||
|
||||
"github.com/hashicorp/packer/packer"
|
||||
)
|
||||
|
@ -22,6 +23,7 @@ type HookServer struct {
|
|||
contextCancel func()
|
||||
|
||||
hook packer.Hook
|
||||
lock sync.Mutex
|
||||
mux *muxBroker
|
||||
}
|
||||
|
||||
|
@ -67,9 +69,11 @@ func (h *HookServer) Run(args *HookRunArgs, reply *interface{}) error {
|
|||
}
|
||||
defer client.Close()
|
||||
|
||||
h.lock.Lock()
|
||||
if h.context == nil {
|
||||
h.context, h.contextCancel = context.WithCancel(context.Background())
|
||||
}
|
||||
h.lock.Unlock()
|
||||
if err := h.hook.Run(h.context, args.Name, client.Ui(), client.Communicator(), args.Data); err != nil {
|
||||
return NewBasicError(err)
|
||||
}
|
||||
|
@ -79,8 +83,10 @@ func (h *HookServer) Run(args *HookRunArgs, reply *interface{}) error {
|
|||
}
|
||||
|
||||
func (h *HookServer) Cancel(args *interface{}, reply *interface{}) error {
|
||||
h.lock.Lock()
|
||||
if h.contextCancel != nil {
|
||||
h.contextCancel()
|
||||
}
|
||||
h.lock.Unlock()
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue