ium_z434686/Jenkinsfile_create_dataset

77 lines
2.2 KiB
Plaintext

pipeline {
agent any
//Definijuemy parametry, które będzie można podać podczas wywoływania zadania
parameters{
string(
defaultValue: 'patrykgaka',
description: 'Kaggle username',
name: 'KAGGLE_USERNAME',
trim: false
)
password(
defaultValue: 'd14370cec1714b0cd1ef2875038b5950',
description: 'Kaggle token taken from kaggle.json file, as described in https://github.com/Kaggle/kaggle-api#api-credentials',
name: 'KAGGLE_KEY'
)
string(
defaultValue: '0',
description: 'CUTOFF',
name: 'CUTOFF',
trim: false
)
}
stages {
stage('clear_all') {
steps {
//Wypisz wartość parametru w konsoli (To nie jest polecenie bash, tylko groovy!)
sh 'rm -rf *'
}
}
stage('checkout') {
steps {
//Wypisz wartość parametru w konsoli (To nie jest polecenie bash, tylko groovy!)
sh 'git clone https://git.wmi.amu.edu.pl/s434686/ium_z434686'
}
}
stage('Build') {
steps {
// Run the maven build
withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}",
"KAGGLE_KEY=${params.KAGGLE_KEY}" ]) {
sh 'kaggle datasets download -d rush4ratio/video-game-sales-with-ratings'
sh 'unzip video-game-sales-with-ratings.zip'
sh 'rm video-game-sales-with-ratings.zip'
sh 'ls -a | tee dataset.csv'
}
}
}
stage('Docker') {
agent {
dockerfile {
filename 'create.dockerfile'
args '-v $HOME:/script'
}
}
steps {
echo 'building docker'
sh 'docker cp file.txt file.txt'
}
}
stage('Goodbye!') {
steps {
echo 'Goodbye!'
//Zarchiwizuj wynik
//archiveArtifacts 'output.txt'
archiveArtifacts 'dataset.csv'
archiveArtifacts 'file.txt'
}
}
}
}