You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@community.apache.org by se...@apache.org on 2023/04/22 11:51:42 UTC

[comdev-site] branch exclude-staging created (now d8c8a69)

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

sebb pushed a change to branch exclude-staging
in repository https://gitbox.apache.org/repos/asf/comdev-site.git


      at d8c8a69  Exclude only -staging branches; simplify

This branch includes the following new commits:

     new 5e9471b  Docco
     new d8c8a69  Exclude only -staging branches; simplify

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.



[comdev-site] 01/02: Docco

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

sebb pushed a commit to branch exclude-staging
in repository https://gitbox.apache.org/repos/asf/comdev-site.git

commit 5e9471b72307ff9af528a1629ed39c9eb9276a16
Author: Sebb <se...@apache.org>
AuthorDate: Sat Apr 22 12:25:24 2023 +0100

    Docco
---
 Jenkinsfile | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index 9a7cd9a..582128d 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -31,9 +31,6 @@ pipeline {
         PAGEFIND_HASH = '3e450176562b65359f855c04894ec2c07ffd30a8d08ef4d5812f8d3469d7a58f'
     }
 
-    // TODO should add a pipeline trigger that ignores branches having -staging in their
-    // name, not sure how to do that
-
     stages {
         stage('Prepare') {
             steps {
@@ -117,6 +114,7 @@ pipeline {
             when {
                 allOf {
                     // ignore branches named preview/*-staging to avoid infinite loop..
+                    // WARNING: do not allow '-' in preview source branch names or the loop will return...
                     expression { env.BRANCH_NAME ==~ /preview\/[a-zA-Z0-9_]+$/ }
                 }
             }


[comdev-site] 02/02: Exclude only -staging branches; simplify

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

sebb pushed a commit to branch exclude-staging
in repository https://gitbox.apache.org/repos/asf/comdev-site.git

commit d8c8a69c8b6ea068b5d3ffc2faf0c25e484fb711
Author: Sebb <se...@apache.org>
AuthorDate: Sat Apr 22 12:51:34 2023 +0100

    Exclude only -staging branches; simplify
    
    The current pattern for preventing loops works because it does
    not allow '-' in the branch name. This is a bit restrictived.
    It would be better to exclude all branches ending in '-staging',
    as that agrees with the definition of STAGING_BRANCH
---
 Jenkinsfile | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index 582128d..b534c1c 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -111,11 +111,14 @@ pipeline {
         }
         stage('Staging') {
             // Mostly duplicated from the Deploy branch, there must be a better way...
+            // https://www.jenkins.io/doc/book/pipeline/syntax/#built-in-conditions
+            // branch uses Ant-style patterns by default:
+            // https://ant.apache.org/manual/dirtasks.html#patterns
+            // Exclude branches ending in '-staging'
+            // This agrees with the definition of STAGING_BRANCH
             when {
-                allOf {
-                    // ignore branches named preview/*-staging to avoid infinite loop..
-                    // WARNING: do not allow '-' in preview source branch names or the loop will return...
-                    expression { env.BRANCH_NAME ==~ /preview\/[a-zA-Z0-9_]+$/ }
+                not {
+                  branch '**/*-staging'
                 }
             }
             steps {