ium_z487175/Jenkinsfile

56 lines
2.0 KiB
Plaintext
Raw Normal View History

2023-04-15 11:14:16 +02:00
pipeline {
agent any
stages {
stage('Preparation') {
2023-04-15 11:16:02 +02:00
steps {
script {
properties([
parameters([
string(
defaultValue: 'nbrt10',
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'
)
])
])
}
}
2023-04-15 11:14:16 +02:00
}
stage('Kaggle') {
steps {
2023-04-15 11:16:02 +02:00
script {
withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}",
"KAGGLE_KEY=${params.KAGGLE_KEY}" ]) {
sh 'echo KAGGLE_USERNAME: $KAGGLE_USERNAME'
}
2023-04-15 11:14:16 +02:00
}
}
}
2023-04-15 11:52:56 +02:00
stage('Checkout') {
2023-04-15 11:14:16 +02:00
steps {
git branch: 'master', url: 'https://git.wmi.amu.edu.pl/s487175/ium_z487175.git'
}
}
2023-04-15 11:52:56 +02:00
stage('Shell script') {
2023-04-15 11:21:43 +02:00
steps {
2023-04-15 11:52:56 +02:00
sh 'kaggle datasets download -d shivam2503/diamonds > output.txt'
sh 'unzip -o diamonds.zip >> output.txt'
// przypisanie uprawnień
2023-04-15 11:24:34 +02:00
sh 'chmod +x s487175-create-dataset-script.py'
2023-04-15 11:52:56 +02:00
// wywołanie skryptu z poprzednich zajęć
sh 'python3 ./s487175-create-dataset-script.py >> output.txt'
2023-04-15 11:21:43 +02:00
}
}
2023-04-15 11:52:56 +02:00
stage('Archive file') {
steps {
archiveArtifacts artifacts: 'output.txt, diamonds.csv', fingerprint: true
}
}
2023-04-15 11:14:16 +02:00
}
2023-03-25 13:43:57 +01:00
}