57 lines
1.9 KiB
Plaintext
57 lines
1.9 KiB
Plaintext
node {
|
|
checkout scm
|
|
try {
|
|
docker.image('s444452/ium:1.3').inside {
|
|
stage('Preparation') {
|
|
properties([
|
|
pipelineTriggers([upstream(threshold: hudson.model.Result.SUCCESS, upstreamProjects: "s444452-create-dataset")]),
|
|
parameters([
|
|
string(
|
|
defaultValue: ".",
|
|
description: 'Arguments for model training: arg1,arg2,arg3',
|
|
name: 'TRAIN_ARGS'
|
|
)
|
|
])
|
|
])
|
|
}
|
|
stage('Copy artifacts') {
|
|
copyArtifacts filter: 'train_data.csv', fingerprintArtifacts: true, projectName: 's444452-create-dataset'
|
|
copyArtifacts filter: 'test_data.csv', fingerprintArtifacts: true, projectName: 's444452-create-dataset'
|
|
copyArtifacts filter: 'dev_data.csv', fingerprintArtifacts: true, projectName: 's444452-create-dataset'
|
|
}
|
|
stage('Run script') {
|
|
withEnv(["TRAIN_ARGS=${params.TRAIN_ARGS}"]) {
|
|
sh "python3 Scripts/train_neural_network.py $TRAIN_ARGS"
|
|
}
|
|
}
|
|
stage('Archive artifacts') {
|
|
archiveArtifacts "neural_network_evaluation.txt, model/**"
|
|
}
|
|
}
|
|
} catch (e) {
|
|
currentBuild.result = "FAILED"
|
|
throw e
|
|
} finally {
|
|
notifyBuild(currentBuild.result)
|
|
}
|
|
}
|
|
def notifyBuild(String buildStatus = 'STARTED') {
|
|
buildStatus = buildStatus ?: 'SUCCESS'
|
|
|
|
def subject = "Job: ${env.JOB_NAME}"
|
|
def details = "Build nr: ${env.BUILD_NUMBER}, status: ${buildStatus} \n url: ${env.BUILD_URL}"
|
|
|
|
// Override default values based on build status
|
|
if (buildStatus == 'SUCCESS') {
|
|
color = 'GREEN'
|
|
colorCode = '#00FF00'
|
|
} else {
|
|
color = 'RED'
|
|
colorCode = '#FF0000'
|
|
}
|
|
emailext (
|
|
subject: subject,
|
|
body: details,
|
|
// recipientProviders: [[$class: 'DevelopersRecipientProvider']]
|
|
)
|
|
} |