MartijnVisser commented on code in PR #29294:
URL: https://github.com/apache/flink/pull/29294#discussion_r4107438972


##########
.github/workflows/docs-legacy.yml:
##########
@@ -76,20 +76,24 @@ jobs:
             bash -c "./build_docs.sh"
 
       - name: Build documentation
+        # The build runs as root, the upload below as the runner user, hence 
the chmod
         run: |
           docker run --rm \
             --volume "$PWD:/root/flink" \
             --volume "$HOME/.m2/repository:/root/.m2/repository" \
             apache/flink-ci-docker:java_8_11_17_21_25_maven_386_3916_noble \
-            bash -c "apt-get update && apt-get install -y rsync && cd 
/root/flink && ./.github/workflows/docs.sh"
+            bash -c "apt-get update && apt-get install -y rsync && cd 
/root/flink && ./.github/workflows/docs.sh && chmod -R a+rX docs/target"
 
       - name: Upload documentation
-        uses: 
burnett01/rsync-deployments@66257cad6bfeb2171d3b6bfa6c9a22279dd9c3a1 # 8.0.5
-        with:
-          switches: --archive --compress --delete --omit-dir-times
-          path: docs/target/
-          remote_path: ${{ secrets.NIGHTLIES_RSYNC_PATH 
}}/flink/flink-docs-${{ env.flink_branch }}/
-          remote_host: ${{ secrets.NIGHTLIES_RSYNC_HOST }}
-          remote_port: ${{ secrets.NIGHTLIES_RSYNC_PORT }}
-          remote_user: ${{ secrets.NIGHTLIES_RSYNC_USER }}
-          remote_key: ${{ secrets.NIGHTLIES_RSYNC_KEY }}
+        env:
+          NIGHTLIES_RSYNC_HOST: ${{ secrets.NIGHTLIES_RSYNC_HOST }}
+          NIGHTLIES_RSYNC_KEY: ${{ secrets.NIGHTLIES_RSYNC_KEY }}
+          NIGHTLIES_RSYNC_PATH: ${{ secrets.NIGHTLIES_RSYNC_PATH }}
+          NIGHTLIES_RSYNC_PORT: ${{ secrets.NIGHTLIES_RSYNC_PORT }}
+          NIGHTLIES_RSYNC_USER: ${{ secrets.NIGHTLIES_RSYNC_USER }}
+        run: |
+          eval "$(ssh-agent -s)"
+          ssh-add - <<< "${NIGHTLIES_RSYNC_KEY}"

Review Comment:
   I've switched to `printf ... | ssh-add -` (it needs the dash to read stdin). 
Bash 5.2 already pipes a here-string this small, but now we don't rely on that.



##########
.github/workflows/docs-legacy.yml:
##########
@@ -76,20 +76,24 @@ jobs:
             bash -c "./build_docs.sh"
 
       - name: Build documentation
+        # The build runs as root, the upload below as the runner user, hence 
the chmod
         run: |
           docker run --rm \
             --volume "$PWD:/root/flink" \
             --volume "$HOME/.m2/repository:/root/.m2/repository" \
             apache/flink-ci-docker:java_8_11_17_21_25_maven_386_3916_noble \
-            bash -c "apt-get update && apt-get install -y rsync && cd 
/root/flink && ./.github/workflows/docs.sh"
+            bash -c "apt-get update && apt-get install -y rsync && cd 
/root/flink && ./.github/workflows/docs.sh && chmod -R a+rX docs/target"

Review Comment:
   Both work here. I would keep `chmod` since it doesn't depend on `$(id -u)` 
being expanded by the outer shell before docker runs.



##########
.github/workflows/docs-legacy.yml:
##########
@@ -76,20 +76,24 @@ jobs:
             bash -c "./build_docs.sh"
 
       - name: Build documentation
+        # The build runs as root, the upload below as the runner user, hence 
the chmod
         run: |
           docker run --rm \
             --volume "$PWD:/root/flink" \
             --volume "$HOME/.m2/repository:/root/.m2/repository" \
             apache/flink-ci-docker:java_8_11_17_21_25_maven_386_3916_noble \
-            bash -c "apt-get update && apt-get install -y rsync && cd 
/root/flink && ./.github/workflows/docs.sh"
+            bash -c "apt-get update && apt-get install -y rsync && cd 
/root/flink && ./.github/workflows/docs.sh && chmod -R a+rX docs/target"
 
       - name: Upload documentation
-        uses: 
burnett01/rsync-deployments@66257cad6bfeb2171d3b6bfa6c9a22279dd9c3a1 # 8.0.5
-        with:
-          switches: --archive --compress --delete --omit-dir-times
-          path: docs/target/
-          remote_path: ${{ secrets.NIGHTLIES_RSYNC_PATH 
}}/flink/flink-docs-${{ env.flink_branch }}/
-          remote_host: ${{ secrets.NIGHTLIES_RSYNC_HOST }}
-          remote_port: ${{ secrets.NIGHTLIES_RSYNC_PORT }}
-          remote_user: ${{ secrets.NIGHTLIES_RSYNC_USER }}
-          remote_key: ${{ secrets.NIGHTLIES_RSYNC_KEY }}
+        env:
+          NIGHTLIES_RSYNC_HOST: ${{ secrets.NIGHTLIES_RSYNC_HOST }}
+          NIGHTLIES_RSYNC_KEY: ${{ secrets.NIGHTLIES_RSYNC_KEY }}
+          NIGHTLIES_RSYNC_PATH: ${{ secrets.NIGHTLIES_RSYNC_PATH }}
+          NIGHTLIES_RSYNC_PORT: ${{ secrets.NIGHTLIES_RSYNC_PORT }}
+          NIGHTLIES_RSYNC_USER: ${{ secrets.NIGHTLIES_RSYNC_USER }}
+        run: |
+          eval "$(ssh-agent -s)"

Review Comment:
   Yes. I can't see the host and port secrets to check which key to pin, and a 
wrong pin only fails after merge, so I would do that in 
https://issues.apache.org/jira/browse/FLINK-40811.



##########
.github/workflows/docs.yml:
##########
@@ -66,32 +66,31 @@ jobs:
             ${{ runner.os }}-maven-docs-
 
       - name: Build documentation
+        # The build runs as root, the upload below as the runner user, hence 
the chmod
         run: |
           docker run --rm \
             --volume "$PWD:/root/flink" \
             --volume "$HOME/.m2/repository:/root/.m2/repository" \
             apache/flink-ci-docker:java_8_11_17_21_25_maven_386_3916_noble \
-            bash -c "cd /root/flink && ./.github/workflows/docs.sh"
+            bash -c "cd /root/flink && ./.github/workflows/docs.sh && chmod -R 
a+rX docs/target"
 
       - name: Upload documentation
-        uses: 
burnett01/rsync-deployments@66257cad6bfeb2171d3b6bfa6c9a22279dd9c3a1 # 8.0.5
-        with:
-          switches: --archive --compress --delete
-          path: docs/target/
-          remote_path: ${{ secrets.NIGHTLIES_RSYNC_PATH 
}}/flink/flink-docs-${{ env.flink_branch }}/
-          remote_host: ${{ secrets.NIGHTLIES_RSYNC_HOST }}
-          remote_port: ${{ secrets.NIGHTLIES_RSYNC_PORT }}
-          remote_user: ${{ secrets.NIGHTLIES_RSYNC_USER }}
-          remote_key: ${{ secrets.NIGHTLIES_RSYNC_KEY }}
-
-      - name: Upload documentation alias
-        if: env.flink_alias != ''
-        uses: 
burnett01/rsync-deployments@66257cad6bfeb2171d3b6bfa6c9a22279dd9c3a1 # 8.0.5
-        with:
-          switches: --archive --compress --delete
-          path: docs/target/
-          remote_path: ${{ secrets.NIGHTLIES_RSYNC_PATH 
}}/flink/flink-docs-${{ env.flink_alias }}/
-          remote_host: ${{ secrets.NIGHTLIES_RSYNC_HOST }}
-          remote_port: ${{ secrets.NIGHTLIES_RSYNC_PORT }}
-          remote_user: ${{ secrets.NIGHTLIES_RSYNC_USER }}
-          remote_key: ${{ secrets.NIGHTLIES_RSYNC_KEY }}
+        env:
+          NIGHTLIES_RSYNC_HOST: ${{ secrets.NIGHTLIES_RSYNC_HOST }}
+          NIGHTLIES_RSYNC_KEY: ${{ secrets.NIGHTLIES_RSYNC_KEY }}
+          NIGHTLIES_RSYNC_PATH: ${{ secrets.NIGHTLIES_RSYNC_PATH }}
+          NIGHTLIES_RSYNC_PORT: ${{ secrets.NIGHTLIES_RSYNC_PORT }}
+          NIGHTLIES_RSYNC_USER: ${{ secrets.NIGHTLIES_RSYNC_USER }}
+        run: |
+          eval "$(ssh-agent -s)"

Review Comment:
   I've added an EXIT trap with `ssh-agent -k`, so it also stops when rsync 
fails.



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