add bash script to Jenkinsfile

This commit is contained in:
Michał Dudziak 2023-03-23 11:47:07 +01:00
parent c6fddb659e
commit df7081a629

26
Jenkinsfile vendored
View File

@ -1,25 +1,11 @@
node { node {
stage('Preparation') { stage('Download data') {
properties([ checkout scmGit(branches: [[name: '*/master']], extensions: [], userRemoteConfigs: [[url: 'https://git.wmi.amu.edu.pl/s452662/ium_452662']])
parameters([
string(
defaultValue: 'Hello World!',
description: 'Tekst do wyświetlenie',
name: 'INPUT_TEXT',
trim: false
)
])
])
} }
stage('Hello') { stage('Cut data') {
//Wypisz wartość parametru w konsoli (To nie jest polecenie bash, tylko groovy!) sh '''kaggle datasets download -d aleksandrglotov/car-prices-poland unzip -o car-prices-poland.zip wc -l Car_Prices_Poland_Kaggle.csv head -n 11793 Car_Prices_Poland_Kaggle.csv > cars_test.csv head -n 23586 Car_Prices_Poland_Kaggle.csv | tail -11793 > cars_dev.csv tail -n 1037740 Car_Prices_Poland_Kaggle.csv > cars_train.csv'''
echo "INPUT_TEXT: ${INPUT_TEXT}"
//Wywołaj w konsoli komendę "figlet", która generuje ASCI-art
sh "figlet \"${INPUT_TEXT}\" | tee output.txt"
} }
stage('Goodbye') { stage('Save data into artifacts') {
echo 'Goodbye!' archiveArtifacts artifacts: '*.csv', followSymlinks: false
//Zarchiwizuj wynik
archiveArtifacts 'output.txt'
} }
} }