diff --git a/Jenkinsfile b/Jenkinsfile index a4d181c..de83f9c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,13 +1,37 @@ pipeline { - agent { - dockerfile true - } - stages { - stage('Stage 1') { - steps { - sh 'chmod u+x ./kagle.py' - sh 'python3 kagle.py' - } - } - } + agent any + parameters { + string( + defaultValue: 'szymonjadczak', + 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' + ) + string( + defaultValue: '', + description: 'Value for head command', + name: 'CUTOFF' + ) + } + environment { + KAGGLE_USERNAME="$params.KAGGLE_USERNAME" + KAGGLE_KEY="$params.KAGGLE_KEY" + CUTOFF="$params.CUTOFF" + } + stages { + stage('Stage 1') { + steps { + echo 'Hello world!!!' + checkout([$class: 'GitSCM', branches: [[name: '*/master']], extensions: [], userRemoteConfigs: [[url: 'https://git.wmi.amu.edu.pl/s444386/ium_444386']]]) + sh "chmod u+x ./dataset_download.sh" + sh "KAGGLE_USERNAME=${KAGGLE_USERNAME} KAGGLE_KEY=${KAGGLE_KEY} CUTOFF=${CUTOFF} ./dataset_download.sh" + archiveArtifacts 'data.csv' + } + } + } } diff --git a/Jenkinsfile2 b/Jenkinsfile2 index 4c0bddb..f4915f4 100644 --- a/Jenkinsfile2 +++ b/Jenkinsfile2 @@ -1,5 +1,7 @@ pipeline{ - agent any + agent { + dockerfile true + } parameters { buildSelector( defaultSelector: lastSuccessful(), @@ -10,11 +12,10 @@ pipeline{ stage('copy artefacts') { steps { copyArtifacts filter: 'data.csv', fingerprintArtifacts: true, projectName: 's444386-create-dataset', selector: lastSuccessful() - sh "chmod u+x ./dataset_stats.sh" - sh "./dataset_stats.sh" - archiveArtifacts 'number_of_lines.txt' + sh 'chmod u+x ./kagle.py' + sh 'python3 kagle.py' } } } -} \ No newline at end of file +}