Skip to content
This repository was archived by the owner on Feb 20, 2020. It is now read-only.

Commit cdc89ec

Browse files
committed
Bug 1564819 - support docker engine on macOS
1 parent b324dbd commit cdc89ec

3 files changed

Lines changed: 89 additions & 15 deletions

File tree

.taskcluster.yml

Lines changed: 86 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ tasks:
1414
######### Windows Server 2012 R2 Multiuser Build #########
1515
##########################################################
1616

17-
- provisionerId: "{{ taskcluster.docker.provisionerId }}"
17+
- provisionerId: "aws-provisioner-v1"
1818
workerType: win2012r2-cu
1919
metadata:
2020
name: "Build/test 64 bit generic-worker (multiuser engine) on Windows Server 2012 R2"
@@ -75,7 +75,7 @@ tasks:
7575
- 'go test -tags multiuser -timeout 45m -ldflags "-X github.com/taskcluster/generic-worker.revision=%revision%" -v -race'
7676
- ineffassign .
7777
artifacts:
78-
- name: public/build/generic-worker-windows-amd64.exe
78+
- name: public/build/generic-worker-multiuser-windows-amd64.exe
7979
path: gopath1.10.8\bin\generic-worker.exe
8080
expires: "{{ '2 weeks' | $fromNow }}"
8181
type: file
@@ -98,7 +98,7 @@ tasks:
9898
############### Windows 7 Multiuser Build ################
9999
##########################################################
100100

101-
- provisionerId: "{{ taskcluster.docker.provisionerId }}"
101+
- provisionerId: "aws-provisioner-v1"
102102
workerType: gecko-t-win7-32-cu
103103
metadata:
104104
name: "Build/test 32 bit generic-worker (multiuser engine) on Windows 7"
@@ -153,7 +153,7 @@ tasks:
153153
- 'go test -tags multiuser -timeout 45m -ldflags "-X github.com/taskcluster/generic-worker.revision=%revision%" -v'
154154
- ineffassign .
155155
artifacts:
156-
- name: public/build/generic-worker-windows-386.exe
156+
- name: public/build/generic-worker-multiuser-windows-386.exe
157157
path: gopath1.10.8\bin\generic-worker.exe
158158
expires: "{{ '2 weeks' | $fromNow }}"
159159
type: file
@@ -176,7 +176,7 @@ tasks:
176176
############### Windows 10 Multiuser Build ###############
177177
##########################################################
178178

