1#!/bin/bash 2# Copyright 2019 Google, LLC 3# 4# Use of this source code is governed by a BSD-style license that can be 5# found in the LICENSE file. 6 7set -x -e 8 9export GOCACHE="$(pwd)/cache/go_cache" 10export GOPATH="$(pwd)/cache/gopath" 11export GOROOT="$(pwd)/go/go" 12 13cd skia 14 15# Build task drivers from the infra repo. 16export GOBIN="${1}" 17git init 18git remote add origin https://skia.googlesource.com/skia.git 19git add . 20git commit -a -m "initial commit to make go modules work" 21export GOFLAGS="-mod=readonly" 22go mod download 23go install -v go.skia.org/infra/infra/bots/task_drivers/build_push_docker_image 24go install -v go.skia.org/infra/infra/bots/task_drivers/canary 25go install -v go.skia.org/infra/infra/bots/task_drivers/update_go_deps 26 27goos=$2 28goarch=$3 29if [ "$goos" == "windows" ]; then suffix=".exe"; else suffix=""; fi 30 31# Build task drivers from this repo. 32task_drivers_dir=infra/bots/task_drivers 33for td in $(cd ${task_drivers_dir} && ls); do 34 CGO_ENABLED=0 GOARCH=$goarch GOOS=$goos go build -o ${1}/${td}${suffix} ${task_drivers_dir}/${td}/${td}.go 35done 36