75 lines
2.1 KiB
Plaintext
75 lines
2.1 KiB
Plaintext
pipeline {
|
|
agent any
|
|
parameters {
|
|
string(
|
|
defaultValue: 'ikami1',
|
|
description: 'Kaggle username',
|
|
name: 'KAGGLE_USERNAME',
|
|
trim: false
|
|
),
|
|
password(
|
|
defaultValue: '17eaeb44a09284608df768f4c9c8c7af',
|
|
description: 'Kaggle token taken from kaggle.json file, as described in https://github.com/Kaggle/kaggle-api#api-credentials',
|
|
name: 'KAGGLE_KEY'
|
|
)
|
|
}
|
|
environment {
|
|
KAGGLE_USERNAME="$params.KAGGLE_USERNAME"
|
|
KAGGLE_KEY="$params.KAGGLE_KEY"
|
|
}
|
|
stages {
|
|
stage('Test stage') {
|
|
steps {
|
|
echo 'Hello world! Some test text - added text'
|
|
}
|
|
}
|
|
stage('Checkout') {
|
|
steps {
|
|
checkout scm
|
|
}
|
|
}
|
|
stage('Shell script') {
|
|
steps {
|
|
script{
|
|
withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}",
|
|
"KAGGLE_KEY=${params.KAGGLE_KEY}" ]) {
|
|
sh 'echo KAGGLE_USERNAME: $KAGGLE_USERNAME'
|
|
sh 'kaggle datasets list'
|
|
sh './download.sh'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
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 {
|
|
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'
|
|
}
|
|
}
|
|
}
|
|
} |