From 0d949f5decbf2d98d5a9c9731292379d996566ef Mon Sep 17 00:00:00 2001 From: Tim Emiola Date: Wed, 18 Mar 2015 11:44:38 -0700 Subject: Updates the structure and name of the tar.gz archive - the name includes a version - the top-level directory of the tar has the same name as the archive --- tools/dockerfile/grpc_dist_proto/Dockerfile | 17 ++++++++++------- tools/gce_setup/grpc_docker.sh | 8 ++++---- 2 files changed, 14 insertions(+), 11 deletions(-) (limited to 'tools') diff --git a/tools/dockerfile/grpc_dist_proto/Dockerfile b/tools/dockerfile/grpc_dist_proto/Dockerfile index a15b7ca4a6..b4ed3b6035 100644 --- a/tools/dockerfile/grpc_dist_proto/Dockerfile +++ b/tools/dockerfile/grpc_dist_proto/Dockerfile @@ -30,6 +30,9 @@ # Dockerfile to build protoc and plugins for inclusion in a release. FROM grpc/base +# Add the file containing the gRPC version +ADD version.txt version.txt + # Install tools needed for building protoc. RUN apt-get update && apt-get -y install libgflags-dev libgtest-dev @@ -56,16 +59,16 @@ WORKDIR /var/local/git/grpc RUN LDFLAGS=-static make plugins # Create an archive containing all the generated binaries. -RUN mkdir /tmp/proto_bins_root -RUN cp -v bins/opt/* /tmp/proto_bins_root -RUN cp -v /tmp/protoc_static/bin/protoc /tmp/proto_bins_root -RUN cd /tmp/proto_bins_root && \ - tar -czf /tmp/proto-bins-linux-$(uname -m).tar.gz * +RUN mkdir /tmp/proto-bins_$(cat /version.txt)_linux-$(uname -m) +RUN cp -v bins/opt/* /tmp/proto-bins_$(cat /version.txt)_linux-$(uname -m) +RUN cp -v /tmp/protoc_static/bin/protoc /tmp/proto-bins_$(cat /version.txt)_linux-$(uname -m) +RUN cd /tmp && \ + tar -czf proto-bins_$(cat /version.txt)_linux-$(uname -m).tar.gz proto-bins_$(cat /version.txt)_linux-$(uname -m) # List the tar contents: provides a way to visually confirm that the contents # are correct. -RUN echo 'proto-bins-linux-tar-$(uname -m) contents:' && \ - tar -ztf /tmp/proto-bins-linux-$(uname -m).tar.gz +RUN echo 'proto-bins_$(cat /version.txt)_linux-tar-$(uname -m) contents:' && \ + tar -ztf /tmp/proto-bins_$(cat /version.txt)_linux-$(uname -m).tar.gz diff --git a/tools/gce_setup/grpc_docker.sh b/tools/gce_setup/grpc_docker.sh index 7ffd5b2203..88735fe450 100755 --- a/tools/gce_setup/grpc_docker.sh +++ b/tools/gce_setup/grpc_docker.sh @@ -698,10 +698,10 @@ grpc_build_proto_bins() { local label='dist_proto' grpc_update_image -- -h $host $label || return 1 - # run a command to copy the generated output to the local machine + # run a command to copy the generated archive to the docker host local docker_prefix='sudo docker run -v /tmp:/tmp/proto_bins_out' - local tar_name='proto-bins-linux-x86_64.tar.gz' - local cp_cmd="cp /tmp/$tar_name /tmp/proto_bins_out" + local tar_name='proto-bins*.tar.gz' + local cp_cmd="/bin/bash -c 'cp -v /tmp/$tar_name /tmp/proto_bins_out'" local cmd="$docker_prefix grpc/$label $cp_cmd" local ssh_cmd="bash -l -c \"$cmd\"" echo "will run:" @@ -711,7 +711,7 @@ grpc_build_proto_bins() { # copy the tar.gz locally local rmt_tar="$host:/tmp/$tar_name" - local local_copy="$(pwd)/$tar_name" + local local_copy="$(pwd)" gcloud compute copy-files $rmt_tar $local_copy $project_opt $zone_opt || return 1 } -- cgit v1.2.3