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 - USER=travis GO111MODULE=off
os: os:
- windows
- linux
- osx - osx
sudo: false sudo: false
@ -13,21 +11,13 @@ language: go
go: go:
- 1.12.x - 1.12.x
before_install:
- >
if [[ "$TRAVIS_OS_NAME" == "windows" ]];
then choco install -y make;
fi
script: script:
- df -h - df -h
- make ci - travis_wait make ci
branches: branches:
only: only:
- master - master
matrix: matrix:
allow_failures:
- os: windows
fast_finish: true fast_finish: true

View File

@ -4,6 +4,7 @@ import (
"context" "context"
"log" "log"
"net/rpc" "net/rpc"
"sync"
"github.com/hashicorp/packer/packer" "github.com/hashicorp/packer/packer"
) )
@ -22,6 +23,7 @@ type HookServer struct {
contextCancel func() contextCancel func()
hook packer.Hook hook packer.Hook
lock sync.Mutex
mux *muxBroker mux *muxBroker
} }
@ -67,9 +69,11 @@ func (h *HookServer) Run(args *HookRunArgs, reply *interface{}) error {
} }
defer client.Close() defer client.Close()
h.lock.Lock()
if h.context == nil { if h.context == nil {
h.context, h.contextCancel = context.WithCancel(context.Background()) 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 { if err := h.hook.Run(h.context, args.Name, client.Ui(), client.Communicator(), args.Data); err != nil {
return NewBasicError(err) 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 { func (h *HookServer) Cancel(args *interface{}, reply *interface{}) error {
h.lock.Lock()
if h.contextCancel != nil { if h.contextCancel != nil {
h.contextCancel() h.contextCancel()
} }
h.lock.Unlock()
return nil return nil
} }