created Jenkinsfile ium6
This commit is contained in:
parent
390d6b118b
commit
b7b992cb8a
57
Jenkinsfile-ium-6
Normal file
57
Jenkinsfile-ium-6
Normal file
@ -0,0 +1,57 @@
|
||||
pipeline {
|
||||
agent any
|
||||
|
||||
parameters {
|
||||
string(name: 'KAGGLE_USERNAME', defaultValue: 'gulczas', description: 'Kaggle username')
|
||||
password(name: 'KAGGLE_KEY', defaultValue: '', description: 'Kaggle API key')
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('Clone Repository') {
|
||||
steps {
|
||||
git 'https://git.wmi.amu.edu.pl/s464953/ium_464953.git'
|
||||
}
|
||||
}
|
||||
|
||||
stage('Stop and remove existing container') {
|
||||
steps {
|
||||
script {
|
||||
sh "docker stop s464953 || true"
|
||||
sh "docker rm s464953 || true"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Build Docker image') {
|
||||
steps {
|
||||
script {
|
||||
withEnv([
|
||||
"KAGGLE_USERNAME=${env.KAGGLE_USERNAME}",
|
||||
"KAGGLE_KEY=${env.KAGGLE_KEY}"
|
||||
]) {
|
||||
sh "docker build --build-arg KAGGLE_USERNAME=$KAGGLE_USERNAME --build-arg KAGGLE_KEY=$KAGGLE_KEY -t s464953 ."
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Run Docker container') {
|
||||
steps {
|
||||
script {
|
||||
withEnv([
|
||||
"KAGGLE_USERNAME=${env.KAGGLE_USERNAME}",
|
||||
"KAGGLE_KEY=${env.KAGGLE_KEY}"
|
||||
]) {
|
||||
sh "docker run --name s464953 -e KAGGLE_USERNAME=$KAGGLE_USERNAME -e KAGGLE_KEY=$KAGGLE_KEY -v ${WORKSPACE}:/app s464953"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Archive stats.txt artifact') {
|
||||
steps {
|
||||
archiveArtifacts artifacts: 'model.pkl', allowEmptyArchive: true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,4 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
python3 model_creator.py
|
||||
python3 use_model.py
|
||||
|
Loading…
Reference in New Issue
Block a user