You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by ma...@apache.org on 2020/07/19 18:54:34 UTC

[logging-pipelines] branch master created (now 7bbfbad)

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

mattsicker pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/logging-pipelines.git.


      at 7bbfbad  Import latest pipelines from repositories

This branch includes the following new commits:

     new 7bbfbad  Import latest pipelines from repositories

The 1 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.



[logging-pipelines] 01/01: Import latest pipelines from repositories

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

mattsicker pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/logging-pipelines.git

commit 7bbfbad777c732a1f8e1096ad4c67e727f1df182
Author: Matt Sicker <bo...@gmail.com>
AuthorDate: Sun Jul 19 13:51:30 2020 -0500

    Import latest pipelines from repositories
---
 README.md            |   4 ++
 audit/Jenkinsfile    |  61 ++++++++++++++++++++++
 chainsaw/Jenkinsfile |  68 +++++++++++++++++++++++++
 kotlin/Jenkinsfile   |  61 ++++++++++++++++++++++
 log4j/Jenkinsfile    | 140 +++++++++++++++++++++++++++++++++++++++++++++++++++
 parent/Jenkinsfile   |  42 ++++++++++++++++
 scala/Jenkinsfile    |  72 ++++++++++++++++++++++++++
 7 files changed, 448 insertions(+)

