Jenkinsfile functions
This commit is contained in:
parent
10fba91117
commit
12b0121c4d
43
Jenkinsfile
vendored
43
Jenkinsfile
vendored
@ -1,12 +1,37 @@
|
|||||||
pipeline {
|
pipeline {
|
||||||
agent any
|
agent any
|
||||||
stages {
|
parameters {
|
||||||
stage('Stage 1') {
|
string(
|
||||||
steps {
|
defaultValue: 'sknera',
|
||||||
|
description: 'username',
|
||||||
echo 'Hello elo jenkins!'
|
name: 'USERNAME',
|
||||||
|
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'
|
||||||
|
)
|
||||||
|
string(
|
||||||
|
defaultValue: '',
|
||||||
|
description: 'Value for head command',
|
||||||
|
name: 'CUTOFF'
|
||||||
|
)
|
||||||
|
}
|
||||||
|
environment {
|
||||||
|
KAGGLE_USERNAME="$params.KAGGLE_USERNAME"
|
||||||
|
KAGGLE_KEY="$params.KAGGLE_KEY"
|
||||||
|
CUTOFF="$params.CUTOFF"
|
||||||
|
}
|
||||||
|
stages {
|
||||||
|
stage('Stage 1') {
|
||||||
|
steps {
|
||||||
|
echo 'Hello world'
|
||||||
|
checkout([$class: 'GitSCM', branches: [[name: '*/master']], extensions: [], userRemoteConfigs: [[url: 'https://git.wmi.amu.edu.pl/s444354/ium_444354']]])
|
||||||
|
sh "chmod u+x ./dataset_download.sh"
|
||||||
|
sh "KAGGLE_USERNAME=${KAGGLE_USERNAME} KAGGLE_KEY=${KAGGLE_KEY} CUTOFF=${CUTOFF} ./download.sh"
|
||||||
|
archiveArtifacts 'data.txt'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
52
Jenkinsfile2
52
Jenkinsfile2
@ -1,25 +1,37 @@
|
|||||||
pipeline {
|
pipeline {
|
||||||
agent any
|
agent any
|
||||||
stages {
|
parameters {
|
||||||
stage('Check out from version control') {
|
string(
|
||||||
|
defaultValue: 'sknera',
|
||||||
|
description: 'username',
|
||||||
|
name: 'USERNAME',
|
||||||
|
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'
|
||||||
|
)
|
||||||
|
string(
|
||||||
|
defaultValue: '',
|
||||||
|
description: 'Value for head command',
|
||||||
|
name: 'CUTOFF'
|
||||||
|
)
|
||||||
|
}
|
||||||
|
environment {
|
||||||
|
KAGGLE_USERNAME="$params.KAGGLE_USERNAME"
|
||||||
|
KAGGLE_KEY="$params.KAGGLE_KEY"
|
||||||
|
CUTOFF="$params.CUTOFF"
|
||||||
|
}
|
||||||
|
stages {
|
||||||
|
stage('Stage 1') {
|
||||||
steps {
|
steps {
|
||||||
checkout scm
|
echo 'Hello world'
|
||||||
|
checkout([$class: 'GitSCM', branches: [[name: '*/master']], extensions: [], userRemoteConfigs: [[url: 'https://git.wmi.amu.edu.pl/s444354/ium_444354']]])
|
||||||
|
sh "chmod u+x ./dataset_download.sh"
|
||||||
|
sh "KAGGLE_USERNAME=${KAGGLE_USERNAME} KAGGLE_KEY=${KAGGLE_KEY} CUTOFF=${CUTOFF} ./download.sh"
|
||||||
|
archiveArtifacts 'data.txt'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
stage('Shell Script') {
|
}
|
||||||
steps {
|
|
||||||
sh '''#!/bin/bash
|
|
||||||
sh './script.sh'
|
|
||||||
'''
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user