ium_487187/JenkinsfileDVC

70 lines
1.6 KiB
Plaintext
Raw Normal View History

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 """
2023-05-23 23:16:29 +02:00
git config user.email "jakzar3@st.amu.edu.pl"
git config user.name "s487187"
2023-05-23 23:12:16 +02:00
"""
}
}
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 {
2023-05-23 23:17:16 +02:00
git url: 'https://git.wmi.amu.edu.pl/s487187/ium_487187'
2023-05-23 23:07:58 +02:00
} catch (Exception err) {
error "Failed to clone repository: ${err.message}"
}
2023-05-23 22:03:38 +02:00
}
}
}
2023-05-23 23:20:35 +02:00
stage('Setup Python') {
steps {
sh '''
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python3 get-pip.py --user
'''
}
}
stage('Install DVC') {
steps {
sh 'python3 -m pip install --user dvc'
}
}
2023-05-23 23:18:50 +02:00
2023-05-24 01:07:30 +02:00
stage('Configure DVC Remote') {
steps {
2023-05-24 01:08:47 +02:00
sh 'PATH=$PATH:~/.local/bin/ dvc remote add -d new_storage /home/user/dvc_storage'
2023-05-24 01:07:30 +02:00
}
}
2023-05-23 22:03:38 +02:00
stage('Pull DVC Files') {
steps {
2023-05-24 01:14:35 +02:00
sh 'PATH=$PATH:~/.local/bin/ dvc pull -f'
2023-05-23 22:03:38 +02:00
}
}
stage('Run DVC Pipeline') {
steps {
2023-05-23 23:21:43 +02:00
sh 'PATH=$PATH:~/.local/bin/ dvc reproduce'
2023-05-23 22:03:38 +02:00
}
}
2023-05-24 01:03:57 +02:00
stage('Push DVC Files') {
steps {
sh 'PATH=$PATH:~/.local/bin/ dvc push'
}
}
2023-05-23 22:03:38 +02:00
}
}