ium_464903/Jenkinsfile4

80 lines
2.3 KiB
Plaintext
Raw Normal View History

2024-05-11 10:38:04 +02:00
pipeline {
agent any
parameters {
string(
defaultValue: 'jakubbg',
description: 'Kaggle username',
name: 'KAGGLE_USERNAME',
trim: false
)
password(
defaultValue: 'e42b293c818e4ecd7b9365ee037af428',
description: 'Kaggle token taken from kaggle.json file, as described in https://github.com/Kaggle/kaggle-api#api-credentials',
name: 'KAGGLE_KEY'
)
}
2024-05-11 10:45:08 +02:00
triggers {
2024-05-11 10:53:30 +02:00
upstream(upstreamProjects: 'z-s464903-create-dataset', threshold: hudson.model.Result.SUCCESS)
2024-05-11 10:45:08 +02:00
}
2024-05-11 10:38:04 +02:00
stages {
2024-05-11 11:18:54 +02:00
stage('Build image') {
2024-05-11 10:38:04 +02:00
steps {
script {
checkout scm
2024-05-11 12:45:20 +02:00
def testImage = docker.build("image", "./dockerfiles/")
2024-05-11 10:38:04 +02:00
}
}
}
2024-05-11 11:37:46 +02:00
stage('Run in container - Checkout') {
2024-05-11 10:38:04 +02:00
steps {
script {
2024-05-11 11:50:42 +02:00
docker.image('image').inside {
2024-05-11 11:33:04 +02:00
// Step: Clone the git repository
checkout scm
2024-05-11 11:37:46 +02:00
}
}
}
}
stage('Run in container - Build') {
steps {
script {
2024-05-11 11:50:42 +02:00
docker.image('image').inside {
2024-05-11 11:33:04 +02:00
// Step: Build
withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}",
"KAGGLE_KEY=${params.KAGGLE_KEY}" ]) {
sh 'echo KAGGLE_USERNAME: $KAGGLE_USERNAME'
2024-05-11 10:38:04 +02:00
}
2024-05-11 11:37:46 +02:00
}
}
}
}
2024-05-11 10:38:04 +02:00
2024-05-11 11:37:46 +02:00
stage('Run in container - Run ipynb script') {
steps {
script {
2024-05-11 11:50:42 +02:00
docker.image('image').inside {
2024-05-11 11:44:38 +02:00
docker.cp('Biblioteka_DL_trenowanie.ipynb', '/Biblioteka_DL_trenowanie.ipynb')
2024-05-11 11:37:46 +02:00
}
}
}
}
2024-05-11 11:33:04 +02:00
2024-05-11 11:37:46 +02:00
stage('Run in container - Archive Artifacts') {
steps {
script {
2024-05-11 11:50:42 +02:00
docker.image('image').inside {
2024-05-11 11:33:04 +02:00
// Step: Archive Artifacts
2024-05-11 11:56:05 +02:00
archiveArtifacts artifacts: 'model.keras', fingerprint: true
2024-05-11 10:38:04 +02:00
}
}
}
}
2024-05-11 11:16:35 +02:00
}
2024-05-11 10:38:04 +02:00
}