Jenkinsfile update
This commit is contained in:
parent
5faa878160
commit
d83fc31434
44
Jenkinsfile
vendored
44
Jenkinsfile
vendored
@ -1,29 +1,27 @@
|
|||||||
pipeline {
|
node {
|
||||||
agent any
|
stage('Preparation') {
|
||||||
//Definijuemy parametry, które będzie można podać podczas wywoływania zadania
|
properties([
|
||||||
parameters {
|
parameters([
|
||||||
string (
|
string(
|
||||||
defaultValue: 'Hello World!',
|
defaultValue: 'tomaszzitkiewicz',
|
||||||
description: 'Tekst, którym chcesz przywitać świat',
|
description: 'Kaggle username',
|
||||||
name: 'INPUT_TEXT',
|
name: 'KAGGLE_USERNAME',
|
||||||
trim: false
|
trim: false
|
||||||
|
),
|
||||||
|
password(
|
||||||
|
defaultValue: '',
|
||||||
|
description: 'Kaggle token taken from kaggle.json file, as described in https://github.com/Kaggle/kaggle-api#api-credentials',
|
||||||
|
name: 'KAGGLE_KEY'
|
||||||
)
|
)
|
||||||
|
])
|
||||||
|
])
|
||||||
}
|
}
|
||||||
stages {
|
stage('Build') {
|
||||||
stage('Hello') {
|
// Run the maven build
|
||||||
steps {
|
withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}",
|
||||||
//Wypisz wartość parametru w konsoli (To nie jest polecenie bash, tylko groovy!)
|
"KAGGLE_KEY=${params.KAGGLE_KEY}" ]) {
|
||||||
echo "INPUT_TEXT: ${INPUT_TEXT}"
|
sh 'echo KAGGLE_USERNAME: $KAGGLE_USERNAME'
|
||||||
//Wywołaj w konsoli komendę "figlet", która generuje ASCI-art
|
sh 'kaggle datasets list'
|
||||||
sh "figlet \"${INPUT_TEXT}\" | tee output.txt"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
stage('Goodbye!') {
|
|
||||||
steps {
|
|
||||||
echo 'Goodbye!'
|
|
||||||
//Zarchiwizuj wynik
|
|
||||||
archiveArtifacts 'output.txt'
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user