2023-04-16 16:35:06 +02:00
|
|
|
pipeline {
|
2023-04-19 19:10:17 +02:00
|
|
|
agent any
|
|
|
|
|
2023-04-19 19:34:52 +02:00
|
|
|
parameters {
|
|
|
|
string(name: 'KAGGLE_USERNAME', defaultValue: 'reyvan123', description: 'Kaggle username')
|
|
|
|
password(name: 'KAGGLE_KEY', defaultValue: '', description: 'Kaggle API key')
|
|
|
|
}
|
|
|
|
|
2023-04-19 19:10:17 +02:00
|
|
|
stages {
|
|
|
|
stage('Checkout') {
|
|
|
|
steps {
|
|
|
|
checkout scm
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
stage('Install Kaggle CLI') {
|
|
|
|
steps {
|
|
|
|
sh 'pip install kaggle'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-04-19 19:22:54 +02:00
|
|
|
stage('Run Shell Script') {
|
|
|
|
steps {
|
2023-04-19 19:34:52 +02:00
|
|
|
withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}", "KAGGLE_KEY=${params.KAGGLE_KEY}"]) {
|
|
|
|
sh 'chmod +x script.sh'
|
|
|
|
sh './script.sh'
|
|
|
|
}
|
2023-04-19 19:10:17 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
stage('Archive Artifacts') {
|
|
|
|
steps {
|
2023-04-19 19:41:58 +02:00
|
|
|
archiveArtifacts artifacts: 'output.txt.gz', fingerprint: true
|
2023-04-19 19:10:17 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2023-04-19 19:41:58 +02:00
|
|
|
}
|