Skip to content

Commit

Permalink
[cluster-test] Add --tag to cti
Browse files Browse the repository at this point in the history
This allows to reuse same image without rebuilding it

Closes: diem#2361
Approved by: davidiw
  • Loading branch information
Andrey Chursin authored and bors-libra committed Jan 30, 2020
1 parent 6816a06 commit be6c410
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions scripts/cti
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# SPDX-License-Identifier: Apache-2.0
set -e

TAG=""
PR=""
WORKSPACE="cluster-test-ci"

Expand All @@ -13,9 +14,13 @@ while (( "$#" )); do
shift 2
;;
-M|--master)
PR=MASTER
TAG=master
shift 1
;;
-T|--tag)
TAG=$2
shift 2
;;
-W|--workspace)
WORKSPACE=$2
shift 2
Expand All @@ -30,11 +35,11 @@ while (( "$#" )); do
esac
done

if [ -z "$PR" ]
if [ -z "$PR" ] && [ -z "$TAG" ]
then
echo "No PR specified"
echo "No PR or tag specified"
echo "Usage:"
echo "cti [--pr <PR>|--master] [--workspace <WORKSPACE>] <cluster test arguments>"
echo "cti [--pr <PR>|--master|--tag <TAG>] [--workspace <WORKSPACE>] <cluster test arguments>"
echo "Examples:"
echo "cti --pr <PR> --run bench # Run benchmark"
echo "cti --master --emit-tx # Submit transactions until Ctrl+C pressed"
Expand All @@ -46,14 +51,12 @@ JUMPHOST=ssh.${WORKSPACE}.aws.hlw3truzy4ls.com
aws codebuild list-projects >/dev/null || (echo "Failed to access codebuild, try awsmfa?"; exit 1)
ssh $JUMPHOST echo "ssh ok" >/dev/null || (echo "Failed to ssh to jump host $JUMPHOST. Try renew corp canal cert with cc-certs"; exit 1)

if [ "$PR" = "MASTER" ]; then
TAG=master
else
if [ -z "$TAG" ]; then
./docker/build-aws.sh --build-all --version pull/$PR
TAG=dev_${USER}_pull_${PR}
echo "**TIP Use cti -T $TAG <...> to restart this run with same tag without rebuilding it"
fi

echo "Will use tag $TAG"
echo "**********"
echo "Dashboard: http://prometheus.${WORKSPACE}.aws.hlw3truzy4ls.com:9091/"
echo "Logs:"
Expand Down

0 comments on commit be6c410

Please sign in to comment.