53 lines
1.8 KiB
Groovy
53 lines
1.8 KiB
Groovy
pipeline {
|
|
agent any
|
|
//Definijuemy parametry, które będzie można podać podczas wywoływania zadania
|
|
parameters{
|
|
string(
|
|
defaultValue: 'xx',
|
|
description: 'Kaggle username',
|
|
name: 'KAGGLE_USERNAME',
|
|
trim: false
|
|
)
|
|
password(
|
|
defaultValue: 'nie_patrz_bo_sie_wstydze',
|
|
description: 'Kaggle token taken from kaggle.json file, as described in https://github.com/Kaggle/kaggle-api#api-credentials',
|
|
name: 'KAGGLE_KEY'
|
|
)
|
|
}
|
|
stages {
|
|
stage('Hello') {
|
|
steps {
|
|
//Wypisz wartość parametru w konsoli (To nie jest polecenie bash, tylko groovy!)
|
|
echo "INPUT_TEXT: ${KAGGLE_USERNAME}"
|
|
//Wywołaj w konsoli komendę "figlet", która generuje ASCI-art
|
|
sh "figlet \"${KAGGLE_USERNAME}${KAGGLE_KEY}\" | tee output.txt"
|
|
}
|
|
}
|
|
stage('checkout') {
|
|
steps {
|
|
//Wypisz wartość parametru w konsoli (To nie jest polecenie bash, tylko groovy!)
|
|
echo "INPUT_TEXT: ${KAGGLE_USERNAME}"
|
|
//
|
|
sh 'rm -rf ium_z434686'
|
|
sh 'git clone https://git.wmi.amu.edu.pl/s434686/ium_z434686'
|
|
sh 'cd ium_z434686 | ls -a | tee ls.txt'
|
|
}
|
|
}
|
|
|
|
stage('Goodbye!') {
|
|
steps {
|
|
echo 'Goodbye!'
|
|
//Zarchiwizuj wynik
|
|
archiveArtifacts 'output.txt'
|
|
archiveArtifacts 'ls.txt'
|
|
}
|
|
}
|
|
stage('Build') {
|
|
// Run the maven build
|
|
withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}",
|
|
"KAGGLE_KEY=${params.KAGGLE_KEY}" ]) {
|
|
sh 'kaggle datasets list'
|
|
}
|
|
}
|
|
}
|
|
} |