@@ -66,7 +66,6 @@ def get_gae_versions
6666def build_docker_image app_dir , project_id
6767 image_name = "google-cloud-ruby-test-%.08x" % rand ( 0x100000000 )
6868 image_location = "us.gcr.io/#{ project_id } /#{ image_name } "
69- temp_dockerfile = false
7069 begin
7170 # Create default Dockerfile if one doesn't already exist
7271 if File . file? "Dockerfile"
@@ -75,14 +74,14 @@ def build_docker_image app_dir, project_id
7574 # Copy example Dockerfile and update with correct content
7675 File . open "#{ app_dir } /Dockerfile.example" do |source_file |
7776 File . open "Dockerfile" , "w" do |dest_file |
78- temp_dockerfile = true
7977 base_image_tag = ENV [ "GAE_RUBY_BASE_IMAGE_TAG" ] || "latest"
8078 file_content = source_file . read % {
8179 base_image_tag : base_image_tag
8280 }
83- dest_file . puts file_content
81+ dest_file . write file_content
8482 end
8583 end
84+ temp_dockerfile = true
8685 end
8786
8887 sh "docker build -t #{ image_location } ."
@@ -117,22 +116,21 @@ def deploy_gke_image image_name, image_location
117116
118117 # Create default acceptace_rc.yaml if one doesn't already exist
119118 rc_yaml_file_name = "integration_rc.yaml"
120- temp_rc_yaml = false
121119 if File . file? rc_yaml_file_name
122120 fail "The #{ rc_yaml_file_name } file already exist. Please omit it and " \
123121 "try again."
124122 else
125123 # Copy example yaml file and update with correct content
126124 File . open "integration/integration_rc.yaml.example" do |source_file |
127125 File . open rc_yaml_file_name , "w" do |dest_file |
128- temp_rc_yaml = true
129126 file_content = source_file . read % {
130127 image_name : image_name ,
131128 image_location : image_location
132129 }
133- dest_file . puts file_content
130+ dest_file . write file_content
134131 end
135132 end
133+ temp_rc_yaml = true
136134 end
137135
138136 # Use kubectl to deploy GKE service and validate the GKE pods is running
0 commit comments