ium_464979/Jenkinsfile
AWieczarek 29e4a67c43 IUM_06
2024-05-05 19:31:29 +02:00

40 lines
1.4 KiB
Groovy

pipeline {
agent any
triggers {
upstream(upstreamProjects: 'z-s464979-create-dataset', threshold: hudson.model.Result.SUCCESS)
}
parameters {
string(name: 'EPOCHS', defaultValue: '40', description: 'Number of epochs')
string(name: 'BATCH_SIZE', defaultValue: '32', description: 'Batch size')
buildSelector(defaultSelector: lastSuccessful(), description: 'Which build to use for copying artifacts', name: 'BUILD_SELECTOR')
}
stages {
stage('Clone Repository') {
steps {
git branch: 'training', url: "https://git.wmi.amu.edu.pl/s464979/ium_464979.git"
}
}
stage('Copy Artifacts') {
steps {
copyArtifacts filter: 'beer_reviews.csv,beer_reviews_train.csv,beer_reviews_test.csv', projectName: 'z-s464979-create-dataset', selector: buildParameter('BUILD_SELECTOR')
}
}
stage("Run") {
agent {
dockerfile {
filename 'Dockerfile'
reuseNode true
}
}
steps {
sh "chmod +x ./IUM_05-model.py"
sh "python3 ./IUM_05-model.py ${params.EPOCHS} ${params.BATCH_SIZE}"
archiveArtifacts artifacts: 'beer_review_sentiment_model.h5', onlyIfSuccessful: true
}
}
}
}