Update Jenkinsfile

This commit is contained in:
s464962 2024-03-26 22:14:47 +01:00
parent 31388d1e4b
commit b3728245af
1 changed files with 40 additions and 27 deletions

67
Jenkinsfile vendored
View File

@ -1,29 +1,42 @@
pipeline {
agent any
//Definijuemy parametry, które będzie można podać podczas wywoływania zadania
parameters {
string (
defaultValue: 'Hello World!',
description: 'Tekst, którym chcesz przywitać świat',
name: 'INPUT_TEXT',
trim: false
)
}
stages {
stage('Hello') {
steps {
//Wypisz wartość parametru w konsoli (To nie jest polecenie bash, tylko groovy!)
echo "INPUT_TEXT: ${INPUT_TEXT}"
//Wywołaj w konsoli komendę "figlet", która generuje ASCI-art
sh "figlet \"${INPUT_TEXT}\" | tee output.txt"
}
}
stage('Goodbye!') {
steps {
echo 'Goodbye!'
//Zarchiwizuj wynik
archiveArtifacts 'output.txt'
}
}
}
agent any
parameters {
string(
defaultValue: '10000',
name: 'CUTOFF',
description: 'Liczba wierszy do obcięcia ze zbioru danych')
string(
defaultValue: '',
name: 'KAGGLE_USERNAME',
description: 'Kaggle username')
password(
defaultValue: '',
name: 'KAGGLE_KEY',
description: 'Kaggle API key')
}
stages {
stage('Clone Repository') {
steps {
git url: "https://git.wmi.amu.edu.pl/s464962/ium_464962"
}
}
stage('Download') {
steps {
withEnv([
"KAGGLE_USERNAME=${env.KAGGLE_USERNAME}",
"KAGGLE_KEY=${env.KAGGLE_KEY}"
]) {
sh "bash ./create-dataset.sh ${params.CUTOFF}"
}
}
}
stage('Archive Results') {
steps {
archiveArtifacts artifacts: 'data/*', onlyIfSuccessful: true
}
}
}
}