edited Jenkinsfile and added get_dataset.sh
This commit is contained in:
parent
2a72dd5df3
commit
27d18e1c0d
40
Jenkinsfile
vendored
40
Jenkinsfile
vendored
@ -3,23 +3,39 @@ node {
|
|||||||
properties([
|
properties([
|
||||||
parameters([
|
parameters([
|
||||||
string(
|
string(
|
||||||
defaultValue: 'Hello World!',
|
defaultValue: 'lukkoz2',
|
||||||
description: 'Tekst do wyświetlenie',
|
description: 'Kaggle username',
|
||||||
name: 'INPUT_TEXT',
|
name: 'KAGGLE_USERNAME',
|
||||||
trim: false
|
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('Hello') {
|
|
||||||
//Wypisz wartość parametru w konsoli (To nie jest polecenie bash, tylko groovy!)
|
stage('checkout: Check out from version control') {
|
||||||
echo "INPUT_TEXT: ${INPUT_TEXT}"
|
checkout([$class: 'GitSCM',
|
||||||
//Wywołaj w konsoli komendę "figlet", która generuje ASCI-art
|
branches: [[name: '*/master']],
|
||||||
sh "figlet \"${INPUT_TEXT}\" | tee output.txt"
|
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
|
||||||
}
|
}
|
||||||
stage('Goodbye') {
|
|
||||||
echo 'Goodbye!'
|
|
||||||
//Zarchiwizuj wynik
|
|
||||||
archiveArtifacts 'output.txt'
|
|
||||||
}
|
}
|
||||||
}
|
}
|
3
get_dataset.sh
Normal file
3
get_dataset.sh
Normal 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
|
Loading…
Reference in New Issue
Block a user