Merge pull request #7623 from hashicorp/remove_travis

remove travis from our builds since we now use circle ci
This commit is contained in:
Megan Marsh 2019-05-10 11:08:25 -07:00 committed by GitHub
commit b19d5c02d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 11 deletions

View File

@ -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

View File

@ -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
}