2021-03-25 11:49:11 +01:00
|
|
|
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 {
|
2021-03-25 12:26:18 +01:00
|
|
|
stage('Clone_Repo') {
|
|
|
|
steps {
|
|
|
|
// Get some code from a GitHub repository
|
|
|
|
git 'https://git.wmi.amu.edu.pl/s434788/ium_434788'
|
2021-03-25 12:30:07 +01:00
|
|
|
}
|
2021-03-25 12:31:40 +01:00
|
|
|
}
|
2021-03-25 12:26:18 +01:00
|
|
|
stage('Run shell script') {
|
2021-03-25 12:31:40 +01:00
|
|
|
steps {
|
2021-03-25 12:38:00 +01:00
|
|
|
sh 'chmod +x test.sh'
|
2021-03-25 12:28:31 +01:00
|
|
|
sh './test.sh'
|
2021-03-25 12:26:18 +01:00
|
|
|
archiveArtifacts 'train.csv'
|
2021-03-25 12:31:40 +01:00
|
|
|
}
|
2021-03-25 12:26:18 +01:00
|
|
|
}
|
2021-03-25 11:49:11 +01:00
|
|
|
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'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|