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 'TEST_winequality-red.csv'
archiveArtifacts 'TRAIN_winequality-red.csv' archiveArtifacts 'TRAIN_winequality-red.csv'
archiveArtifacts 'VAL_winequality-red.csv' archiveArtifacts 'VAL_winequality-red.csv'
} }
} }
} }

View File

@ -1,36 +1,26 @@
pipeline { pipeline {
agent any agent any
parameters { parameters{
string( buildSelector(
defaultValue: 'sknera', defaultSelector: lastSuccessful(),
description: 'username', name: 's444354-create-dataset',
name: 'USERNAME', description: 'Which build to use for copying artifacts'
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 { stages {
stage('Stage 1') { stage("Check out from version control") {
steps { steps {
echo 'Hello world' checkout scm
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" stage("Shell Script") {
archiveArtifacts 'data.txt' 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