aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Jan Tattermusch <jtattermusch@users.noreply.github.com>2017-09-01 09:04:05 +0200
committerGravatar GitHub <noreply@github.com>2017-09-01 09:04:05 +0200
commitc928cfee2b94a99747f97ff8c5fb09277a1352b7 (patch)
treed05aa4fe81522d25f48cb283823a6ffe996da066
parenta544ac8501d7930174580b9ff9afb675756e43a2 (diff)
parent27af5b127bbab2e3f357d43a08a8eb430a40274a (diff)
Merge pull request #12350 from jtattermusch/deflake_ruby_artifact
Deflake ruby artifact build on Kokoro
-rwxr-xr-xtools/distrib/docker_for_windows.rb20
-rwxr-xr-xtools/dockerfile/push_testing_images.sh2
2 files changed, 16 insertions, 6 deletions
diff --git a/tools/distrib/docker_for_windows.rb b/tools/distrib/docker_for_windows.rb
index b5cd57f1f0..010e2067b8 100755
--- a/tools/distrib/docker_for_windows.rb
+++ b/tools/distrib/docker_for_windows.rb
@@ -23,11 +23,21 @@ def docker_for_windows_image()
dockerfile = File.join(grpc_root, 'third_party', 'rake-compiler-dock', 'Dockerfile')
dockerpath = File.dirname(dockerfile)
version = Digest::SHA1.file(dockerfile).hexdigest
- image_name = 'grpc/rake-compiler-dock:' + version
- cmd = "docker build -t #{image_name} --file #{dockerfile} #{dockerpath}"
- puts cmd
- system cmd
- raise "Failed to build the docker image." unless $? == 0
+ image_name = 'rake-compiler-dock_' + version
+ # if "DOCKERHUB_ORGANIZATION" env is set, we try to pull the pre-built
+ # rake-compiler-dock image from dockerhub rather then building from scratch.
+ if ENV.has_key?('DOCKERHUB_ORGANIZATION')
+ image_name = ENV['DOCKERHUB_ORGANIZATION'] + '/' + image_name
+ cmd = "docker pull #{image_name}"
+ puts cmd
+ system cmd
+ raise "Failed to pull the docker image." unless $? == 0
+ else
+ cmd = "docker build -t #{image_name} --file #{dockerfile} #{dockerpath}"
+ puts cmd
+ system cmd
+ raise "Failed to build the docker image." unless $? == 0
+ end
image_name
end
diff --git a/tools/dockerfile/push_testing_images.sh b/tools/dockerfile/push_testing_images.sh
index c88ba434f5..e9151303f7 100755
--- a/tools/dockerfile/push_testing_images.sh
+++ b/tools/dockerfile/push_testing_images.sh
@@ -29,7 +29,7 @@ cd -
DOCKERHUB_ORGANIZATION=grpctesting
-for DOCKERFILE_DIR in tools/dockerfile/test/* tools/dockerfile/grpc_artifact_* tools/dockerfile/interoptest/*
+for DOCKERFILE_DIR in tools/dockerfile/test/* tools/dockerfile/grpc_artifact_* tools/dockerfile/interoptest/* third_party/rake-compiler-dock
do
# Generate image name based on Dockerfile checksum. That works well as long
# as can count on dockerfiles being written in a way that changing the logical