blob: eb7b6e2eb682ce8e2354a15d2bdf3a76700b55ca [file] [log] [blame]
Yaakov Shaul8cd31a92019-02-20 12:18:54 -07001#!/bin/bash -e
2
George Engelbrecht8c384dc2020-06-05 11:02:16 -06003# Copyright 2019 The Chromium OS Authors. All rights reserved.
Yaakov Shaul8cd31a92019-02-20 12:18:54 -07004# Use of this source code is governed by a BSD-style license that can be
5# found in the LICENSE file.
6
7cd "$(dirname "$0")"
8
9# Wrap all testplan commands as cipd package.
Sean Abraham0c073352019-06-26 16:54:40 -060010CMDPATH="./cmd"
Yaakov Shaul8cd31a92019-02-20 12:18:54 -070011OUTPATH="$(pwd -P)/.out"
Yaakov Shaul7440c192019-02-21 11:48:31 -070012
13if [ -e $OUTPATH ]; then
14 rm -r $OUTPATH/*
15fi
16
17# translation:
Sean Abraham27de6642019-02-21 12:18:34 -070018# all cmds | strip trailing /
19COMMANDS=$(cd $CMDPATH; ls -d */ | sed 's#/##')
Yaakov Shaul7440c192019-02-21 11:48:31 -070020
21for go_cmd in $COMMANDS; do
Sean Abraham69876422020-03-12 16:29:12 -060022 # Target linux amd64, as that's what the GCE bots use.
23 (cd "$CMDPATH/$go_cmd" && GOOS=linux GOARCH=amd64 go build -o "$OUTPATH/$go_cmd")
Yaakov Shaul8cd31a92019-02-20 12:18:54 -070024done
25
Andrew Lambfe914712021-01-10 09:50:39 -070026GIT_REVISION=$(git rev-parse HEAD)
27
28cipd create -pkg-def=cipd.yaml -ref latest -json-output deploy_cipd.json \
29 -tag "git_revision:${GIT_REVISION}"