Update 'Jenkinsfile-create-dataset'

This commit is contained in:
Marcin Rostkowski 2023-04-19 19:22:54 +02:00
parent 466be13232
commit 40f30dc7f0

View File

@ -1,10 +1,6 @@
pipeline { pipeline {
agent any agent any
environment {
KAGGLE_TOKEN = credentials('kaggle-token')
}
stages { stages {
stage('Checkout') { stage('Checkout') {
steps { steps {
@ -18,13 +14,19 @@ pipeline {
} }
} }
stage('Setup Kaggle Credentials') {
steps {
withCredentials([string(credentialsId: 'kaggle-api-key', 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') { stage('Run Shell Script') {
steps { steps {
sh 'chmod +x script.sh' sh 'chmod +x script.sh'
withCredentials([string(credentialsId: 'kaggle-token', variable: 'KAGGLE_TOKEN')]) {
sh 'echo $KAGGLE_TOKEN > ~/.kaggle/kaggle.json'
sh 'chmod 600 ~/.kaggle/kaggle.json'
}
sh './script.sh' sh './script.sh'
} }
} }