zad4 jenkins docker image creation

This commit is contained in:
s464953 2024-03-30 13:21:33 +01:00
parent af43187263
commit 032fedce3c

View File

@ -18,22 +18,26 @@ pipeline {
script { script {
withEnv([ withEnv([
"KAGGLE_USERNAME=${env.KAGGLE_USERNAME}", "KAGGLE_USERNAME=${env.KAGGLE_USERNAME}",
"KAGGLE_KEY=${env.KAGGLE_KEY}"]) "KAGGLE_KEY=${env.KAGGLE_KEY}"
]) {
sh "docker build --build-arg KAGGLE_USERNAME=$KAGGLE_USERNAME --build-arg KAGGLE_KEY=$KAGGLE_KEY -t s464953 ." sh "docker build --build-arg KAGGLE_USERNAME=$KAGGLE_USERNAME --build-arg KAGGLE_KEY=$KAGGLE_KEY -t s464953 ."
} }
} }
} }
}
stage('Run Docker container') { stage('Run Docker container') {
steps { steps {
script { script {
withEnv([ withEnv([
"KAGGLE_USERNAME=${env.KAGGLE_USERNAME}", "KAGGLE_USERNAME=${env.KAGGLE_USERNAME}",
"KAGGLE_KEY=${env.KAGGLE_KEY}"]) "KAGGLE_KEY=${env.KAGGLE_KEY}"
]) {
sh "docker run --name s464953 -e KAGGLE_USERNAME=$KAGGLE_USERNAME -e KAGGLE_KEY=$KAGGLE_KEY -v ${WORKSPACE}:/app -ti s464953" sh "docker run --name s464953 -e KAGGLE_USERNAME=$KAGGLE_USERNAME -e KAGGLE_KEY=$KAGGLE_KEY -v ${WORKSPACE}:/app -ti s464953"
} }
} }
} }
}
stage('Archive stats.txt artifact') { stage('Archive stats.txt artifact') {
steps { steps {