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

Commit

Permalink
Bug 1564819 - support docker engine on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
petemoore committed Jul 10, 2019
1 parent b324dbd commit cdc89ec
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 15 deletions.
100 changes: 86 additions & 14 deletions .taskcluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ tasks:
######### Windows Server 2012 R2 Multiuser Build #########
##########################################################

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

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

- provisionerId: "{{ taskcluster.docker.provisionerId }}"
- provisionerId: "aws-provisioner-v1"
workerType: gecko-t-win10-64-cu
metadata:
name: "Build/test 64 bit generic-worker (multiuser engine) on Windows 10"
Expand Down Expand Up @@ -237,7 +237,7 @@ tasks:
- 'go test -tags multiuser -timeout 45m -ldflags "-X github.com/taskcluster/generic-worker.revision=%revision%" -v -race'
- ineffassign .
artifacts:
- name: public/build/generic-worker-windows-amd64.exe
- name: public/build/generic-worker-multiuser-windows-amd64.exe
path: gopath1.10.8\bin\generic-worker.exe
expires: "{{ '2 weeks' | $fromNow }}"
type: file
Expand Down Expand Up @@ -311,7 +311,7 @@ tasks:
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 ./...
ineffassign .
artifacts:
- name: public/build/generic-worker-darwin-amd64
- name: public/build/generic-worker-simple-darwin-amd64
path: gopath1.10.8/bin/generic-worker
expires: "{{ '2 weeks' | $fromNow }}"
type: file
Expand Down Expand Up @@ -382,7 +382,7 @@ tasks:
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
ineffassign .
artifacts:
- name: public/build/generic-worker-darwin-amd64
- name: public/build/generic-worker-multiuser-darwin-amd64
path: gopath1.10.8/bin/generic-worker
expires: "{{ '2 weeks' | $fromNow }}"
type: file
Expand Down Expand Up @@ -526,7 +526,7 @@ tasks:
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 ./...
"${GOPATH}/bin/ineffassign" .
artifacts:
- name: public/build/generic-worker-linux-amd64
- name: public/build/generic-worker-simple-linux-amd64
path: gopath1.10.8/bin/generic-worker
expires: "{{ '2 weeks' | $fromNow }}"
type: file
Expand Down Expand Up @@ -597,7 +597,7 @@ tasks:
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 ./...
"${GOPATH}/bin/ineffassign" .
artifacts:
- name: public/build/generic-worker-linux-amd64
- name: public/build/generic-worker-docker-linux-amd64
path: gopath1.10.8/bin/generic-worker
expires: "{{ '2 weeks' | $fromNow }}"
type: file
Expand All @@ -615,8 +615,8 @@ tasks:
###################### Docs Upload #######################
##########################################################

- provisionerId: '{{ taskcluster.docker.provisionerId }}'
workerType: '{{ taskcluster.docker.workerType }}'
- provisionerId: 'aws-provisioner-v1'
workerType: 'github-worker'
extra:
github:
events:
Expand Down Expand Up @@ -652,8 +652,8 @@ tasks:
############## Check vendored dependencies ###############
##########################################################

- provisionerId: "{{ taskcluster.docker.provisionerId }}"
workerType: "{{ taskcluster.docker.workerType }}"
- provisionerId: "aws-provisioner-v1"
workerType: "github-worker"
metadata:
name: "Run 'dep check' to ensure dependencies are up to date"
description: "Run 'dep check' to ensure dependencies are up to date"
Expand Down Expand Up @@ -694,3 +694,75 @@ tasks:
dep check
cache:
generic-worker-checkout: /go/src


##########################################################
################ macOS amd64 Docker Build ################
##########################################################

