Yaakov Shaul | 8cd31a9 | 2019-02-20 12:18:54 -0700 | [diff] [blame] | 1 | #!/bin/bash -e |
| 2 | |
George Engelbrecht | 8c384dc | 2020-06-05 11:02:16 -0600 | [diff] [blame] | 3 | # Copyright 2019 The Chromium OS Authors. All rights reserved. |
Yaakov Shaul | 8cd31a9 | 2019-02-20 12:18:54 -0700 | [diff] [blame] | 4 | # Use of this source code is governed by a BSD-style license that can be |
| 5 | # found in the LICENSE file. |
| 6 | |
| 7 | cd "$(dirname "$0")" |
| 8 | |
| 9 | # Wrap all testplan commands as cipd package. |
Sean Abraham | 0c07335 | 2019-06-26 16:54:40 -0600 | [diff] [blame] | 10 | CMDPATH="./cmd" |
Yaakov Shaul | 8cd31a9 | 2019-02-20 12:18:54 -0700 | [diff] [blame] | 11 | OUTPATH="$(pwd -P)/.out" |
Yaakov Shaul | 7440c19 | 2019-02-21 11:48:31 -0700 | [diff] [blame] | 12 | |
| 13 | if [ -e $OUTPATH ]; then |
| 14 | rm -r $OUTPATH/* |
| 15 | fi |
| 16 | |
| 17 | # translation: |
Sean Abraham | 27de664 | 2019-02-21 12:18:34 -0700 | [diff] [blame] | 18 | # all cmds | strip trailing / |
| 19 | COMMANDS=$(cd $CMDPATH; ls -d */ | sed 's#/##') |
Yaakov Shaul | 7440c19 | 2019-02-21 11:48:31 -0700 | [diff] [blame] | 20 | |
| 21 | for go_cmd in $COMMANDS; do |
Sean Abraham | 6987642 | 2020-03-12 16:29:12 -0600 | [diff] [blame] | 22 | # 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 Shaul | 8cd31a9 | 2019-02-20 12:18:54 -0700 | [diff] [blame] | 24 | done |
| 25 | |
Andrew Lamb | fe91471 | 2021-01-10 09:50:39 -0700 | [diff] [blame] | 26 | GIT_REVISION=$(git rev-parse HEAD) |
| 27 | |
| 28 | cipd create -pkg-def=cipd.yaml -ref latest -json-output deploy_cipd.json \ |
| 29 | -tag "git_revision:${GIT_REVISION}" |