edited Jenkinsfile and added get_dataset.sh

This commit is contained in:
koziej97 2023-03-29 00:12:41 +02:00
parent 2a72dd5df3
commit 27d18e1c0d
2 changed files with 41 additions and 22 deletions

60
Jenkinsfile vendored
View File

@ -1,25 +1,41 @@
node {
stage('Preparation') {
properties([
parameters([
string(
defaultValue: 'Hello World!',
description: 'Tekst do wyświetlenie',
name: 'INPUT_TEXT',
trim: false
)
])
])
}
stage('Hello') {
//Wypisz wartość parametru w konsoli (To nie jest polecenie bash, tylko groovy!)
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') {
echo 'Goodbye!'
//Zarchiwizuj wynik
archiveArtifacts 'output.txt'
stage('Preparation') {
properties([
parameters([
string(
defaultValue: 'lukkoz2',
description: 'Kaggle username',
name: 'KAGGLE_USERNAME',
trim: false
),
password(
defaultValue: '',
description: 'Kaggle token taken from kaggle.json file, as described in https://github.com/Kaggle/kaggle-api#api-credentials',
name: 'KAGGLE_KEY'
)
])
])
}
stage('checkout: Check out from version control') {
checkout([$class: 'GitSCM',
branches: [[name: '*/master']],
extensions: [],
userRemoteConfigs: [[credentialsId: 's425850', url: 'https://git.wmi.amu.edu.pl/s425850/ium_425850']]])
}
stage('Build') {
// Run the maven build
withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}",
"KAGGLE_KEY=${params.KAGGLE_KEY}" ]) {
sh 'echo KAGGLE_USERNAME: $KAGGLE_USERNAME'
sh 'kaggle datasets list'
sh 'chmod u+x ./get_dataset.sh'
sh './get_dataset.sh'
}
stage('Save data into artifacts') {
archiveArtifacts artifacts: 'books_edited.csv', followSymlinks: false
}
}
}

3
get_dataset.sh Normal file
View File

@ -0,0 +1,3 @@
kaggle datasets download -d dylanjcastillo/7k-books-with-metadata
unzip -o 7k-books-with-metadata.zip
cut -d ',' -f 1,2,4,7,8 --complement books.csv > books_edited.csv