diff --git a/README.md b/README.md
new file mode 100644
index 0000000..68d9239
--- /dev/null
+++ b/README.md
@@ -0,0 +1,4 @@
+# Apache Logging Services Jenkins Pipelines
+
+This repository is a centralized collection of [Jenkins pipelines](https://www.jenkins.io/doc/book/pipeline/) used in the [Apache Logging Services](https://logging.apache.org/) project.
+These pipelines are located on [ci-builds.apache.org](https://ci-builds.apache.org/job/Logging/).
diff --git a/audit/Jenkinsfile b/audit/Jenkinsfile
new file mode 100644
index 0000000..a68a6e1
--- /dev/null
+++ b/audit/Jenkinsfile
@@ -0,0 +1,61 @@
+#!groovy
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+pipeline {
+    agent {
+        label 'ubuntu'
+    }
+    tools {
+        maven 'Maven 3 (latest)'
+        jdk 'JDK 1.8 (latest)'
+    }
+    options {
+        ansiColor 'xterm'
+        buildDiscarder logRotator(numToKeepStr: '25')
+        timeout time: 1, unit: 'HOURS'
+    }
+    stages {
+        stage('Build') {
+            steps {
+                sh 'mvn install'
+            }
+        }
+        stage('Deploy') {
+            when {
+                branch 'master'
+            }
+            steps {
+                sh 'mvn deploy'
+            }
+            post {
+                fixed {
+                    emailext to: 'notifications@logging.apache.org',
+                        from: 'Mr. Jenkins <je...@ci-builds.apache.org>',
+                        subject: "[CI][SUCCESS] ${env.JOB_NAME}#${env.BUILD_NUMBER} back to normal",
+                        body: '${SCRIPT, template="groovy-text.template"}'
+                }
+                failure {
+                    emailext to: 'notifications@logging.apache.org',
+                        from: 'Mr. Jenkins <je...@ci-builds.apache.org>',
+                        subject: "[CI][FAILURE] ${env.JOB_NAME}#${env.BUILD_NUMBER} has potential issues",
+                        body: '${SCRIPT, template="groovy-text.template"}'
+                }
+            }
+        }
+    }
+}
diff --git a/chainsaw/Jenkinsfile b/chainsaw/Jenkinsfile
new file mode 100644
index 0000000..9e35adb
--- /dev/null
+++ b/chainsaw/Jenkinsfile
@@ -0,0 +1,68 @@
+#!groovy
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+pipeline {
+    agent {
+        label 'ubuntu'
+    }
+    tools {
+        maven 'Maven 3 (latest)'
+        jdk 'JDK 1.8 (latest)'
+    }
+    options {
+        ansiColor 'xterm'
+        buildDiscarder logRotator(numToKeepStr: '25')
+        timeout time: 1, unit: 'HOURS'
+    }
+    stages {
+        stage('Build') {
+            steps {
+                sh '''
+                mvn -Pdevelopment site:site
+                mvn -Pdevelopment install
+                '''
+                junit '**/target/surefire-reports/*.xml'
+            }
+        }
+        stage('Deploy') {
+            when {
+                branch 'master'
+            }
+            steps {
+                sh 'mvn -Pdevelopment deploy'
+            }
+            post {
+                fixed {
+                    emailext to: 'notifications@logging.apache.org',
+                        from: 'Mr. Jenkins <je...@ci-builds.apache.org>',
+                        subject: "[CI][SUCCESS] ${env.JOB_NAME}#${env.BUILD_NUMBER} back to normal",
+                        body: '${SCRIPT, template="groovy-text.template"}'
+                }
+                failure {
+                    emailext to: 'notifications@logging.apache.org',
+                        from: 'Mr. Jenkins <je...@ci-builds.apache.org>',
+                        subject: "[CI][FAILURE] ${env.JOB_NAME}#${env.BUILD_NUMBER} has potential issues",
+                        body: '${SCRIPT, template="groovy-text.template"}'
+                }
+            }
+        }
+    }
+}
+
diff --git a/kotlin/Jenkinsfile b/kotlin/Jenkinsfile
new file mode 100644
index 0000000..a68a6e1
--- /dev/null
+++ b/kotlin/Jenkinsfile
@@ -0,0 +1,61 @@
+#!groovy
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+pipeline {
+    agent {
+        label 'ubuntu'
+    }
+    tools {
+        maven 'Maven 3 (latest)'
+        jdk 'JDK 1.8 (latest)'
+    }
+    options {
+        ansiColor 'xterm'
+        buildDiscarder logRotator(numToKeepStr: '25')
+        timeout time: 1, unit: 'HOURS'
+    }
+    stages {
+        stage('Build') {
+            steps {
+                sh 'mvn install'
+            }
+        }
+        stage('Deploy') {
+            when {
+                branch 'master'
+            }
+            steps {
+                sh 'mvn deploy'
+            }
+            post {
+                fixed {
+                    emailext to: 'notifications@logging.apache.org',
+                        from: 'Mr. Jenkins <je...@ci-builds.apache.org>',
+                        subject: "[CI][SUCCESS] ${env.JOB_NAME}#${env.BUILD_NUMBER} back to normal",
+                        body: '${SCRIPT, template="groovy-text.template"}'
+                }
+                failure {
+                    emailext to: 'notifications@logging.apache.org',
+                        from: 'Mr. Jenkins <je...@ci-builds.apache.org>',
+                        subject: "[CI][FAILURE] ${env.JOB_NAME}#${env.BUILD_NUMBER} has potential issues",
+                        body: '${SCRIPT, template="groovy-text.template"}'
+                }
+            }
+        }
+    }
+}
diff --git a/log4j/Jenkinsfile b/log4j/Jenkinsfile
new file mode 100644
index 0000000..204bd4a
--- /dev/null
+++ b/log4j/Jenkinsfile
@@ -0,0 +1,140 @@
+#!groovy
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// =================================================================
+// https://cwiki.apache.org/confluence/display/LOGGING/Jenkins+Setup
+// =================================================================
+
+// general pipeline documentation: https://jenkins.io/doc/book/pipeline/syntax/
+pipeline {
+    // https://jenkins.io/doc/book/pipeline/syntax/#options
+    options {
+        // support ANSI colors in stdout/stderr
+        ansiColor 'xterm'
+        // only keep the latest 10 builds
+        buildDiscarder logRotator(numToKeepStr: '10')
+        // cancel build if not complete within two hours of scheduling
+        timeout time: 2, unit: 'HOURS'
+        // fail parallel stages as soon as any of them fail
+        parallelsAlwaysFailFast()
+    }
+    triggers {
+        // TODO: this can be removed once gitbox webhooks are re-enabled
+        pollSCM 'H/5 * * * *'
+    }
+
+    // https://jenkins.io/doc/book/pipeline/syntax/#agent
+    // start with no Jenkins agent allocated as they will only be needed for the individual stages
+    // therefore, anything in the top level post section can only contain steps that don't require a Jenkins agent
+    // (such as slackSend, mail, etc.)
+    agent none
+    stages {
+        stage('Continuous Integration') {
+            // https://jenkins.io/doc/book/pipeline/syntax/#parallel
+            parallel {
+                stage('Ubuntu') {
+                    agent {
+                        // https://cwiki.apache.org/confluence/display/INFRA/Jenkins+node+labels
+                        label 'ubuntu'
+                    }
+                    // https://jenkins.io/doc/book/pipeline/syntax/#tools
+                    tools {
+                        // https://cwiki.apache.org/confluence/display/INFRA/JDK+Installation+Matrix
+                        jdk 'JDK 1.8 (latest)'
+                        // https://cwiki.apache.org/confluence/display/INFRA/Maven+Installation+Matrix
+                        maven 'Maven 3 (latest)'
+                    }
+                    // https://jenkins.io/doc/book/pipeline/syntax/#environment
+                    environment {
+                        LANG = 'C.UTF-8'
+                    }
+                    steps {
+                        // https://issues.jenkins-ci.org/browse/JENKINS-43353
+                        script {
+                            def buildNumber = BUILD_NUMBER as int
+                            if (buildNumber > 1) milestone(buildNumber - 1)
+                            milestone(buildNumber)
+                        }
+                        // build, test, and deploy snapshots
+                        // note that the jenkins system property is set here to activate certain pom properties in
+                        // some log4j modules that compile against system jars (e.g., log4j-jmx-gui)
+                        // also note that the Jenkins agents on builds.a.o already have an ~/.m2/settings.xml for snapshots
+                        sh 'mvn --show-version --fail-at-end --toolchains toolchains-jenkins-ubuntu.xml -Djenkins clean install deploy'
+                    }
+                    post {
+                        always {
+                            // record linux run of tests
+                            junit '**/*-reports/*.xml'
+                            // additional warnings generated during build
+                            // TODO: would be nice to be able to include checkstyle, cpd, pmd, and spotbugs,
+                            //       but current site build takes too long
+                            recordIssues enabledForFailure: true,
+                                    sourceCodeEncoding: 'UTF-8',
+                                    referenceJobName: 'log4j/master',
+                                    tools: [mavenConsole(), errorProne(), java(),
+                                            taskScanner(highTags: 'FIXME', normalTags: 'TODO', includePattern: '**/*.java', excludePattern: '*/target/**')]
+                        }
+                    }
+                }
+                stage('Windows') {
+                    agent {
+                        // https://cwiki.apache.org/confluence/display/INFRA/Jenkins+node+labels
+                        label 'Windows'
+                    }
+                    tools {
+                        // https://cwiki.apache.org/confluence/display/INFRA/JDK+Installation+Matrix
+                        jdk 'JDK 1.8 (latest)'
+                        // https://cwiki.apache.org/confluence/display/INFRA/Maven+Installation+Matrix
+                        maven 'Maven 3 (latest)'
+                    }
+                    environment {
+                        LANG = 'C.UTF-8'
+                    }
+                    steps {
+                        // note that previous test runs of log4j-mongodb* may have left behind an embedded mongo folder
+                        // also note that we don't need to use the jenkins system property here as it's ubuntu-specific
+                        bat '''
+                    if exist %userprofile%\\.embedmongo\\ rd /s /q %userprofile%\\.embedmongo
+                    mvn --show-version --fail-at-end --toolchains toolchains-jenkins-win.xml clean install
+                    '''
+                    }
+                    post {
+                        always {
+                            // record windows run of tests
+                            junit '**/*-reports/*.xml'
+                        }
+                    }
+                }
+            }
+        }
+    }
+    post {
+        fixed {
+            emailext to: 'notifications@logging.apache.org',
+                from: 'Mr. Jenkins <je...@ci-builds.apache.org>',
+                subject: "[CI][SUCCESS] ${env.JOB_NAME}#${env.BUILD_NUMBER} back to normal",
+                body: '${SCRIPT, template="groovy-text.template"}'
+        }
+        failure {
+            emailext to: 'notifications@logging.apache.org',
+                from: 'Mr. Jenkins <je...@ci-builds.apache.org>',
+                subject: "[CI][FAILURE] ${env.JOB_NAME}#${env.BUILD_NUMBER} has potential issues",
+                body: '${SCRIPT, template="groovy-text.template"}'
+        }
+    }
+}
diff --git a/parent/Jenkinsfile b/parent/Jenkinsfile
new file mode 100644
index 0000000..2a7d4f5
--- /dev/null
+++ b/parent/Jenkinsfile
@@ -0,0 +1,42 @@
+#!groovy
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+pipeline {
+    agent {
+        label 'ubuntu'
+    }
+    tools {
+        maven 'Maven 3 (latest)'
+        jdk 'JDK 1.8 (latest)'
+    }
+    options {
+        ansiColor 'xterm'
+        buildDiscarder logRotator(numToKeepStr: '10')
+        timeout time: 5, unit: 'MINUTES'
+    }
+    stages {
+        stage('Deploy') {
+            steps {
+                sh 'mvn deploy'
+            }
+        }
+    }
+}
+
diff --git a/scala/Jenkinsfile b/scala/Jenkinsfile
new file mode 100644
index 0000000..1d277f6
--- /dev/null
+++ b/scala/Jenkinsfile
@@ -0,0 +1,72 @@
+#!groovy
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+pipeline {
+    agent {
+        label 'ubuntu'
+    }
+    tools {
+        jdk 'JDK 1.8 (latest)'
+    }
+    options {
+        ansiColor 'xterm'
+        buildDiscarder logRotator(numToKeepStr: '25')
+        timeout time: 1, unit: 'HOURS'
+    }
+    stages {
+        stage('Build') {
+            steps {
+                sh './sbt -batch auditCheck'
+                sh './sbt -batch "+ compile"'
+            }
+        }
+        stage('Test') {
+            steps {
+                sh './sbt -batch Test/auditCheck'
+                sh './sbt -batch "+ test"'
+            }
+        }
+        stage('Deploy') {
+            when {
+                anyOf {
+                    branch 'master'
+                }
+            }
+            environment {
+                NEXUS = credentials('logging-snapshots')
+            }
+            steps {
+                sh './sbt -batch "+ publish"'
+            }
+            post {
+                fixed {
+                    emailext to: 'notifications@logging.apache.org',
+                        from: 'Mr. Jenkins <je...@ci-builds.apache.org>',
+                        subject: "[CI][SUCCESS] ${env.JOB_NAME}#${env.BUILD_NUMBER} back to normal",
+                        body: '${SCRIPT, template="groovy-text.template"}'
+                }
+                failure {
+                    emailext to: 'notifications@logging.apache.org',
+                        from: 'Mr. Jenkins <je...@ci-builds.apache.org>',
+                        subject: "[CI][FAILURE] ${env.JOB_NAME}#${env.BUILD_NUMBER} has potential issues",
+                        body: '${SCRIPT, template="groovy-text.template"}'
+                }
+            }
+        }
+    }
+}