From 42977eba9fd78728837014a3b68acf826411bf80 Mon Sep 17 00:00:00 2001 From: Sanchit Vijay Date: Sat, 13 Apr 2024 16:10:51 -0400 Subject: [PATCH] Jenkins able to modify test status --- ci/Jenkinsfile | 35 +++++++---------------------------- 1 file changed, 7 insertions(+), 28 deletions(-) diff --git a/ci/Jenkinsfile b/ci/Jenkinsfile index a84be2f..7951ab5 100644 --- a/ci/Jenkinsfile +++ b/ci/Jenkinsfile @@ -10,27 +10,21 @@ pipeline { CMAKE_ARGS = "-DLLAMA_CUBLAS=on" PATH="/usr/local/cuda-12.3/bin:$PATH" LD_LIBRARY_PATH="/usr/local/cuda-12.3/lib64:$LD_LIBRARY_PATH" + GIT_SSH_COMMAND="ssh -o StrictHostKeyChecking=accept-new" } stages { - stage('Checkout') { steps { cleanWs() checkout scm - // checkout scmGit( - // branches: [[name: 'main']], - // userRemoteConfigs: [[credentialsId: 'GithubKey', - // url: 'ssh://git@github.com:arjbingly/Capstone_5.git']] - // ) } } stage('Create venv'){ steps { sh 'python3 -m venv .venv' - sh 'exit 1' } } @@ -108,42 +102,27 @@ pipeline { junit 'pytest-report.xml' } } - // cleanup{ - // cleanWs( - // cleanWhenNotBuilt: false, - // deleteDirs: true, - // disableDeferredWipeout: true, - // notFailBuild: true, - // patterns: [[pattern: '.gitignore', type: 'INCLUDE'], - // [pattern: '.propsfile', type: 'EXCLUDE']] - // ) - } } } } post { failure{ - // sshagent(credentials: ['GithubKey']){ - // git url: "ssh://git@github.com:arjbingly/Capstone_5.git", - // credentialsId: 'GithubKey', - // branch: main - // sh 'git clone git@github.com:arjbingly/Capstone_5.git' - // sh 'cd Capstone_5' + sshagent(credentials: ['GithubKey']){ + sh 'git checkout main' sh 'python3 ci/modify_test_status.py --fail' sh 'git add README.md' sh 'git commit -m "test status updated"' sh 'git push' - // } + } } success{ - // sshagent(credentials: ['GithubKey']){ - // sh 'git@github.com:arjbingly/Capstone_5.git' - // sh 'cd Capstone_5' + sshagent(credentials: ['GithubKey']){ + sh 'git checkout main' sh 'python3 ci/modify_test_status.py --fail' sh 'git add README.md' sh 'git commit -m "test status updated"' sh 'git push' - // } + } } cleanup{ cleanWs(