diff --git a/Jenkinsfile b/Jenkinsfile index 5e492ec..0287da3 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,42 +1,27 @@ -pipeline { - agent any - parameters { - string( - defaultValue: 'nbrt10', - description: 'Kaggle username', - name: 'KAGGLE_USERNAME', - trim: false - ) - password( - defaultValue: '', - description: 'Kaggle token taken from kaggle.json file, as described in https://github.com/Kaggle/kaggle-api#api-credentials', - name: 'KAGGLE_KEY' - ) - } - stages { - stage('Preparation') { - steps { - script { - withCredentials([string(credentialsId: '', variable: 'KAGGLE_USERNAME'), string(credentialsId: '', variable: 'KAGGLE_KEY')]) { - sh 'export KAGGLE_USERNAME=$KAGGLE_USERNAME && export KAGGLE_KEY=$KAGGLE_KEY' - } - } - } - } - stage('checkout') { - steps { - git branch: 'master', url: 'https://git.wmi.amu.edu.pl/s487175/ium_z487175.git' - } - } - stage('script') { - steps { - sh './s487175-create-dataset-scriptsh.py > output.txt' - } - } - } - post { - always { - archiveArtifacts artifacts: 'output.txt', onlyIfSuccessful: true - } - } +node { + stage('Preparation') { + properties([ + parameters([ + string( + defaultValue: 'nbrt10', + description: 'Kaggle username', + name: 'KAGGLE_USERNAME', + trim: false + ), + password( + defaultValue: '', + description: 'Kaggle token taken from kaggle.json file, as described in https://github.com/Kaggle/kaggle-api#api-credentials', + name: 'KAGGLE_KEY' + ) + ]) + ]) + } + stage('Build') { + // Run the maven build + withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}", + "KAGGLE_KEY=${params.KAGGLE_KEY}" ]) { + sh 'echo KAGGLE_USERNAME: $KAGGLE_USERNAME' + sh 'kaggle datasets list' + } + } } \ No newline at end of file