diff --git a/Jenkinsfile b/Jenkinsfile index fb6f48a..5b0a4e1 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -30,4 +30,47 @@ pipeline { // echo "Saving results to the output.txt..." // archiveArtifacts 'output.txt' // } -// } \ No newline at end of file +// } + +pipeline { + agent any + parameters { + string( + defaultValue:'mateuszogrodowczyk', + description: 'Kaggle username', + name'KAGGLE_USERNAME', + trim: true + ), + password( + defaultValue: '', + description: 'Kaggle access token retrieved from kaggle.json file - https://github.com/Kaggle/kaggle-api#api-credentials', + name: 'KAGGLE_KEY' + ) + } + environment { + KAGGLE_USERNAME="$params.KAGGLE_USERNAME" + KAGGLE_KEY="$params.KAGGLE_KEY" + } + + stages { + stage('Install depends.') { + steps { + sh "pip install --user -r requirements.txt" + } + } + stage('Prepare dataset') { + steps { + script { + withEnv([ + "KAGGLE_USERNAME={$params.KAGGLE_USERNAME}", + "KAGGLE_KEY={$params.KAGGLE_KEY}" + ]) + sh 'echo Welcome: $KAGGLE_USERNAME' + sh 'kaggle datasets list' + } + sh "chmod u+x ./test_script.sh" + sh "./test_script.sh" + } + } + } +} \ No newline at end of file diff --git a/test_script.sh b/test_script.sh new file mode 100644 index 0000000..f520077 --- /dev/null +++ b/test_script.sh @@ -0,0 +1 @@ +echo "Everything went well" \ No newline at end of file