ium-s301654/Jenkinsfile

35 lines
870 B
Plaintext
Raw Permalink Normal View History

2024-04-03 09:35:02 +02:00
pipeline {
2024-04-10 11:21:52 +02:00
agent {
dockerfile {
args '-u root --privileged'
}
}
parameters {
2024-04-10 10:05:01 +02:00
string (
defaultValue: 'my_username',
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/blob/main/docs/README.md#api-credentials',
name: 'KAGGLE_KEY'
)
}
stages {
2024-04-10 11:21:52 +02:00
stage('Test') {
2024-04-10 10:05:01 +02:00
steps {
script {
2024-04-10 11:36:00 +02:00
withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}", "KAGGLE_KEY=${params.KAGGLE_KEY}"]) {
2024-04-10 11:31:42 +02:00
sh 'set +x'
2024-04-10 11:27:14 +02:00
sh 'echo "{\"username\":\"$KAGGLE_USERNAME\",\"key\":\"$KAGGLE_KEY\"}" > ~/.kaggle/kaggle.json'
2024-04-10 11:31:42 +02:00
sh 'set -x'
2024-04-10 10:05:01 +02:00
sh 'kaggle datasets list'
}
2024-04-03 09:35:02 +02:00
}
2024-04-10 10:05:01 +02:00
}
2024-04-10 10:13:40 +02:00
}
2024-04-10 10:14:26 +02:00
}
2024-04-10 10:55:16 +02:00
}