diff --git a/Jenkinsfile-create-dataset b/Jenkinsfile-create-dataset index e6e5516..f3b8c78 100644 --- a/Jenkinsfile-create-dataset +++ b/Jenkinsfile-create-dataset @@ -1,10 +1,6 @@ pipeline { agent any - environment { - KAGGLE_TOKEN = credentials('kaggle-token') - } - stages { stage('Checkout') { 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') { steps { 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' } }