Use the local version of the distpackages when build debian files

pull/1230/head
Tim Emiola 10 years ago
parent bc83a5ea0e
commit 1e3361c161
  1. 13
      tools/distpackages/build_deb_packages.sh
  2. 10
      tools/dockerfile/grpc_build_deb/Dockerfile
  3. 5
      tools/gce_setup/grpc_docker.sh
  4. 6
      tools/gce_setup/shared_startup_funcs.sh

@ -30,9 +30,13 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# Where to put resulting .deb packages.
set -x
deb_dest="/tmp/deb_out"
mkdir -p $deb_dest
# Where the grpc disto is
grpc_root="/var/local/git/grpc"
# Update version from default values if the file /version.txt exists
#
# - when present, /version.txt will added by the docker build.
@ -71,7 +75,9 @@ do
if [ $pkg_name == "libgrpc" ]
then
# Copy shared libraries
(cd ../..; make install-shared_c prefix=$tmp_dir/$pkg_name/usr/lib)
pushd $grpc_root
make install-shared_c prefix=$tmp_dir/$pkg_name/usr/lib
popd
mv $tmp_dir/$pkg_name/usr/lib/lib $arch_lib_dir
# non-dev package should contain so.0 symlinks
@ -84,7 +90,10 @@ do
if [ $pkg_name == "libgrpc-dev" ]
then
# Copy headers and static libraries
(cd ../..; make install-headers_c install-static_c prefix=$tmp_dir/$pkg_name/usr/lib)
pushd $grpc_root
make install-headers_c install-static_c prefix=$tmp_dir/$pkg_name/usr/lib
popd
mv $tmp_dir/$pkg_name/usr/lib/include $tmp_dir/$pkg_name/usr/include
mv $tmp_dir/$pkg_name/usr/lib/lib $arch_lib_dir

@ -33,8 +33,14 @@ FROM grpc/base
# Add the file containing the gRPC version
ADD version.txt version.txt
# Add the update-to-date distpackages folder
ADD distpackages distpackages
# Install dependencies
RUN apt-get update && apt-get install -y lintian
RUN echo 'deb http://http.debian.net/debian experimental main contrib non-free' >> /etc/apt/sources.list
RUN apt-get update \
&& apt-get -t experimental install -y openssl=1.0.2-1 \
&& apt-get install -y lintian
# Get the source from GitHub
RUN git clone https://github.com/grpc/grpc.git /var/local/git/grpc
@ -42,4 +48,4 @@ RUN cd /var/local/git/grpc && \
git pull --recurse-submodules && \
git submodule update --init --recursive
RUN /bin/bash -l -c 'cd /var/local/git/grpc/tools/distpackages && ./build_deb_packages.sh'
RUN /bin/bash -l -c 'cd /distpackages && ./build_deb_packages.sh'

@ -747,6 +747,11 @@ grpc_build_debs() {
local project_opt="--project $grpc_project"
local zone_opt="--zone $grpc_zone"
# Update the remote distpackages_dir
local src_dist_dir='tools/distpackages'
local rmt_dist_dir="$host:~"
gcloud compute copy-files $src_dist_dir $rmt_dist_dir $project_opt $zone_opt || return 1
# rebuild the build_deb image
local label='build_deb'
grpc_update_image -- -h $host $label || return 1

@ -434,6 +434,12 @@ grpc_dockerfile_install() {
grpc_docker_sync_service_account $dockerfile_dir/service_account || return 1;
}
# For deb builds, copy the distpackages folder into the docker directory so
# that it can be installed using ADD distpackages distpackages.
[[ $image_label == "grpc/build_deb" ]] && {
cp -vR ~/distpackages $dockerfile_dir
}
# TODO(temiola): maybe make cache/no-cache a func option?
sudo docker build $cache_opt -t $image_label $dockerfile_dir || {
echo "$FUNCNAME:: build of $image_label <- $dockerfile_dir"

Loading…
Cancel
Save