This commit is contained in:
Jakub Zaręba 2023-03-27 21:43:16 +02:00
parent e8348645a9
commit 23a869b2b8

39
Jenkinsfile vendored
View File

@ -1,5 +1,12 @@
node { pipeline {
agent any
stages {
stage('Preparation') { stage('Preparation') {
when { expression { true } }
steps {
script {
try {
properties([ properties([
parameters([ parameters([
string( string(
@ -15,9 +22,17 @@ node {
) )
]) ])
]) ])
} catch (err) {
error "Failed to set up parameters: ${err.message}"
}
}
}
} }
stage('Build') { stage('Build') {
// Run the maven build when { expression { params.KAGGLE_USERNAME && params.KAGGLE_KEY } }
steps {
script {
try {
withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}", withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}",
"KAGGLE_KEY=${params.KAGGLE_KEY}" ]) { "KAGGLE_KEY=${params.KAGGLE_KEY}" ]) {
sh 'echo KAGGLE_USERNAME: $KAGGLE_USERNAME' sh 'echo KAGGLE_USERNAME: $KAGGLE_USERNAME'
@ -25,22 +40,40 @@ node {
#!/bin/bash #!/bin/bash
pip install kaggle pip install kaggle
kaggle datasets download nitishsharma01/olympics-124-years-datasettill-2020 kaggle datasets download -d nitishsharma01/olympics-124-years-datasettill-2020
unzip -o olympics-124-years-datasettill-2020.zip unzip -o olympics-124-years-datasettill-2020.zip
echo "Processed Data" > output.txt echo "Processed Data" > output.txt
''' '''
} }
} catch (err) {
error "Failed to build: ${err.message}"
}
}
}
} }
stage('Clone Git Repository') { stage('Clone Git Repository') {
when { expression { params.KAGGLE_USERNAME && params.KAGGLE_KEY } }
steps {
script {
try {
git 'https://git.wmi.amu.edu.pl/s487187/ium_487187.git' git 'https://git.wmi.amu.edu.pl/s487187/ium_487187.git'
} catch (err) {
error "Failed to clone repository: ${err.message}"
}
}
}
} }
stage('End') { stage('End') {
when { expression { params.KAGGLE_USERNAME && params.KAGGLE_KEY } }
steps {
echo 'Program ended!' echo 'Program ended!'
} }
}
}
post { post {
always { always {