ium_464903/Jenkinsfile4

73 lines
2.4 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 {
upstream(upstreamProjects: 's464903-create-dataset', threshold: hudson.model.Result.SUCCESS)
}
2024-05-11 10:38:04 +02:00
stages {
stage('Build image'){
steps {
script {
checkout scm
def testImage = docker.build("test-image", "-f Dockerfile2 .")
}
}
}
stage('Run in container'){
steps {
script {
docker.image('test-image').inside {
stage('Checkout') {
steps {
// Step: Clone the git repository
checkout scm
}
}
stage('Build') {
steps {
withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}",
"KAGGLE_KEY=${params.KAGGLE_KEY}" ]) {
sh 'echo KAGGLE_USERNAME: $KAGGLE_USERNAME'
sh 'kaggle datasets list'
}
}
}
stage('Run ipynb script') {
steps {
sh "mkdir /notebooks"
docker.cp('Biblioteka_DL_trenowanie.ipynb', '/notebooks/Biblioteka_DL_trenowanie.ipynb')
}
}
stage('Archive Artifacts - model') {
steps {
// Step: Archive artifacts
archiveArtifacts artifacts: 'mode.keras', fingerprint: true
}
}
}
}
}
}
}
}