179-
- provisionerId: "{{ taskcluster.docker.provisionerId }}"
179+
- provisionerId: "aws-provisioner-v1"
180180
workerType: gecko-t-win10-64-cu
181181
metadata:
182182
name: "Build/test 64 bit generic-worker (multiuser engine) on Windows 10"
@@ -237,7 +237,7 @@ tasks:
237237
- 'go test -tags multiuser -timeout 45m -ldflags "-X github.com/taskcluster/generic-worker.revision=%revision%" -v -race'
238238
- ineffassign .
239239
artifacts:
240-
- name: public/build/generic-worker-windows-amd64.exe
240+
- name: public/build/generic-worker-multiuser-windows-amd64.exe
241241
path: gopath1.10.8\bin\generic-worker.exe
242242
expires: "{{ '2 weeks' | $fromNow }}"
243243
type: file
@@ -311,7 +311,7 @@ tasks:
311311
GORACE=history_size=7 CGO_ENABLED=1 go test -tags simple -timeout 45m -ldflags "-X github.com/taskcluster/generic-worker.revision=$(git rev-parse HEAD)" -race -v ./...
312312
ineffassign .
313313
artifacts:
314-
- name: public/build/generic-worker-darwin-amd64
314+
- name: public/build/generic-worker-simple-darwin-amd64
315315
path: gopath1.10.8/bin/generic-worker
316316
expires: "{{ '2 weeks' | $fromNow }}"
317317
type: file
@@ -382,7 +382,7 @@ tasks:
382382
GW_TESTS_RUN_AS_TASK_USER=true GORACE=history_size=7 CGO_ENABLED=1 go test -tags multiuser -timeout 45m -ldflags "-X github.com/taskcluster/generic-worker.revision=$(git rev-parse HEAD)" -race -v
383383
ineffassign .
384384
artifacts:
385-
- name: public/build/generic-worker-darwin-amd64
385+
- name: public/build/generic-worker-multiuser-darwin-amd64
386386
path: gopath1.10.8/bin/generic-worker
387387
expires: "{{ '2 weeks' | $fromNow }}"
388388
type: file
@@ -526,7 +526,7 @@ tasks:
526526
GORACE=history_size=7 CGO_ENABLED=1 go test -tags simple -timeout 45m -ldflags "-X github.com/taskcluster/generic-worker.revision=$(git rev-parse HEAD)" -v -race ./...
527527
"${GOPATH}/bin/ineffassign" .
528528
artifacts:
529-
- name: public/build/generic-worker-linux-amd64
529+
- name: public/build/generic-worker-simple-linux-amd64
530530
path: gopath1.10.8/bin/generic-worker
531531
expires: "{{ '2 weeks' | $fromNow }}"
532532
type: file
@@ -597,7 +597,7 @@ tasks:
597597
GORACE=history_size=7 CGO_ENABLED=1 go test -tags docker -timeout 45m -ldflags "-X github.com/taskcluster/generic-worker.revision=$(git rev-parse HEAD)" -v -race ./...
598598
"${GOPATH}/bin/ineffassign" .
599599
artifacts:
600-
- name: public/build/generic-worker-linux-amd64
600+
- name: public/build/generic-worker-docker-linux-amd64
601601
path: gopath1.10.8/bin/generic-worker
602602
expires: "{{ '2 weeks' | $fromNow }}"
603603
type: file
@@ -615,8 +615,8 @@ tasks:
615615
###################### Docs Upload #######################
616616
##########################################################
617617

618-
- provisionerId: '{{ taskcluster.docker.provisionerId }}'
619-
workerType: '{{ taskcluster.docker.workerType }}'
618+
- provisionerId: 'aws-provisioner-v1'
619+
workerType: 'github-worker'
620620
extra:
621621
github:
622622
events:
@@ -652,8 +652,8 @@ tasks:
652652
############## Check vendored dependencies ###############
653653
##########################################################
654654

