2023-04-18 14:40:42 +02:00
|
|
|
pipeline {
|
2023-03-25 13:40:54 +01:00
|
|
|
agent any
|
|
|
|
//Definijuemy parametry, które będzie można podać podczas wywoływania zadania
|
2023-04-18 15:53:49 +02:00
|
|
|
parameters{
|
2023-04-18 15:13:26 +02:00
|
|
|
string(
|
2023-04-18 15:13:44 +02:00
|
|
|
defaultValue: 'xx',
|
2023-04-18 15:13:26 +02:00
|
|
|
description: 'Kaggle username',
|
|
|
|
name: 'KAGGLE_USERNAME',
|
|
|
|
trim: false
|
2023-04-18 16:11:12 +02:00
|
|
|
)
|
2023-04-18 15:13:26 +02:00
|
|
|
password(
|
2023-04-18 16:26:29 +02:00
|
|
|
defaultValue: 'nie_patrz_bo_sie_wstydze',
|
2023-04-18 15:13:26 +02:00
|
|
|
description: 'Kaggle token taken from kaggle.json file, as described in https://github.com/Kaggle/kaggle-api#api-credentials',
|
|
|
|
name: 'KAGGLE_KEY'
|
|
|
|
)
|
2023-04-18 15:53:49 +02:00
|
|
|
}
|
2023-04-18 15:35:14 +02:00
|
|
|
stages {
|
2023-03-25 13:40:54 +01:00
|
|
|
stage('Hello') {
|
|
|
|
steps {
|
|
|
|
//Wypisz wartość parametru w konsoli (To nie jest polecenie bash, tylko groovy!)
|
2023-04-18 15:36:13 +02:00
|
|
|
echo "INPUT_TEXT: ${KAGGLE_USERNAME}"
|
2023-03-25 13:40:54 +01:00
|
|
|
//Wywołaj w konsoli komendę "figlet", która generuje ASCI-art
|
2023-04-18 16:31:44 +02:00
|
|
|
sh "figlet \"${KAGGLE_USERNAME}${KAGGLE_KEY}\" | tee output.txt"
|
2023-03-25 13:40:54 +01:00
|
|
|
}
|
|
|
|
}
|
2023-04-18 17:04:34 +02:00
|
|
|
stage('checkout') {
|
|
|
|
steps {
|
|
|
|
//Wypisz wartość parametru w konsoli (To nie jest polecenie bash, tylko groovy!)
|
|
|
|
echo "INPUT_TEXT: ${KAGGLE_USERNAME}"
|
2023-04-18 17:11:06 +02:00
|
|
|
//
|
2023-04-18 17:13:00 +02:00
|
|
|
sh 'rm -rf ium_z434686'
|
2023-04-18 17:17:58 +02:00
|
|
|
sh 'git clone https://git.wmi.amu.edu.pl/s434686/ium_z434686'
|
2023-04-18 17:19:22 +02:00
|
|
|
sh 'cd ium_z434686 | ls -a | tee ls.txt'
|
2023-04-18 17:04:34 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-03-25 13:40:54 +01:00
|
|
|
stage('Goodbye!') {
|
|
|
|
steps {
|
|
|
|
echo 'Goodbye!'
|
|
|
|
//Zarchiwizuj wynik
|
|
|
|
archiveArtifacts 'output.txt'
|
2023-04-18 17:05:50 +02:00
|
|
|
archiveArtifacts 'ls.txt'
|
2023-03-25 13:40:54 +01:00
|
|
|
}
|
|
|
|
}
|
2023-04-18 19:28:43 +02:00
|
|
|
stage('Build') {
|
2023-04-18 19:30:22 +02:00
|
|
|
steps {
|
2023-04-18 19:28:43 +02:00
|
|
|
// Run the maven build
|
|
|
|
withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}",
|
|
|
|
"KAGGLE_KEY=${params.KAGGLE_KEY}" ]) {
|
|
|
|
sh 'kaggle datasets list'
|
|
|
|
}
|
2023-04-18 19:30:22 +02:00
|
|
|
}
|
2023-04-18 19:28:43 +02:00
|
|
|
}
|
2023-03-25 13:40:54 +01:00
|
|
|
}
|
|
|
|
}
|