Update 'Jenkinsfile-Docker'

This commit is contained in:
Wojciech Mikołajski 2023-04-19 19:50:03 +02:00
parent 9e3bc83b74
commit 3f1def11e3

View File

@ -1,10 +1,38 @@
node { node {
sh "chmod +x create_dataset.py" stage('Preparation') {
checkout scm properties([
def testImage = docker.build("test-image") parameters([
testImage.inside { string(
defaultValue: 'login',
sh 'ls -l' description: 'Kaggle username',
sh 'python3 create_dataset.py' name: 'KAGGLE_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: '7999',
description: 'Cut off value',
name: 'CUT',
trim: false
)
])
])
}
stage('checkout: Check out from version control') {
checkout scm
}
stage('Build Docker image') {
steps {
sh 'docker build -t wujt89 -f Dockerfile .'
} }
} }
stage('sh: Shell Script') {
script {
sh 'docker run -v ${env.WORKSPACE}/artifacts:/app/artifacts wujt89 python3 ./create_dataset.py'
}
}
}