diff --git a/Jenkinsfile b/Jenkinsfile index 8af4fa6..535f4cb 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,41 +1,46 @@ 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') { - properties([ - //dostęp do API KAGGLE - 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' - ) - ]) - ]) + steps { + script { + // Ustawianie danych uwierzytelniających KAGGLE + 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 { - //Klonowanie - checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: 'git-creds', url: 'https://git.wmi.amu.edu.pl/s487175/ium_z487175.git']]]) - } + //Klonowanie + checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: 'git-creds', url: 'https://git.wmi.amu.edu.pl/s487175/ium_z487175.git']]]) + } } stage('script') { steps { - //skrypt - sh './s487175-create-dataset-scriptsh.py' > output.txt + //skrypt + sh './s487175-create-dataset-scriptsh.py > output.txt' } } } post { - always { - //archiveArtifacts - archiveArtifacts artifacts: 'output.txt', onlyIfSuccessful: true - } - } + always { + //archiveArtifacts + archiveArtifacts artifacts: 'output.txt', onlyIfSuccessful: true + } + } } \ No newline at end of file