grpc-zpages: gen_channelz_pb.sh should accept a git sha param (#307)

If no param is specified, we pull from the latest grpc/grpc-protos
This commit is contained in:
zpencer 2018-07-24 15:50:56 -07:00 committed by GitHub
parent 19a1330ec7
commit a9fa4c674b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 2 deletions

View File

@ -72,5 +72,10 @@ work with version `5.8.0` of `npm`.
To rebuild and copy the distributable files: To rebuild and copy the distributable files:
```bash ```bash
# Pull the latest proto definitions from
# https://github.com/grpc/grpc-proto
$ buildscripts/channelz_codegen.sh
# Rebuild the angular app
$ buildscripts/update_angular.sh $ buildscripts/update_angular.sh
``` ```

View File

@ -1,8 +1,14 @@
#!/bin/bash #!/bin/bash
set -eu -o pipefail set -eu -o pipefail
if [ "$#" -gt 1 ]; then
echo "Usage: $0 [GRPC_PROTO_REPO_SHA]"
echo "GRPC_PROTO_SHA defaults to 'origin/master'"
fi
# Check out a known good SHA for reproducibility # Check out a known good SHA for reproducibility
readonly GRPC_WEB_SHA=6357fa78f36d2e08636612f281250b31f28ae6ec readonly GRPC_WEB_SHA=6357fa78f36d2e08636612f281250b31f28ae6ec
readonly GRPC_PROTO_SHA="${1:-origin/master}"
readonly GRPC_ZPAGES_DIR="$(cd "$(dirname "$0")"/.. && pwd)" readonly GRPC_ZPAGES_DIR="$(cd "$(dirname "$0")"/.. && pwd)"
readonly GITHUB_DIR="$GRPC_ZPAGES_DIR"/buildscripts/github/ readonly GITHUB_DIR="$GRPC_ZPAGES_DIR"/buildscripts/github/
@ -21,6 +27,6 @@ docker build -t channelz_grpc_web_prereqs ./prereqs/
cd "$GRPC_ZPAGES_DIR"/docker cd "$GRPC_ZPAGES_DIR"/docker
docker build -t channelz_codegen codegen docker build -t channelz_codegen codegen
exec docker run --rm -v "$GRPC_ZPAGES_DIR"/docker/codegen/shared_dir:/shared_dir/ channelz_codegen bash -c "function fixFiles() { chown -R $(id -u):$(id -g) /shared_dir; }; trap fixFiles EXIT; /shared_dir/scripts/gen_channelz_pb.sh" exec docker run --rm -v "$GRPC_ZPAGES_DIR"/docker/codegen/shared_dir:/shared_dir/ channelz_codegen bash -c "function fixFiles() { chown -R $(id -u):$(id -g) /shared_dir; }; trap fixFiles EXIT; /shared_dir/scripts/gen_channelz_pb.sh $GRPC_PROTO_SHA"
mv "$GRPC_ZPAGES_DIR"/docker/codegen/shared_dir/gen_out/channelz.js "$GRPC_ZPAGES_DIR"/web/channelzui/src/assets/channelz.js mv "$GRPC_ZPAGES_DIR"/docker/codegen/shared_dir/gen_out/channelz.js "$GRPC_ZPAGES_DIR"/web/channelzui/src/assets/channelz.js

View File

@ -1,7 +1,11 @@
#!/bin/bash #!/bin/bash
set -eu -o pipefail set -eu -o pipefail
readonly GRPC_PROTO_SHA=91d19ac45f696816df5f1547cacaa201280cdc68 if [ "$#" -ne 1 ]; then
echo "Usage: $0 GRPC_PROTO_SHA"
fi
readonly GRPC_PROTO_SHA="$1"
readonly SHARED_DIR="$(cd "$(dirname "$0")"/.. && pwd)" readonly SHARED_DIR="$(cd "$(dirname "$0")"/.. && pwd)"
mkdir -p /github mkdir -p /github