benWize commented on code in PR #23405:
URL: https://github.com/apache/beam/pull/23405#discussion_r996075360


##########
website/build.gradle:
##########
@@ -346,17 +376,26 @@ publishWebsite.dependsOn commitWebsite
  *   ./gradlew :website:stageWebsite -PwebsiteBucket=foo
  */
 task stageWebsite {
+  finalizedBy stopAndRemoveDockerContainer
   doLast {
     def baseUrl = getBaseUrl()
     assert baseUrl : 'Website staging requires a valid baseUrl'
     def gcs_bucket = project.findProperty('websiteBucket') ?: 
'apache-beam-website-pull-requests'
     def gcs_path = "gs://${gcs_bucket}/${baseUrl}"
 
     // Fixup the links to index.html files
-    shell ". ${envdir}/bin/activate && python 
append_index_html_to_internal_links.py ${buildContentDir('gcs')}"
+    exec {
+      commandLine 'docker', 'exec', '--workdir', "$dockerWorkDir/website",
+              "${->startDockerContainer.containerId()}", '/bin/bash', '-c',
+              """. ${envdir}/bin/activate && python 
append_index_html_to_internal_links.py ${buildContentDir('gcs', ".")} """
+    }
 
     // Copy the build website to GCS
-    shell "gsutil -m rsync -r -d ${buildContentDir('gcs')} ${gcs_path}"
+    exec {
+      commandLine 'docker', 'exec', '--workdir', "$dockerWorkDir",
+              "${->startDockerContainer.containerId()}", '/bin/bash', '-c',
+              """gsutil -m rsync -r -d ${buildContentDir('gcs', ".")} 
${gcs_path}"""
+    }

Review Comment:
   Because of some failures when mounting the volume, the website build files 
only exist inside the container and not in the host, so we complete the 
uploading to GCS step inside the container.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to