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