Skip to content

Commit

Permalink
Updates the structure and name of the tar.gz archive
Browse files Browse the repository at this point in the history
- the name includes a version
- the top-level directory of the tar has the same name as the archive
  • Loading branch information
Tim Emiola committed Mar 18, 2015
1 parent 64af683 commit 0d949f5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
17 changes: 10 additions & 7 deletions tools/dockerfile/grpc_dist_proto/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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



Expand Down
8 changes: 4 additions & 4 deletions tools/gce_setup/grpc_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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:"
Expand All @@ -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
}

Expand Down

0 comments on commit 0d949f5

Please sign in to comment.