- provisionerId: pmoore-manual
workerType: mac-os-x
metadata:
name: "Build/test 64 bit generic-worker (docker engine) on macOS Mojave 10.14"
description: "This builds the 64 bit macOS version of generic-worker (docker engine)"
owner: "{{ event.head.user.email }}" # the user who sent the pr/push e-mail will be inserted here
source: "{{ event.head.repo.url }}" # the repo where the pr came from will be inserted here
extra:
github:
# Events that will trigger this task
events:
- pull_request.opened
- pull_request.synchronize
- push
scopes:
- generic-worker:cache:generic-worker-checkout
- secrets:get:repo:github.com/taskcluster/generic-worker
payload:
features:
taskclusterProxy:
true
maxRunTime: 3600
command:
- - /bin/bash
- -vxec
- |
export CGO_ENABLED=0
export GOROOT="$(pwd)/go1.10.8/go"
export GOPATH="$(pwd)/gopath1.10.8"
export PATH="${GOPATH}/bin:${GOROOT}/bin:${PATH}"
go version
go env
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
source ~/env_private.sh
mkdir -p "${GOPATH}/src/github.com/taskcluster"
cd "${GOPATH}/src/github.com/taskcluster"
if [ ! -d generic-worker/.git ]; then rm -rf generic-worker; git clone '{{ event.head.repo.url }}' 'generic-worker'; fi
cd 'generic-worker'
git fetch '{{ event.head.repo.url }}' "+{{ event.head.ref }}:refs/heads/X${TASK_ID}"
git checkout -f "X${TASK_ID}"
git reset --hard '{{ event.head.sha }}'
git clean -fdx
git checkout -B tmp -t "X${TASK_ID}"
go get -v -u github.com/taskcluster/livelog github.com/taskcluster/taskcluster-proxy github.com/gordonklaus/ineffassign
cd gw-codegen
go get -v
cd ..
go generate
go install -tags docker -v -ldflags "-X main.revision=$(git rev-parse HEAD)" ./...
# output of wc command can contain spaces on darwin, so no quotes around expression
test $(git status --porcelain | wc -l) == 0
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 ./...
ineffassign .
artifacts:
- name: public/build/generic-worker-docker-darwin-amd64
path: gopath1.10.8/bin/generic-worker
expires: "{{ '2 weeks' | $fromNow }}"
type: file
mounts:
# - cacheName: generic-worker-checkout
# directory: gopath1.10.8/src
- content:
url: https://storage.googleapis.com/golang/go1.10.8.darwin-amd64.tar.gz
sha256: f41bc914a721ac98a187df824b3b40f0a7f35bfb3c6d31221bdd940d537d3c28
directory: go1.10.8
format: tar.gz
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ env:
# "CGO_ENABLED=0 GIMME_OS=linux GIMME_ARCH=arm64 engine=simple"
- "CGO_ENABLED=0 GIMME_OS=darwin GIMME_ARCH=amd64 engine=simple"
- "CGO_ENABLED=0 GIMME_OS=darwin GIMME_ARCH=amd64 engine=multiuser"
- "CGO_ENABLED=0 GIMME_OS=darwin GIMME_ARCH=amd64 engine=docker"
- "CGO_ENABLED=0 GIMME_OS=windows GIMME_ARCH=amd64 engine=multiuser"
- "CGO_ENABLED=0 GIMME_OS=windows GIMME_ARCH=386 engine=multiuser"

Expand Down
3 changes: 2 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,9 @@ else
linux) install simple "${MY_GOHOSTOS}" "${MY_GOHOSTARCH}"
install docker "${MY_GOHOSTOS}" "${MY_GOHOSTARCH}"
;;
darwin) install simple "${MY_GOHOSTOS}" "${MY_GOHOSTARCH}"
darwin) install docker "${MY_GOHOSTOS}" "${MY_GOHOSTARCH}"
install multiuser "${MY_GOHOSTOS}" "${MY_GOHOSTARCH}"
install simple "${MY_GOHOSTOS}" "${MY_GOHOSTARCH}"
;;
windows) install multiuser "${MY_GOHOSTOS}" "${MY_GOHOSTARCH}"
;;
Expand Down

0 comments on commit cdc89ec

Please sign in to comment.