ium_444452/Jenkinsfile
2022-04-03 23:29:47 +02:00

40 lines
1.5 KiB
Groovy

node {
docker.image('s444452/ium:1.0').inside {
stage('Preparation') {
properties([
parameters([
string(
defaultValue: 'adamosiowy',
description: 'Kaggle username',
name: 'KAGGLE_USERNAME',
trim: false
),
password(
defaultValue: '',
description: 'Kaggle token taken from kaggle.json file, as described in https://github.com/Kaggle/kaggle-api#api-credentials',
name: 'KAGGLE_KEY'
),
string(
defaultValue: "10000",
description: 'Determine the size of dataset',
name: 'CUTOFF'
)
])
])
}
stage('Clone repository') {
checkout([$class: 'GitSCM', branches: [[name: '*/master']], extensions: [], userRemoteConfigs: [[credentialsId: '5e0a58a0-03ad-41dd-beff-7b8a07c7fe0c', url: 'https://git.wmi.amu.edu.pl/s444452/ium_444452.git']]])
}
stage('Run script') {
withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}",
"KAGGLE_KEY=${params.KAGGLE_KEY}","CUTOFF=${params.CUTOFF}"]) {
sh 'echo KAGGLE_USERNAME: $KAGGLE_USERNAME'
sh 'ls'
sh "python3 lab2_data.py"
}
}
stage('Archive artifacts') {
archiveArtifacts 'fake_job_postings.csv'
}
}
}