zadanie doker

This commit is contained in:
szymonj98 2022-04-03 14:48:04 +02:00
parent 7aa5c39258
commit a82a94a4cc
2 changed files with 41 additions and 16 deletions

46
Jenkinsfile vendored
View File

@ -1,13 +1,37 @@
pipeline { pipeline {
agent { agent any
dockerfile true parameters {
} string(
stages { defaultValue: 'szymonjadczak',
stage('Stage 1') { description: 'Kaggle username',
steps { name: 'KAGGLE_USERNAME',
sh 'chmod u+x ./kagle.py' trim: false
sh 'python3 kagle.py' )
} 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'
}
}
}
} }

View File

@ -1,5 +1,7 @@
pipeline{ pipeline{
agent any agent {
dockerfile true
}
parameters { parameters {
buildSelector( buildSelector(
defaultSelector: lastSuccessful(), defaultSelector: lastSuccessful(),
@ -10,11 +12,10 @@ pipeline{
stage('copy artefacts') { stage('copy artefacts') {
steps { steps {
copyArtifacts filter: 'data.csv', fingerprintArtifacts: true, projectName: 's444386-create-dataset', selector: lastSuccessful() copyArtifacts filter: 'data.csv', fingerprintArtifacts: true, projectName: 's444386-create-dataset', selector: lastSuccessful()
sh "chmod u+x ./dataset_stats.sh" sh 'chmod u+x ./kagle.py'
sh "./dataset_stats.sh" sh 'python3 kagle.py'
archiveArtifacts 'number_of_lines.txt'
} }
} }
} }
} }