Update Jenkinsfile

This commit is contained in:
Alicja Szulecka 2024-04-02 14:13:40 +02:00
parent d12d7850ca
commit b6c4c15a77

37
Jenkinsfile vendored
View File

@ -1,30 +1,31 @@
pipeline { pipeline {
agent { agent {
dockerfile { dockerfile {
args '-v /var/run/docker.sock:/var/run/docker.sock' args '-v /var/run/docker.sock:/var/run/docker.sock'
} }
} }
parameters { parameters {
string(name: 'KAGGLE_USERNAME', defaultValue: 'alicjaszulecka', description: 'Kaggle username') string(name: 'KAGGLE_USERNAME', defaultValue: 'alicjaszulecka', description: 'Kaggle username')
password(name: 'KAGGLE_KEY', defaultValue:'', description: 'Kaggle Key') password(name: 'KAGGLE_KEY', defaultValue:'', description: 'Kaggle Key')
string(name: 'CUTOFF', defaultValue: '100', description: 'cut off number') string(name: 'CUTOFF', defaultValue: '100', description: 'cut off number')
} }
stages { stages {
stage('Git Checkout') { stage('Git Checkout') {
steps { steps {
checkout scm checkout scm
} }
} }
stage('Build') { stage('Build') {
steps { steps {
script { withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}",
def customImage = docker.build("464914", "--build-arg KAGGLE_USERNAME=${params.KAGGLE_USERNAME} --build-arg KAGGLE_KEY=${params.KAGGLE_KEY} .") "KAGGLE_KEY=${params.KAGGLE_KEY}" ]) {
customImage.inside { def customImage = docker.build("test-image", "--build-arg KAGGLE_USERNAME=${params.KAGGLE_USERNAME} --build-arg KAGGLE_KEY=${params.KAGGLE_KEY} .")
sh 'bash ./get_dataset.sh ${params.CUTOFF}' customImage.inside (
} sh 'bash ./get_dataset.sh $CUTOFF'
} archiveArtifacts artifacts: 'artifacts/*', onlyIfSuccessful: true
archiveArtifacts artifacts: 'artifacts/*', onlyIfSuccessful: true )
} }
} }
} }
} }
}