2023-05-23 22:03:38 +02:00
|
|
|
pipeline {
|
|
|
|
agent any
|
|
|
|
|
|
|
|
tools {
|
2023-05-23 23:06:26 +02:00
|
|
|
git 'Default'
|
2023-05-23 22:03:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
stages {
|
2023-05-23 23:12:16 +02:00
|
|
|
stage('Setup Git') {
|
|
|
|
steps {
|
|
|
|
sh """
|
|
|
|
git config --global user.email "jakzar3@st.amu.edu.pl"
|
|
|
|
git config --global user.name "s487187"
|
|
|
|
"""
|
|
|
|
}
|
|
|
|
}
|
2023-05-23 23:13:19 +02:00
|
|
|
|
|
|
|
// stage('Install DVC') {
|
|
|
|
// steps {
|
|
|
|
// sh 'pip install dvc'
|
|
|
|
// }
|
|
|
|
// }
|
2023-05-23 23:06:26 +02:00
|
|
|
|
2023-05-23 22:03:38 +02:00
|
|
|
stage('Clone Repository') {
|
|
|
|
steps {
|
2023-05-23 23:07:58 +02:00
|
|
|
script {
|
|
|
|
try {
|
|
|
|
git 'https://git.wmi.amu.edu.pl/s487187/ium_487187.git'
|
|
|
|
} catch (Exception err) {
|
|
|
|
error "Failed to clone repository: ${err.message}"
|
|
|
|
}
|
2023-05-23 22:03:38 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stage('Create dvc.yaml') {
|
|
|
|
steps {
|
|
|
|
writeFile file: 'dvc.yaml', text: '''
|
|
|
|
stages:
|
|
|
|
prepare:
|
|
|
|
cmd: python prepare_data.py
|
|
|
|
deps:
|
|
|
|
- raw_data.csv
|
|
|
|
outs:
|
|
|
|
- processed_data.csv
|
|
|
|
'''
|
|
|
|
sh 'git add dvc.yaml'
|
|
|
|
sh 'git commit -m "Add dvc.yaml"'
|
|
|
|
sh 'git push origin HEAD'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
stage('Pull DVC Files') {
|
|
|
|
steps {
|
|
|
|
sh 'dvc pull'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
stage('Run DVC Pipeline') {
|
|
|
|
steps {
|
|
|
|
sh 'dvc reproduce'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|