Skip to content
Snippets Groups Projects
Commit e6222ac9 authored by Vincent Massol's avatar Vincent Massol
Browse files

[Misc] Add all xwiki system properties as custom data in GE + tag some of them

parent 7627a560
No related branches found
No related tags found
No related merge requests found
......@@ -29,6 +29,6 @@
<extension>
<groupId>com.gradle</groupId>
<artifactId>common-custom-user-data-maven-extension</artifactId>
<version>1.9</version>
<version>1.10.1</version>
</extension>
</extensions>
/*
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
import com.gradle.maven.extension.api.scan.BuildScanApi
/**
* Captures the Maven active profiles and add them as tags to the Build Scan. The goal is to make it simpler to
* filter builds on <a href="ge.xwiki.org">https://ge.xwiki.org</a> by filtering on Maven profiles.
*/
BuildScanApi buildScan = session.lookup('com.gradle.maven.extension.api.scan.BuildScanApi')
if (!buildScan) {
return
}
buildScan.executeOnce('tag-profiles') { BuildScanApi buildScanApi ->
// Add all maven profile names as tags
project.activeProfiles.each { buildScanApi.tag(it.id) }
// Add all system properties starting with "xwiki" as custom values
project.properties.find { it.key.startsWith('xwiki') }.each { buildScanApi.value(it.key, it.value) }
// Add specific tags to make it easy to recognize with wich environment a docker functional tests has been executed
def servletContainer = project.properties.'xwiki.test.ui.servletEngine'.toLowerCase()
def servletContainerTag = project.properties.'xwiki.test.ui.servletEngineTag'.toLowerCase()
if (servletContainer && servletContainerTag) {
buildScanApi.tag("${servletContainer} ${servletContainerTag}")
}
def database = project.properties.'xwiki.test.ui.database'.toLowerCase()
def databaseTag = project.properties.'xwiki.test.ui.databaseTag'.toLowerCase()
if (database && databaseTag) {
buildScanApi.tag("${database} ${databaseTag}")
}
def browser = project.properties.'xwiki.test.ui.browser'.toLowerCase()
if (browser) {
buildScanApi.tag(browser)
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment