x1/Jenkinsfile

57 lines
1.7 KiB
Plaintext
Raw Permalink Normal View History

2023-06-26 18:49:28 +02:00
pipeline {
agent any
parameters {
string(
defaultValue: 'wojciechbatruszewicz',
description: 'Kaggle username',
name: 'KAGGLE_USERNAME',
trim: false
)
password(
defaultValue: '',
description: 'Kaggle token taken from kaggle.json file, as described in https://github.com/Kaggle/kaggle-api#api-credentials',
name: 'KAGGLE_KEY'
)
string(
defaultValue: '30',
description: 'dataset cutoff',
name: 'CUTOFF',
trim: false
)
}
stages {
stage('Download dataset') {
steps {
checkout scm
2023-06-26 19:10:56 +02:00
sh 'ls -l'
withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}",
"KAGGLE_KEY=${params.KAGGLE_KEY}" ]) {
sh 'kaggle datasets download -d elakiricoder/gender-classification-dataset'
sh 'unzip -o gender-classification-dataset.zip'
2023-06-26 18:49:28 +02:00
}
}
}
stage('Docker') {
steps {
script {
2023-06-26 19:06:29 +02:00
def dockerImage = docker.build("docker-image", "./")
2023-06-26 18:49:28 +02:00
dockerImage.inside {
2023-06-26 19:10:56 +02:00
sh 'ls -l'
2023-06-26 18:49:28 +02:00
sh 'ls -l'
2023-06-26 19:08:30 +02:00
sh 'python3 createDataset.py'
2023-06-26 18:49:28 +02:00
archiveArtifacts 'gender_classification_train.csv'
archiveArtifacts 'gender_classification_test.csv'
archiveArtifacts 'gender_classification_val.csv'
sh 'ls -l'
}
}
}
2023-06-26 20:08:25 +02:00
}
2023-06-26 18:49:28 +02:00
}
2023-06-26 20:08:25 +02:00
post {
success {
2023-06-26 20:11:03 +02:00
build job: 'x1-training/main', wait: false
2023-06-26 20:08:25 +02:00
}
}
2023-06-26 18:49:28 +02:00
}