79 lines
2.3 KiB
Plaintext
79 lines
2.3 KiB
Plaintext
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'
|
|
)
|
|
}
|
|
|
|
triggers {
|
|
upstream(upstreamProjects: 'z-s464903-create-dataset', threshold: hudson.model.Result.SUCCESS)
|
|
}
|
|
|
|
stages {
|
|
stage('Build image') {
|
|
steps {
|
|
script {
|
|
checkout scm
|
|
def testImage = docker.build("test-image", "-f Dockerfile2 .")
|
|
}
|
|
}
|
|
}
|
|
|
|
stage('Run in container - Checkout') {
|
|
steps {
|
|
script {
|
|
docker.image('test-image').inside {
|
|
// Step: Clone the git repository
|
|
checkout scm
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
stage('Run in container - Build') {
|
|
steps {
|
|
script {
|
|
docker.image('test-image').inside {
|
|
// Step: Build
|
|
withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}",
|
|
"KAGGLE_KEY=${params.KAGGLE_KEY}" ]) {
|
|
sh 'echo KAGGLE_USERNAME: $KAGGLE_USERNAME'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
stage('Run in container - Run ipynb script') {
|
|
steps {
|
|
script {
|
|
docker.image('test-image').inside {
|
|
docker.cp('Biblioteka_DL_trenowanie.ipynb', '/Biblioteka_DL_trenowanie.ipynb')
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
stage('Run in container - Archive Artifacts') {
|
|
steps {
|
|
script {
|
|
docker.image('test-image').inside {
|
|
// Step: Archive Artifacts
|
|
stash includes: 'model.keras', name: 'artifacts'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|