Jenkins script mod

This commit is contained in:
s478841 2022-03-26 17:09:29 +01:00
parent 78d8bf5fc4
commit 56e93c6c86

72
Jenkinsfile vendored
View File

@ -1,41 +1,35 @@
pipeline { node {
agent any stage('Preparation') {
parameters { properties ([
string( parameters([
defaultValue:'mateuszogrodowczyk', string(
description: 'Kaggle username', defaultValue:'mateuszogrodowczyk',
name: 'KAGGLE_USERNAME', description: 'Kaggle username',
trim: false name: 'KAGGLE_USERNAME',
) trim: false
password( ),
defaultValue: '', password(
description: 'Kaggle access token retrieved from kaggle.json file - https://github.com/Kaggle/kaggle-api#api-credentials', defaultValue: '',
name: 'KAGGLE_KEY' description: 'Kaggle access token retrieved from kaggle.json file - https://github.com/Kaggle/kaggle-api#api-credentials',
) name: 'KAGGLE_KEY'
)
])
])
} }
environment { }
KAGGLE_USERNAME="$params.KAGGLE_USERNAME"
KAGGLE_KEY="$params.KAGGLE_KEY" stage('Install depends.') {
sh 'pip install --user -r requirements.txt'
}
stage('Prepare dataset') {
withEnv([
"KAGGLE_USERNAME=${params.KAGGLE_USERNAME}",
"KAGGLE_KEY=${params.KAGGLE_KEY}"
]) {
sh 'echo Welcome: $KAGGLE_USERNAME'
sh 'kaggle datasets list'
} }
stages {
stage('Install depends.') { sh 'chmod u+x ./load_data.sh'
steps { sh './load_data.sh'
sh "pip install --user -r requirements.txt" }
}
}
stage('Prepare dataset') {
steps {
script {
withEnv([
"KAGGLE_USERNAME=${params.KAGGLE_USERNAME}",
"KAGGLE_KEY=${params.KAGGLE_KEY}"
])
sh 'echo Welcome: $KAGGLE_USERNAME'
sh 'kaggle datasets list'
}
sh "chmod u+x ./load_data.sh"
sh "./load_data.sh"
}
}
}
}