iumKC/JenkinsDatastatsDockerhub

63 lines
1.9 KiB
Plaintext
Raw Normal View History

2024-04-03 08:47:40 +02:00
pipeline {
agent {
docker {
2024-04-03 08:50:15 +02:00
image 'karolcyganik/ium:latest'
2024-04-03 08:47:40 +02:00
}
}
parameters {
string(
defaultValue: 'karol9',
description: 'Kaggle username',
name: 'KAGGLE_USERNAME',
trim: false
)
string(
defaultValue: '100',
description: 'Dataset cutoff size',
name: 'CUTOFF'
)
password(
defaultValue: '',
description: 'Kaggle token taken from kaggle.json file, as described in https://github.com/Kaggle/kaggle-api#api-credentials',
name: 'KAGGLE_KEY'
)
}
stages {
stage('Checkout') {
steps {
git branch: 'main', url: 'https://git.wmi.amu.edu.pl/s495715/iumKC.git'
}
}
2024-04-14 14:25:13 +02:00
stage('Download Dataset') {
steps {
script {
def datasetDir = 'football_dataset'
def downloadDir = 'football_dataset_download'
if (!fileExists(downloadDir)) {
sh "mkdir ${downloadDir}"
}
withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}",
"KAGGLE_KEY=${params.KAGGLE_KEY}"]) {
sh "kaggle datasets download sadhliroomyprime/football-semantic-segmentation -p ${downloadDir}"
sh "unzip ${downloadDir}/*.zip -d ${datasetDir}"
}
}
}
}
2024-04-03 09:04:23 +02:00
stage('Copy Artifacts') {
2024-04-03 08:47:40 +02:00
steps {
2024-04-03 09:04:23 +02:00
script {
2024-04-03 09:07:50 +02:00
copyArtifacts fingerprintArtifacts: true, projectName: 'z-s495715-create-dataset', selector: specific('16')
2024-04-03 09:04:23 +02:00
}
}
}
stage('Execute Script') {
steps {
2024-04-03 09:09:30 +02:00
sh 'python3 main.py'
2024-04-03 08:47:40 +02:00
}
}
}
}