655-
- provisionerId: "{{ taskcluster.docker.provisionerId }}"
656-
workerType: "{{ taskcluster.docker.workerType }}"
655+
- provisionerId: "aws-provisioner-v1"
656+
workerType: "github-worker"
657657
metadata:
658658
name: "Run 'dep check' to ensure dependencies are up to date"
659659
description: "Run 'dep check' to ensure dependencies are up to date"
@@ -694,3 +694,75 @@ tasks:
694694
dep check
695695
cache:
696696
generic-worker-checkout: /go/src
697+
698+
699+
##########################################################
700+
################ macOS amd64 Docker Build ################
701+
##########################################################
702+
703+
- provisionerId: pmoore-manual
704+
workerType: mac-os-x
705+
metadata:
706+
name: "Build/test 64 bit generic-worker (docker engine) on macOS Mojave 10.14"
707+
description: "This builds the 64 bit macOS version of generic-worker (docker engine)"
708+
owner: "{{ event.head.user.email }}" # the user who sent the pr/push e-mail will be inserted here
709+
source: "{{ event.head.repo.url }}" # the repo where the pr came from will be inserted here
710+
extra:
711+
github:
712+
# Events that will trigger this task
713+
events:
714+
- pull_request.opened
715+
- pull_request.synchronize
716+
- push
717+
scopes:
718+
- generic-worker:cache:generic-worker-checkout
719+
- secrets:get:repo:github.com/taskcluster/generic-worker
720+
payload:
721+
features:
722+
taskclusterProxy:
723+
true
724+
maxRunTime: 3600
725+
command:
726+
- - /bin/bash
727+
- -vxec
728+
- |
729+
export CGO_ENABLED=0
730+
export GOROOT="$(pwd)/go1.10.8/go"
731+
export GOPATH="$(pwd)/gopath1.10.8"
732+
export PATH="${GOPATH}/bin:${GOROOT}/bin:${PATH}"
733+
go version
734+
go env
735+
curl -s "${TASKCLUSTER_PROXY_URL}/secrets/v1/secret/repo:github.com/taskcluster/generic-worker" | sed -n 's/.*"b64_encoded_credentials_script": "\(.*\)".*/\1/p' | base64 -D > ~/env_private.sh
736+
source ~/env_private.sh
737+
mkdir -p "${GOPATH}/src/github.com/taskcluster"
738+
cd "${GOPATH}/src/github.com/taskcluster"
739+
if [ ! -d generic-worker/.git ]; then rm -rf generic-worker; git clone '{{ event.head.repo.url }}' 'generic-worker'; fi
740+
cd 'generic-worker'
741+
git fetch '{{ event.head.repo.url }}' "+{{ event.head.ref }}:refs/heads/X${TASK_ID}"
742+
git checkout -f "X${TASK_ID}"
743+
git reset --hard '{{ event.head.sha }}'
744+
git clean -fdx
745+
git checkout -B tmp -t "X${TASK_ID}"
746+
go get -v -u github.com/taskcluster/livelog github.com/taskcluster/taskcluster-proxy github.com/gordonklaus/ineffassign
747+
cd gw-codegen
748+
go get -v
749+
cd ..
750+
go generate
751+
go install -tags docker -v -ldflags "-X main.revision=$(git rev-parse HEAD)" ./...
752+
# output of wc command can contain spaces on darwin, so no quotes around expression
753+
test $(git status --porcelain | wc -l) == 0
754+
GORACE=history_size=7 CGO_ENABLED=1 go test -tags docker -timeout 45m -ldflags "-X github.com/taskcluster/generic-worker.revision=$(git rev-parse HEAD)" -v -race ./...
755+
ineffassign .
756+
artifacts:
757+
- name: public/build/generic-worker-docker-darwin-amd64
758+
path: gopath1.10.8/bin/generic-worker
759+
expires: "{{ '2 weeks' | $fromNow }}"
760+
type: file
761+
mounts:
762+
# - cacheName: generic-worker-checkout
763+
# directory: gopath1.10.8/src
764+
- content:
765+
url: https://storage.googleapis.com/golang/go1.10.8.darwin-amd64.tar.gz
766+
sha256: f41bc914a721ac98a187df824b3b40f0a7f35bfb3c6d31221bdd940d537d3c28
767+
directory: go1.10.8
768+
format: tar.gz

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ env:
1111
# "CGO_ENABLED=0 GIMME_OS=linux GIMME_ARCH=arm64 engine=simple"
1212
- "CGO_ENABLED=0 GIMME_OS=darwin GIMME_ARCH=amd64 engine=simple"
1313
- "CGO_ENABLED=0 GIMME_OS=darwin GIMME_ARCH=amd64 engine=multiuser"
14+
- "CGO_ENABLED=0 GIMME_OS=darwin GIMME_ARCH=amd64 engine=docker"
1415
- "CGO_ENABLED=0 GIMME_OS=windows GIMME_ARCH=amd64 engine=multiuser"
1516
- "CGO_ENABLED=0 GIMME_OS=windows GIMME_ARCH=386 engine=multiuser"
1617

build.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,9 @@ else
8181
linux) install simple "${MY_GOHOSTOS}" "${MY_GOHOSTARCH}"
8282
install docker "${MY_GOHOSTOS}" "${MY_GOHOSTARCH}"
8383
;;
84-
darwin) install simple "${MY_GOHOSTOS}" "${MY_GOHOSTARCH}"
84+
darwin) install docker "${MY_GOHOSTOS}" "${MY_GOHOSTARCH}"
8585
install multiuser "${MY_GOHOSTOS}" "${MY_GOHOSTARCH}"
86+
install simple "${MY_GOHOSTOS}" "${MY_GOHOSTARCH}"
8687
;;
8788
windows) install multiuser "${MY_GOHOSTOS}" "${MY_GOHOSTARCH}"
8889
;;

0 commit comments

Comments
 (0)