Clean up pipelines
This commit is contained in:
44
jenkinsfiles/SupercupUpdater/Jenkinsfile
vendored
44
jenkinsfiles/SupercupUpdater/Jenkinsfile
vendored
@@ -13,35 +13,15 @@ pipeline {
|
|||||||
String jdkPath = tool name: 'OpenJDK', type: 'jdk'
|
String jdkPath = tool name: 'OpenJDK', type: 'jdk'
|
||||||
withCredentials([usernamePassword(credentialsId: 'aws', passwordVariable: 'AWS_SECRET_KEY', usernameVariable: 'AWS_ACCESS_KEY_ID')]) {
|
withCredentials([usernamePassword(credentialsId: 'aws', passwordVariable: 'AWS_SECRET_KEY', usernameVariable: 'AWS_ACCESS_KEY_ID')]) {
|
||||||
withEnv(["JAVA_HOME=${jdkPath}/jdk-19.0.2","AWS_SECRET_KEY=${AWS_SECRET_KEY}", "AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}"]) {
|
withEnv(["JAVA_HOME=${jdkPath}/jdk-19.0.2","AWS_SECRET_KEY=${AWS_SECRET_KEY}", "AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}"]) {
|
||||||
String outputBuild = ""
|
|
||||||
String output = ""
|
|
||||||
String errorOutput = ""
|
|
||||||
String outputTemp = ""
|
|
||||||
try {
|
try {
|
||||||
outputTemp = sh returnStdout: true, script: "java -jar build/libs/tlw-database-tool-1.0.jar --mode MatchesUpdaterFootball --season ${season} --league 45 --configFile Supercup 2>&1"
|
sh "java -jar build/libs/tlw-database-tool-1.0.jar --mode MatchesUpdaterFootball --season ${season} --league 45 --configFile Supercup 2>&1 >> log.txt"
|
||||||
output += outputTemp
|
sh "java -jar build/libs/tlw-database-tool-1.0.jar --mode MatchdaysUpdater --season ${season} --league 45 --configFile Supercup 2>&1 >> log.txt"
|
||||||
|
sh "java -jar build/libs/tlw-database-tool-1.0.jar --mode TeamsUpdater --season ${season} --league 45 --configFile Supercup 2>&1 >> log.txt"
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
errorOutput += outputTemp
|
telegramSendManual("TLW-Database-Tool crashed!")
|
||||||
}
|
}
|
||||||
try {
|
String outputString = readFile 'log.txt'
|
||||||
outputTemp = sh returnStdout: true, script: "java -jar build/libs/tlw-database-tool-1.0.jar --mode MatchdaysUpdater --season ${season} --league 45 --configFile Supercup 2>&1"
|
if(outputString != "") {
|
||||||
output += outputTemp
|
|
||||||
} catch (Exception e) {
|
|
||||||
errorOutput += outputTemp
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
outputTemp = sh returnStdout: true, script: "java -jar build/libs/tlw-database-tool-1.0.jar --mode TeamsUpdater --season ${season} --league 45 --configFile Supercup 2>&1"
|
|
||||||
output += outputTemp
|
|
||||||
} catch (Exception e) {
|
|
||||||
errorOutput += outputTemp
|
|
||||||
}
|
|
||||||
if(output != "") {
|
|
||||||
output = clean(output)
|
|
||||||
output.split('\n').toList().unique().each {
|
|
||||||
telegramSendManual(it)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(errorOutput != "") {
|
|
||||||
ArrayList<String> outputList = outputString.replace("\n\n", "\n").split('\n').toList()
|
ArrayList<String> outputList = outputString.replace("\n\n", "\n").split('\n').toList()
|
||||||
outputList = clean(outputList)
|
outputList = clean(outputList)
|
||||||
outputList.each {
|
outputList.each {
|
||||||
@@ -53,14 +33,12 @@ pipeline {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('CleanUp') {
|
|
||||||
steps {
|
|
||||||
deleteDir()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
post {
|
post {
|
||||||
failure {
|
always {
|
||||||
|
deleteDir()
|
||||||
|
}
|
||||||
|
failure {
|
||||||
telegramSendManual("Build failed!\n${env.BUILD_URL}console")
|
telegramSendManual("Build failed!\n${env.BUILD_URL}console")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
44
jenkinsfiles/WTLPokalUpdater/Jenkinsfile
vendored
44
jenkinsfiles/WTLPokalUpdater/Jenkinsfile
vendored
@@ -13,35 +13,15 @@ pipeline {
|
|||||||
String jdkPath = tool name: 'OpenJDK19', type: 'jdk'
|
String jdkPath = tool name: 'OpenJDK19', type: 'jdk'
|
||||||
withCredentials([usernamePassword(credentialsId: 'aws', passwordVariable: 'AWS_SECRET_KEY', usernameVariable: 'AWS_ACCESS_KEY_ID')]) {
|
withCredentials([usernamePassword(credentialsId: 'aws', passwordVariable: 'AWS_SECRET_KEY', usernameVariable: 'AWS_ACCESS_KEY_ID')]) {
|
||||||
withEnv(["JAVA_HOME=${jdkPath}/jdk-19.0.2","AWS_SECRET_KEY=${AWS_SECRET_KEY}", "AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}"]) {
|
withEnv(["JAVA_HOME=${jdkPath}/jdk-19.0.2","AWS_SECRET_KEY=${AWS_SECRET_KEY}", "AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}"]) {
|
||||||
String outputBuild = ""
|
|
||||||
String output = ""
|
|
||||||
String errorOutput = ""
|
|
||||||
String outputTemp = ""
|
|
||||||
try {
|
try {
|
||||||
outputTemp = sh returnStdout: true, script: "java -jar build/libs/tlw-database-tool-1.0.jar --mode MatchesUpdaterFootball --season ${season} --league 48 --configFile WTL-Pokal 2>&1"
|
sh "java -jar build/libs/tlw-database-tool-1.0.jar --mode MatchesUpdaterFootball --season ${season} --league 48 --configFile WTL-Pokal 2>&1 >> log.txt"
|
||||||
output += outputTemp
|
sh "java -jar build/libs/tlw-database-tool-1.0.jar --mode MatchdaysUpdater --season ${season} --league 48 --configFile WTL-Pokal 2>&1 >> log.txt"
|
||||||
|
sh "java -jar build/libs/tlw-database-tool-1.0.jar --mode TeamsUpdater --season ${season} --league 48 --configFile WTL-Pokal 2>&1 >> log.txt"
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
errorOutput += outputTemp
|
telegramSendManual("TLW-Database-Tool crashed!")
|
||||||
}
|
}
|
||||||
try {
|
String outputString = readFile 'log.txt'
|
||||||
outputTemp = sh returnStdout: true, script: "java -jar build/libs/tlw-database-tool-1.0.jar --mode MatchdaysUpdater --season ${season} --league 48 --configFile WTL-Pokal 2>&1"
|
if(outputString != "") {
|
||||||
output += outputTemp
|
|
||||||
} catch (Exception e) {
|
|
||||||
errorOutput += outputTemp
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
outputTemp = sh returnStdout: true, script: "java -jar build/libs/tlw-database-tool-1.0.jar --mode TeamsUpdater --season ${season} --league 48 --configFile WTL-Pokal 2>&1"
|
|
||||||
output += outputTemp
|
|
||||||
} catch (Exception e) {
|
|
||||||
errorOutput += outputTemp
|
|
||||||
}
|
|
||||||
if(output != "") {
|
|
||||||
output = clean(output)
|
|
||||||
output.split('\n').toList().unique().each {
|
|
||||||
telegramSendManual(it)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(errorOutput != "") {
|
|
||||||
ArrayList<String> outputList = outputString.replace("\n\n", "\n").split('\n').toList()
|
ArrayList<String> outputList = outputString.replace("\n\n", "\n").split('\n').toList()
|
||||||
outputList = clean(outputList)
|
outputList = clean(outputList)
|
||||||
outputList.each {
|
outputList.each {
|
||||||
@@ -53,14 +33,12 @@ pipeline {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('CleanUp') {
|
|
||||||
steps {
|
|
||||||
deleteDir()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
post {
|
post {
|
||||||
failure {
|
always {
|
||||||
|
deleteDir()
|
||||||
|
}
|
||||||
|
failure {
|
||||||
telegramSendManual("Build failed!\n${env.BUILD_URL}console")
|
telegramSendManual("Build failed!\n${env.BUILD_URL}console")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user