You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by vy...@apache.org on 2024/04/11 07:15:52 UTC

(logging-parent) branch main updated (3704738 -> fa749e8)

This is an automated email from the ASF dual-hosted git repository.

vy pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/logging-parent.git


    from 3704738  Import the GPG private key in `deploy-site-reusable.yaml`
     new 3f4b0d0  Remove incorrect `staging:` entry from `.asf.yaml`
     new fa749e8  Support `.asf.yaml` customization in `deploy-site-reusable.yaml`

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .asf.yaml                                   |  5 ---
 .github/workflows/build.yaml                |  5 +++
 .github/workflows/deploy-site-reusable.yaml | 49 +++++++++++++++++------------
 3 files changed, 34 insertions(+), 25 deletions(-)


(logging-parent) 01/02: Remove incorrect `staging:` entry from `.asf.yaml`

Posted by vy...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

vy pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/logging-parent.git

commit 3f4b0d0a51583b0ac414bc01e31f8c1a61a55abd
Author: Volkan Yazıcı <vo...@yazi.ci>
AuthorDate: Thu Apr 11 09:05:23 2024 +0200

    Remove incorrect `staging:` entry from `.asf.yaml`
---
 .asf.yaml | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/.asf.yaml b/.asf.yaml
index 791f865..665bc95 100644
--- a/.asf.yaml
+++ b/.asf.yaml
@@ -36,8 +36,3 @@ github:
       required_signatures: true
     asf-site:
       required_signatures: true
-
-staging:
-  profile: ~
-  whoami: main-site-stg
-  subdir: content/logging-parent


(logging-parent) 02/02: Support `.asf.yaml` customization in `deploy-site-reusable.yaml`

Posted by vy...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

vy pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/logging-parent.git

commit fa749e8f7684099d976df35cb2f7cd0a489db2e6
Author: Volkan Yazıcı <vo...@yazi.ci>
AuthorDate: Thu Apr 11 09:15:32 2024 +0200

    Support `.asf.yaml` customization in `deploy-site-reusable.yaml`
---
 .github/workflows/build.yaml                |  5 +++
 .github/workflows/deploy-site-reusable.yaml | 49 +++++++++++++++++------------
 2 files changed, 34 insertions(+), 20 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 4d6c343..9e5b1f6 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -59,6 +59,11 @@ jobs:
     permissions:
       contents: write
     with:
+      asf-yaml-content: |
+        staging:
+          profile: ~
+          whoami: main-site-stg
+          subdir: content/logging-parent
       target-branch: main-site-stg
 
   deploy-snapshot:
diff --git a/.github/workflows/deploy-site-reusable.yaml b/.github/workflows/deploy-site-reusable.yaml
index 0f80326..4225189 100644
--- a/.github/workflows/deploy-site-reusable.yaml
+++ b/.github/workflows/deploy-site-reusable.yaml
@@ -20,6 +20,10 @@ name: deploy-site-reusable
 on:
   workflow_call:
     inputs:
+      asf-yaml-content:
+        description: The contents of the `.asf.yaml` that will be created
+        required: true
+        type: string
       java-version:
         description: The Java compiler version
         default: 17
@@ -124,11 +128,11 @@ jobs:
         shell: bash
         env:
           TARGET_PATH: ${{ inputs.target-path }}
+          ASF_YAML_CONTENT: ${{ inputs.asf-yaml-content }}
         run: |
 
-          # Check if there exist an INFRA fix file
-          INFRA_FIX_FILENAME=".asf-infra-fix"
-          INFRA_FIX_FILE_EXISTS=$([ -f "$INFRA_FIX_FILENAME" ] && echo "true" || echo "false")
+          # Check if there already exists an `.asf.yaml`
+          ASF_YAML_EXISTS=$([ -f .asf.yaml ] && echo "true" || echo "false")
 
           # Clean up the target path
           if [ "." = "$TARGET_PATH" ]; then
@@ -141,10 +145,11 @@ jobs:
           unzip /tmp/site.zip -d "$TARGET_PATH"
           git add "$TARGET_PATH"
 
-          # Recover INFRA fix file, if there was one.
+          # Recover `.asf.yaml`, if there was one.
           # Otherwise `git status` will always show a change even when there are no changes in the website content.
-          if [ "$INFRA_FIX_FILE_EXISTS" = "true" ]; then
-            git checkout HEAD "$INFRA_FIX_FILENAME"
+          # That is because we always populate `.asf.yaml` with some random values at the end to fix an INFRA issue.
+          if [ "$ASF_YAML_EXISTS" = "true" ]; then
+            git checkout HEAD .asf.yaml
           fi
 
           # Commit changes, if there are any
@@ -154,24 +159,28 @@ jobs:
             git config user.name "ASF Logging Services RM"
             git config user.email private@logging.apache.org
 
-            # Commit site changes
+            # Commit & push site changes
             git commit -S -a -m "Add website content generated from \`$SOURCE_COMMIT_ID\`"
+            git push -f origin
 
-            # INFRA fix
-            cat >"$INFRA_FIX_FILENAME" <<EOF
-          INFRA cannot handle change sets bigger than a certain size: https://the-asf.slack.com/archives/CBX4TSBQ8/p1709724983391709
-          This file will be used to push a small commit to help the INFRA to recover.
-
-          Random values to cause a change:
-
-          - Seed: $RANDOM
-          - Commit ID: $SOURCE_COMMIT_ID
-          - Timestamp: $(date --utc '+%Y-%m-%dT%H:%M:%SZ')
+            # Populate `.asf.yaml`
+            cat >.asf.yaml <<EOF
+          $ASF_YAML_CONTENT
+
+          # INFRA cannot handle change sets bigger than a certain size: https://the-asf.slack.com/archives/CBX4TSBQ8/p1709724983391709
+          # This file will be used to push a small commit to help the INFRA to recover.
+          #
+          # Random values to cause a change:
+          #
+          # - Seed: $RANDOM
+          # - Commit ID: $SOURCE_COMMIT_ID
+          # - Timestamp: $(date --utc '+%Y-%m-%dT%H:%M:%SZ')
           EOF
-            git add "$INFRA_FIX_FILENAME"
-            git commit -S "$INFRA_FIX_FILENAME" -m "Add INFRA fix for the website content generated from \`$SOURCE_COMMIT_ID\`"
+            git add .asf.yaml
+            git commit -S .asf.yaml -m "Add `.asf.yaml` along with an INFRA fix for the website content generated from \`$SOURCE_COMMIT_ID\`"
 
-            # Push changes
+            # Push changes *separately*!
+            # A separate small commit push necessary due to the INFRA issue explained above.
             git push -f origin
 
           fi