• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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/push_apps_from_skia_image
25go install -v go.skia.org/infra/infra/bots/task_drivers/push_apps_from_wasm_image
26go install -v go.skia.org/infra/infra/bots/task_drivers/update_go_deps
27
28goos=$2
29goarch=$3
30if [ "$goos" == "windows" ]; then suffix=".exe"; else suffix=""; fi
31
32# Build task drivers from this repo.
33task_drivers_dir=infra/bots/task_drivers
34for td in $(cd ${task_drivers_dir} && ls); do
35  CGO_ENABLED=0 GOARCH=$goarch GOOS=$goos go build -o ${1}/${td}${suffix} ${task_drivers_dir}/${td}/${td}.go
36done
37