fune/taskcluster/scripts/misc/build-resourcemonitor.sh
Simon Fraser 27e5ba55f3 Bug 1648051 Task resource monitor r=mtabara,tomprince
I've left the monitor disabled for now, so that we can have a smaller pushes for enabling and disabling it if needed. It should allow more fine grained control.

We may also want to include extracting the monitor tool from a github version instead, and also removing the assumption and it being forked from the parent, so that it's instead given a process ID to treat as the parent it should watch.

Differential Revision: https://phabricator.services.mozilla.com/D84374
2020-08-06 01:21:24 +00:00

40 lines
929 B
Bash
Executable file

#!/bin/bash
set -x -e -v
cd "$MOZ_FETCHES_DIR"/resource-monitor/ || exit 1
COMPRESS_EXT=xz
PATH="$MOZ_FETCHES_DIR/go/bin:$PATH"
export PATH
EXE_SUFFIX=""
case "$1" in
linux64) GOOS=linux; GOARCH=amd64 ;;
macos64) GOOS=darwin; GOARCH=amd64 ;;
windows64) GOOS=windows; GOARCH=amd64; EXE_SUFFIX=".exe" ;;
windows32) GOOS=windows; GOARCH=386; EXE_SUFFIX=".exe" ;;
*)
echo "Unknown architecture $1 not recognized in build-resourcemonitor.sh" >&2
exit 1
;;
esac
export GOOS
export GOARCH
export EXE_SUFFIX
echo "GOOS=$GOOS"
echo "GOARCH=$GOARCH"
go build .
STAGING_DIR="resource-monitor"
mv "resource-monitor${EXE_SUFFIX}" resource-monitor.tmp
mkdir "${STAGING_DIR}"
cp resource-monitor.tmp "${STAGING_DIR}/resource-monitor${EXE_SUFFIX}"
tar -acf "resource-monitor.tar.$COMPRESS_EXT" "${STAGING_DIR}"/
mkdir -p "$UPLOAD_DIR"
cp "resource-monitor.tar.$COMPRESS_EXT" "$UPLOAD_DIR"