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