From 82f0abf86aef11bfc82ef1bd7d9b383a315762d6 Mon Sep 17 00:00:00 2001 From: Kamila Date: Sun, 3 Apr 2022 12:30:04 +0200 Subject: [PATCH] docker task 2 try_5 --- Jenkinsfile_2 | 18 +++--------------- data_expl.py | 8 ++++---- 2 files changed, 7 insertions(+), 19 deletions(-) diff --git a/Jenkinsfile_2 b/Jenkinsfile_2 index 4cea67a..0371366 100644 --- a/Jenkinsfile_2 +++ b/Jenkinsfile_2 @@ -1,11 +1,8 @@ pipeline { - agent any + agent { + docker { image 'kambobdocker420/ium:version2.0' } + } parameters { - buildSelector( - defaultSelector: lastSuccessful(), - description: 'Which build to use for copying artifacts', - name: 'BUILD_SELECTOR' - ) } stages { @@ -14,15 +11,6 @@ pipeline { echo 'Hello world but for the second time!' } } - - stage('Copy and proceed') { - steps { - copyArtifacts filter: 'apps_*.csv', fingerprintArtifacts: true, projectName: 's444517-create-dataset', selector: buildParameter('BUILD_SELECTOR') - sh 'chmod +x -R ./data_stats.sh' - sh './data_stats.sh' - archiveArtifacts artifacts: 'stats.txt' - } - } } } diff --git a/data_expl.py b/data_expl.py index d0fd912..53fbe20 100644 --- a/data_expl.py +++ b/data_expl.py @@ -35,13 +35,13 @@ train, validate, test = np.split(data.sample(frac=1, random_state=42), [int(.6*l print(f"Data shape: {data.shape}\nTrain shape: {train.shape}\nTest shape: {test.shape}\nValidation shape:{validate.shape}") f = open("apps_train.csv", "w") -f.write(train) +f.write(str(train)) f.close() f = open("apps_test.csv", "w") -f.write(test) +f.write(str(test)) f.close() f = open("apps_validate.csv", "w") -f.write(validate) -f.close() \ No newline at end of file +f.write(str(validate)) +f.close()