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


##########
website/build.gradle:
##########
@@ -80,10 +80,10 @@ task createDockerContainer(type: Exec) {
     } else {
       // Otherwise: run as current user, so as to not require sudo to clean up
       // build/ directory.
-      extraOptions += " -u \$(id -u):\$(id -g)"
+      extraOptions += " -u 0:0"

Review Comment:
   Is this safe? Why are we making this change?



##########
website/build.gradle:
##########
@@ -80,10 +80,10 @@ task createDockerContainer(type: Exec) {
     } else {
       // Otherwise: run as current user, so as to not require sudo to clean up
       // build/ directory.
-      extraOptions += " -u \$(id -u):\$(id -g)"
+      extraOptions += " -u 0:0"
     }
     commandLine '/bin/bash', '-c',
-      "docker create -v $project.rootDir:$dockerWorkDir $extraOptions 
$dockerImageTag sh -c 'trap \"exit 0\" INT; while true; do sleep 30; done;'"

Review Comment:
   Why are we removing the work dir here?



##########
website/build.gradle:
##########
@@ -230,13 +259,13 @@ def getBranchRepo() {
   return "apache/beam/blob/master"
 }
 
-def buildContentDir(name) {
-  "${project.rootDir}/build/website/generated-${name.toLowerCase()}-content"
+def buildContentDir(name, dir = project.rootDir) {
+  "${dir}/build/website/generated-${name.toLowerCase()}-content"
 }
 
 task serveWebsite(type: Exec) {
   dependsOn setupDockerContainer
-  finalizedBy stopAndRemoveDockerContainer
+//  finalizedBy stopAndRemoveDockerContainer

Review Comment:
   Why don't we need this anymore? And why do we need it below?



##########
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:
   Why are we making these changes?



##########
website/Dockerfile:
##########
@@ -69,4 +69,26 @@ RUN HUGOHOME="$(mktemp -d)" \
     && chmod +x /usr/local/bin/hugo \
     && rm -r "${HUGOHOME}"
 
+
+# Install gcloud
+# Make sure that your operating system meets the requirements

Review Comment:
   Why do we need changes to the docker image?



##########
website/build.gradle:
##########
@@ -115,9 +115,39 @@ task buildCodeSamples(type: Exec) {
               "${->startDockerContainer.containerId()}", 'yarn', 
'build_code_samples'
 }
 
+task cloneRepository(type: Exec) {
+  def branch = System.getenv('ghBranch') ?  System.getenv('ghBranch'):
+          grgit ? grgit.branch.current().getName(): 'master'
+  def repositoryUrl = System.getenv('repositoryUrl') ? 
"https://github.com/${System.getenv('repositoryUrl')}" :

Review Comment:
   Will this ever not just be apache/beam?



-- 
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