Jenkisfile2

This commit is contained in:
Adrian Charkiewicz 2022-03-24 21:12:58 +01:00
parent baa683d209
commit 769c2d731f
3 changed files with 29 additions and 37 deletions

2
Jenkinsfile vendored
View File

@ -35,8 +35,6 @@ pipeline {
archiveArtifacts 'TEST_winequality-red.csv'
archiveArtifacts 'TRAIN_winequality-red.csv'
archiveArtifacts 'VAL_winequality-red.csv'
}
}
}

View File

@ -1,37 +1,27 @@
pipeline {
agent any
parameters {
string(
defaultValue: 'sknera',
description: 'username',
name: '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: '20',
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/s444354/ium_444354']]])
sh "chmod u+x ./dataset_download.sh"
sh "KAGGLE_USERNAME=${KAGGLE_USERNAME} KAGGLE_KEY=${KAGGLE_KEY} CUTOFF=${CUTOFF} ./download.sh"
archiveArtifacts 'data.txt'
}
}
}
agent any
parameters{
buildSelector(
defaultSelector: lastSuccessful(),
name: 's444354-create-dataset',
description: 'Which build to use for copying artifacts'
)
}
stages {
stage("Check out from version control") {
steps {
checkout scm
}
}
stage("Shell Script") {
steps {
sh "chmod u+x ./script2.sh"
sh " ./script2.sh"
archiveArtifacts 'num_of_lines.txt'
}
}
}
}

4
script2.sh Normal file
View File

@ -0,0 +1,4 @@
#!/bin/sh
wc -l > num_of_lines.txt