Dockerfile

This commit is contained in:
Mateusz 2024-04-01 17:13:05 +02:00
parent e3d5fa89f1
commit 32bcaf02f0
2 changed files with 8 additions and 5 deletions

9
Jenkinsfile vendored
View File

@ -20,13 +20,16 @@ pipeline {
) )
} }
environment {
KAGGLE_USERNAME = "${params.KAGGLE_USERNAME}"
KAGGLE_KEY = "${params.KAGGLE_KEY}"
}
stages { stages {
stage('Run create-dataset script') { stage('Run create-dataset script') {
steps { steps {
withEnv (["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}", "KAGGLE_KEY=${params.KAGGLE_KEY}"]) {
sh 'chmod +x create-dataset.py' sh 'chmod +x create-dataset.py'
sh 'python3 ./create-dataset.py $KAGGLE_USERNAME' sh 'python3 ./create-dataset.py $KAGGLE_USERNAME $KAGGLE_KEY'
}
} }
} }
stage('Archive Artifacts') { stage('Archive Artifacts') {

View File

@ -10,8 +10,8 @@ from sklearn.model_selection import train_test_split
def download_kaggle_dataset(): def download_kaggle_dataset():
os.environ["KAGGLE_USERNAME"] = "vskyper" os.environ["KAGGLE_USERNAME"] = sys.argv[1]
os.environ["KAGGLE_KEY"] = sys.argv[1] os.environ["KAGGLE_KEY"] = sys.argv[2]
kaggle = KaggleApi() kaggle = KaggleApi()
kaggle.authenticate() kaggle.authenticate()
kaggle.dataset_download_files("mlg-ulb/creditcardfraud", path="./", unzip=True) kaggle.dataset_download_files("mlg-ulb/creditcardfraud", path="./", unzip=True)