Update 'Jenkinsfile-create-dataset'

This commit is contained in:
Marcin Rostkowski 2023-04-19 19:34:52 +02:00
parent 76c9219242
commit 246d42808a

View File

@ -1,6 +1,11 @@
pipeline {
agent any
parameters {
string(name: 'KAGGLE_USERNAME', defaultValue: 'reyvan123', description: 'Kaggle username')
password(name: 'KAGGLE_KEY', defaultValue: '', description: 'Kaggle API key')
}
stages {
stage('Checkout') {
steps {
@ -14,20 +19,12 @@ pipeline {
}
}
stage('Setup Kaggle Credentials') {
steps {
withCredentials([string(credentialsId: '6ff11ae7-4f4a-4cfb-834b-85bc92ecc85c', variable: 'KAGGLE_KEY')]) {
sh 'mkdir -p ~/.kaggle'
sh 'echo \'{"username":"reyvan123","key":"\'$KAGGLE_KEY\'"}\' > ~/.kaggle/kaggle.json'
sh 'chmod 600 ~/.kaggle/kaggle.json'
}
}
}
stage('Run Shell Script') {
steps {
sh 'chmod +x script.sh'
sh './script.sh'
withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}", "KAGGLE_KEY=${params.KAGGLE_KEY}"]) {
sh 'chmod +x script.sh'
sh './script.sh'
}
}
}
@ -37,4 +34,4 @@ pipeline {
}
}
}
}
}