Copy from Atlas Autobuild scripts as a starting point
This commit is contained in:
parent
b9a22c1989
commit
2d66e342df
92 changed files with 11897 additions and 0 deletions
119
Common_scripts/staticanalysis/ccm.groovy
Normal file
119
Common_scripts/staticanalysis/ccm.groovy
Normal file
|
|
@ -0,0 +1,119 @@
|
|||
pipeline {
|
||||
agent { label "${AGENT_LABEL}" }
|
||||
stages {
|
||||
stage('Initial setup') {
|
||||
steps {
|
||||
script {
|
||||
meta = load("${WORKSPACE}/autobuild/Common_scripts/autobuilder.groovy").startnonbuild(this)
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Checkout dependencies') {
|
||||
steps {
|
||||
script {
|
||||
configurationhelper = autobuilder.configurationhelper()
|
||||
|
||||
PYTHONURL = 'git@hydra:tools/python.git'
|
||||
PYTHONBRANCH = 'origin/3.6.3_windows'
|
||||
PYTHONDIR = "${WORKSPACE}/python"
|
||||
configurationhelper.gitCheckoutAndRegister(meta, 'python', PYTHONURL, PYTHONBRANCH, PYTHONDIR)
|
||||
env.PYTHON = "${PYTHONDIR}/ver/python.exe"
|
||||
|
||||
CCMURL = 'git@hydra:tools/ccm.git'
|
||||
CCMBRANCH = 'origin/master'
|
||||
CCMDIR = "${WORKSPACE}/ccm"
|
||||
configurationhelper.gitCheckoutAndRegister(meta, 'ccm', CCMURL, CCMBRANCH, CCMDIR)
|
||||
CCM = "${CCMDIR}/bin/CCM.exe"
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Checkout source') {
|
||||
steps {
|
||||
script {
|
||||
SOURCEREVISION = "${SOURCE_REVISION}"
|
||||
SOURCEDIR = "${WORKSPACE}/source"
|
||||
configurationhelper.gitCheckoutAndRegister(meta, 'source', SOURCEURL, SOURCEREVISION, SOURCEDIR, '', 0, false)
|
||||
SOURCE_PATH = "${SOURCEDIR}"
|
||||
env.SRC = "${SOURCE_PATH}/${SOURCE_OFFSET_PATH}"
|
||||
}
|
||||
}
|
||||
}
|
||||
stage("Clean exports") {
|
||||
steps {
|
||||
script {
|
||||
STATICANALYSIS = 'staticanalysis'
|
||||
cleanfolders = [
|
||||
STATICANALYSIS,
|
||||
]
|
||||
cleaner = load("${autobuilder.commonscripts()}/clean/clean.groovy")
|
||||
cleaner.clean(cleanfolders)
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Generating version info') {
|
||||
steps {
|
||||
script {
|
||||
version = load("${autobuilder.commonscripts()}/versionnumbering/generate.groovy")
|
||||
version.generate(meta, SOURCE_REVISION, SOURCE_PATH)
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Static analysis') {
|
||||
steps {
|
||||
script {
|
||||
def CCMOLDER = "${STATICANALYSIS}/ccm"
|
||||
dir(CCMOLDER) {
|
||||
echo "Executing: ${CCM} ${SRC} /xml /nummetrics=100 > ccm.xml"
|
||||
if (isUnix()) {
|
||||
sh """#!/bin/bash
|
||||
find "${SRC}" -type f ! -name "*.cpp" -a ! -name "*.h" -a ! -name "*.hpp" -a ! -name "*.c" -exec rm -r {} \\;
|
||||
# Uses mono
|
||||
"${CCM}" "${SRC}" /xml /nummetrics=100 > ccm.xml
|
||||
"""
|
||||
} else {
|
||||
bat """
|
||||
"${CCM}" "${SRC}" /xml /nummetrics=100 > ccm.xml
|
||||
"""
|
||||
}
|
||||
}
|
||||
recordIssues(tools: [
|
||||
ccm(pattern: "**/ccm.xml", reportEncoding: 'UTF-8'),
|
||||
])
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Classifying publishable artifacts') {
|
||||
steps {
|
||||
script {
|
||||
def publishable = [
|
||||
]
|
||||
publishutils = load("${autobuilder.commonscripts()}/publishing/utils.groovy")
|
||||
publishutils.generatelist(meta, publishable)
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Archiving artifacts') {
|
||||
steps {
|
||||
script {
|
||||
ArrayList<String> itemsForRelease = ["${STATICANALYSIS}/**"]
|
||||
def artifactlist = meta.generateartifacts(itemsForRelease)
|
||||
archiveArtifacts "${artifactlist}"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
always {
|
||||
echo 'Post-build'
|
||||
}
|
||||
failure {
|
||||
echo 'Failed build'
|
||||
}
|
||||
unstable {
|
||||
echo 'Unstable build'
|
||||
}
|
||||
success {
|
||||
echo 'Succeeded build'
|
||||
}
|
||||
}
|
||||
}
|
||||
151
Common_scripts/staticanalysis/cpd.groovy
Normal file
151
Common_scripts/staticanalysis/cpd.groovy
Normal file
|
|
@ -0,0 +1,151 @@
|
|||
pipeline {
|
||||
agent { label AGENT_LABEL }
|
||||
stages {
|
||||
stage('Initial setup') {
|
||||
steps {
|
||||
script {
|
||||
meta = load("${WORKSPACE}/autobuild/Common_scripts/autobuilder.groovy").startnonbuild(this)
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Checkout dependencies') {
|
||||
steps {
|
||||
script {
|
||||
configurationhelper = autobuilder.configurationhelper()
|
||||
|
||||
PYTHONURL = 'git@hydra:tools/python.git'
|
||||
if (isUnix()) {
|
||||
PYTHONBRANCH = 'origin/3.6.3_linux'
|
||||
} else {
|
||||
PYTHONBRANCH = 'origin/3.6.3_windows'
|
||||
}
|
||||
PYTHONDIR = "${WORKSPACE}/python"
|
||||
configurationhelper.gitCheckoutAndRegister(meta, 'python', PYTHONURL, PYTHONBRANCH, PYTHONDIR)
|
||||
env.PYTHON = "${PYTHONDIR}/ver/python.exe"
|
||||
|
||||
JAVAURL = 'git@hydra:tools/openjdk.git'
|
||||
if (isUnix()) {
|
||||
JAVABRANCH = 'origin/openjdk-11.0.2_linux-x64_bin'
|
||||
} else {
|
||||
JAVABRANCH = 'origin/openjdk-11.0.2_windows-x64_bin'
|
||||
}
|
||||
JAVADIR = "${WORKSPACE}/java"
|
||||
configurationhelper.gitCheckoutAndRegister(meta, 'java', JAVAURL, JAVABRANCH, JAVADIR)
|
||||
JAVA = "${JAVADIR}/ver/bin"
|
||||
if (isUnix()) {
|
||||
env.PATH = JAVA + ':' + PATH
|
||||
} else {
|
||||
env.PATH = JAVA + ';' + PATH
|
||||
}
|
||||
|
||||
PPDURL = 'git@hydra:tools/pmd.git'
|
||||
PPDBRANCH = 'origin/master'
|
||||
PPDDIR = "${WORKSPACE}/ppd"
|
||||
configurationhelper.gitCheckoutAndRegister(meta, 'ppd', PPDURL, PPDBRANCH, PPDDIR)
|
||||
PPD = "${PPDDIR}/bin"
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Checkout source') {
|
||||
steps {
|
||||
script {
|
||||
SOURCEREVISION = "${SOURCE_REVISION}"
|
||||
SOURCEDIR = "${WORKSPACE}/source"
|
||||
configurationhelper.gitCheckoutAndRegister(meta, 'source', SOURCEURL, SOURCEREVISION, SOURCEDIR, '', 0, false)
|
||||
SOURCE_PATH = "${SOURCEDIR}"
|
||||
SRC = "${SOURCE_PATH}"
|
||||
if (SOURCE_OFFSET_PATH) {
|
||||
SRC += "/${SOURCE_OFFSET_PATH}"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage("Clean exports") {
|
||||
steps {
|
||||
script {
|
||||
STATICANALYSIS = 'staticanalysis'
|
||||
cleanfolders = [
|
||||
STATICANALYSIS,
|
||||
]
|
||||
cleaner = load("${autobuilder.commonscripts()}/clean/clean.groovy")
|
||||
cleaner.clean(cleanfolders)
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Generating version info') {
|
||||
steps {
|
||||
script {
|
||||
version = load("${autobuilder.commonscripts()}/versionnumbering/generate.groovy")
|
||||
version.generate(meta, SOURCE_REVISION, SOURCE_PATH)
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Static analysis') {
|
||||
steps {
|
||||
script {
|
||||
def PPDFOLDER = "${STATICANALYSIS}/ppd"
|
||||
def EXCLUDE_PARAM = ''
|
||||
if (EXCLUDE_PATHS) {
|
||||
EXCLUDE_PARAM = '--exclude "'
|
||||
def exclude_path_list = EXCLUDE_PATHS.split(',')
|
||||
for (exclude_path in exclude_path_list) {
|
||||
EXCLUDE_PARAM += "${SRC}/${exclude_path.trim()},"
|
||||
}
|
||||
EXCLUDE_PARAM += '"'
|
||||
}
|
||||
if (isUnix()) {
|
||||
sh """#!/bin/bash
|
||||
set -ev
|
||||
|
||||
mkdir -p "${PPDFOLDER}"
|
||||
export PMD_JAVA_OPTS=-Xmx65536m
|
||||
"${PPD}/run.sh" cpd --minimum-tokens 100 --files "${SRC}" --language cpp --format xml ${EXCLUDE_PARAM} --failOnViolation false > "${PPDFOLDER}/cpd.xml"
|
||||
"""
|
||||
} else {
|
||||
bat """
|
||||
mkdir -p "${PPDFOLDER}"
|
||||
set PMD_JAVA_OPTS=-Xmx2048m
|
||||
"${PPD}/cpd.bat" --minimum-tokens 100 --files "${SRC}" --language cpp --format xml ${EXCLUDE_PARAM} --failOnViolation false > "${PPDFOLDER}/cpd.xml"
|
||||
"""
|
||||
}
|
||||
recordIssues(tools: [
|
||||
cpd(pattern: "**/cpd.xml", reportEncoding: 'UTF-8'),
|
||||
])
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Classifying publishable artifacts') {
|
||||
steps {
|
||||
script {
|
||||
def publishable = [
|
||||
]
|
||||
publishutils = load("${autobuilder.commonscripts()}/publishing/utils.groovy")
|
||||
publishutils.generatelist(meta, publishable)
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Archiving artifacts') {
|
||||
steps {
|
||||
script {
|
||||
ArrayList<String> itemsForRelease = ["${STATICANALYSIS}/**"]
|
||||
def artifactlist = meta.generateartifacts(itemsForRelease)
|
||||
archiveArtifacts "${artifactlist}"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
always {
|
||||
echo 'Post-build'
|
||||
}
|
||||
failure {
|
||||
echo 'Failed build'
|
||||
}
|
||||
unstable {
|
||||
echo 'Unstable build'
|
||||
}
|
||||
success {
|
||||
echo 'Succeeded build'
|
||||
}
|
||||
}
|
||||
}
|
||||
113
Common_scripts/staticanalysis/cppcheck.groovy
Normal file
113
Common_scripts/staticanalysis/cppcheck.groovy
Normal file
|
|
@ -0,0 +1,113 @@
|
|||
pipeline {
|
||||
agent { label "${AGENT_LABEL}" }
|
||||
stages {
|
||||
stage('Initial setup') {
|
||||
steps {
|
||||
script {
|
||||
meta = load("${WORKSPACE}/autobuild/Common_scripts/autobuilder.groovy").startnonbuild(this)
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Checkout dependencies') {
|
||||
steps {
|
||||
script {
|
||||
configurationhelper = autobuilder.configurationhelper()
|
||||
|
||||
PYTHONURL = 'git@hydra:tools/python.git'
|
||||
PYTHONBRANCH = 'origin/3.6.3_windows'
|
||||
PYTHONDIR = "${WORKSPACE}/python"
|
||||
configurationhelper.gitCheckoutAndRegister(meta, 'python', PYTHONURL, PYTHONBRANCH, PYTHONDIR)
|
||||
env.PYTHON = "${PYTHONDIR}/ver/python.exe"
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Checkout source') {
|
||||
steps {
|
||||
script {
|
||||
SOURCEREVISION = "${SOURCE_REVISION}"
|
||||
SOURCEDIR = "${WORKSPACE}/source"
|
||||
configurationhelper.gitCheckoutAndRegister(meta, 'source', SOURCEURL, SOURCEREVISION, SOURCEDIR, '', 0, false)
|
||||
SOURCE_PATH = "${SOURCEDIR}"
|
||||
env.SRC = "${SOURCE_PATH}/${SOURCE_OFFSET_PATH}"
|
||||
}
|
||||
}
|
||||
}
|
||||
stage("Clean exports") {
|
||||
steps {
|
||||
script {
|
||||
STATICANALYSIS = 'staticanalysis'
|
||||
cleanfolders = [
|
||||
STATICANALYSIS,
|
||||
]
|
||||
cleaner = load("${autobuilder.commonscripts()}/clean/clean.groovy")
|
||||
cleaner.clean(cleanfolders)
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Generating version info') {
|
||||
steps {
|
||||
script {
|
||||
version = load("${autobuilder.commonscripts()}/versionnumbering/generate.groovy")
|
||||
version.generate(meta, SOURCE_REVISION, SOURCE_PATH)
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Static analysis') {
|
||||
steps {
|
||||
script {
|
||||
def CPPCHECKFOLDER = "${STATICANALYSIS}/cppcheck"
|
||||
dir(CPPCHECKFOLDER) {
|
||||
echo "Executing: ${CPPCHECK} --xml --xml-version=2 ${SRC} 2> cppcheck.xml"
|
||||
if (isUnix()) {
|
||||
sh """#!/bin/bash
|
||||
set -e
|
||||
|
||||
"${CPPCHECK}" --xml --xml-version=2 "${SRC}" 2> cppcheck.xml
|
||||
"""
|
||||
} else {
|
||||
bat """
|
||||
"${CPPCHECK}" --xml --xml-version=2 "${SRC}" 2> cppcheck.xml
|
||||
"""
|
||||
}
|
||||
}
|
||||
recordIssues(tools: [
|
||||
cppCheck(pattern: "**/cppcheck.xml", reportEncoding: 'UTF-8'),
|
||||
])
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Classifying publishable artifacts') {
|
||||
steps {
|
||||
script {
|
||||
def publishable = [
|
||||
]
|
||||
publishutils = load("${autobuilder.commonscripts()}/publishing/utils.groovy")
|
||||
publishutils.generatelist(meta, publishable)
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Archiving artifacts') {
|
||||
steps {
|
||||
script {
|
||||
ArrayList<String> itemsForRelease = ["${STATICANALYSIS}/**"]
|
||||
def artifactlist = meta.generateartifacts(itemsForRelease)
|
||||
archiveArtifacts "${artifactlist}"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
always {
|
||||
echo 'Post-build'
|
||||
}
|
||||
failure {
|
||||
echo 'Failed build'
|
||||
}
|
||||
unstable {
|
||||
echo 'Unstable build'
|
||||
}
|
||||
success {
|
||||
echo 'Succeeded build'
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue