From fb93822b1411b50b746d9be12ef11f37e51a4ed8 Mon Sep 17 00:00:00 2001 From: Nick Date: Fri, 13 Sep 2019 08:29:42 -0400 Subject: Add jenkinsfile format checker --- Jenkinsfile | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'Jenkinsfile') diff --git a/Jenkinsfile b/Jenkinsfile index 8a3ad19..5863a5a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -6,7 +6,17 @@ pipeline { options { disableConcurrentBuilds() } - + stages { + stage('formatting-check') { + steps { + sh ''' + git remote rm upstream + git remote add upstream https://github.com/purdue-aalp/gpgpu-sim_distribution + git fetch upstream + git diff --name-only upstream/dev | grep -E "*.cc|*.h|*.cpp|*.hpp" | xargs ./run-clang-format.py --clang-format-executable /home/tgrogers-raid/a/green349/clang-format + ''' + } + } stages { stage('simulator-build') { steps { -- cgit v1.3 From b35d8200f0d504abb1143d2279bf4a90465e9715 Mon Sep 17 00:00:00 2001 From: Nick Date: Fri, 13 Sep 2019 08:44:11 -0400 Subject: Bad jenkinsfile... do what I mean, not what I say --- Jenkinsfile | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'Jenkinsfile') diff --git a/Jenkinsfile b/Jenkinsfile index 5863a5a..034efdb 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -7,17 +7,16 @@ pipeline { disableConcurrentBuilds() } stages { - stage('formatting-check') { - steps { - sh ''' - git remote rm upstream - git remote add upstream https://github.com/purdue-aalp/gpgpu-sim_distribution - git fetch upstream - git diff --name-only upstream/dev | grep -E "*.cc|*.h|*.cpp|*.hpp" | xargs ./run-clang-format.py --clang-format-executable /home/tgrogers-raid/a/green349/clang-format - ''' + stage('formatting-check') { + steps { + sh ''' + git remote rm upstream + git remote add upstream https://github.com/purdue-aalp/gpgpu-sim_distribution + git fetch upstream + git diff --name-only upstream/dev | grep -E "*.cc|*.h|*.cpp|*.hpp" | xargs ./run-clang-format.py --clang-format-executable /home/tgrogers-raid/a/green349/clang-format + ''' + } } - } - stages { stage('simulator-build') { steps { parallel "4.2": { -- cgit v1.3 From 2bf4de54c854a34f9e33ffcde57a258730c1a9cd Mon Sep 17 00:00:00 2001 From: Nick Date: Fri, 13 Sep 2019 08:53:12 -0400 Subject: fix remote repository problem --- Jenkinsfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Jenkinsfile') diff --git a/Jenkinsfile b/Jenkinsfile index 034efdb..f3a56ad 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -10,7 +10,6 @@ pipeline { stage('formatting-check') { steps { sh ''' - git remote rm upstream git remote add upstream https://github.com/purdue-aalp/gpgpu-sim_distribution git fetch upstream git diff --name-only upstream/dev | grep -E "*.cc|*.h|*.cpp|*.hpp" | xargs ./run-clang-format.py --clang-format-executable /home/tgrogers-raid/a/green349/clang-format @@ -103,6 +102,7 @@ pipeline { } post { success { + sh 'git remote rm upstream' emailext body:'''${SCRIPT, template="groovy-html.success.template"}''', recipientProviders: [[$class: 'CulpritsRecipientProvider'], [$class: 'RequesterRecipientProvider']], @@ -111,6 +111,7 @@ pipeline { to: 'tgrogers@purdue.edu' } failure { + sh 'git remote rm upstream' emailext body: "See ${BUILD_URL}", recipientProviders: [[$class: 'CulpritsRecipientProvider'], [$class: 'RequesterRecipientProvider']], -- cgit v1.3 From 5700eafb50bb254b1e874d4de8f62093c02f19f9 Mon Sep 17 00:00:00 2001 From: Nick Date: Fri, 13 Sep 2019 08:58:38 -0400 Subject: Need to source the right gcc version for clang-format --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) (limited to 'Jenkinsfile') diff --git a/Jenkinsfile b/Jenkinsfile index f3a56ad..345e4ac 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -10,6 +10,7 @@ pipeline { stage('formatting-check') { steps { sh ''' + source /home/tgrogers-raid/a/common/gpgpu-sim-setup/common/export_gcc_version.sh 5.3.0 git remote add upstream https://github.com/purdue-aalp/gpgpu-sim_distribution git fetch upstream git diff --name-only upstream/dev | grep -E "*.cc|*.h|*.cpp|*.hpp" | xargs ./run-clang-format.py --clang-format-executable /home/tgrogers-raid/a/green349/clang-format -- cgit v1.3 From 0215e8047a647f2b8897f26ace86e6de8dfc51d9 Mon Sep 17 00:00:00 2001 From: Nick Date: Fri, 13 Sep 2019 10:05:58 -0400 Subject: Point to executable in tmp for now --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Jenkinsfile') diff --git a/Jenkinsfile b/Jenkinsfile index 345e4ac..e3ae91e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -13,7 +13,7 @@ pipeline { source /home/tgrogers-raid/a/common/gpgpu-sim-setup/common/export_gcc_version.sh 5.3.0 git remote add upstream https://github.com/purdue-aalp/gpgpu-sim_distribution git fetch upstream - git diff --name-only upstream/dev | grep -E "*.cc|*.h|*.cpp|*.hpp" | xargs ./run-clang-format.py --clang-format-executable /home/tgrogers-raid/a/green349/clang-format + git diff --name-only upstream/dev | grep -E "*.cc|*.h|*.cpp|*.hpp" | xargs ./run-clang-format.py --clang-format-executable /tmp/clang-format ''' } } -- cgit v1.3 From 50b081827365da913c07917afdd8867894d6ad75 Mon Sep 17 00:00:00 2001 From: Nick Date: Fri, 13 Sep 2019 11:03:24 -0400 Subject: try conditional check in bash --- Jenkinsfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Jenkinsfile') diff --git a/Jenkinsfile b/Jenkinsfile index e3ae91e..714ca41 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -13,7 +13,10 @@ pipeline { source /home/tgrogers-raid/a/common/gpgpu-sim-setup/common/export_gcc_version.sh 5.3.0 git remote add upstream https://github.com/purdue-aalp/gpgpu-sim_distribution git fetch upstream - git diff --name-only upstream/dev | grep -E "*.cc|*.h|*.cpp|*.hpp" | xargs ./run-clang-format.py --clang-format-executable /tmp/clang-format + cpp_diff= $(git diff --name-only upstream/dev | grep -E "*.cc|*.h|*.cpp|*.hpp") + if [[ $cpp_diff ]]; then + git diff --name-only upstream/dev | grep -E "*.cc|*.h|*.cpp|*.hpp" | xargs ./run-clang-format.py --clang-format-executable /tmp/clang-format + fi ''' } } -- cgit v1.3 From 9f1817973cb9b12a31ca6481c84701349f184c1d Mon Sep 17 00:00:00 2001 From: Nick Date: Fri, 13 Sep 2019 11:06:59 -0400 Subject: print the files to make sure we are doing things correctly --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) (limited to 'Jenkinsfile') diff --git a/Jenkinsfile b/Jenkinsfile index 714ca41..12b620a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -14,6 +14,7 @@ pipeline { git remote add upstream https://github.com/purdue-aalp/gpgpu-sim_distribution git fetch upstream cpp_diff= $(git diff --name-only upstream/dev | grep -E "*.cc|*.h|*.cpp|*.hpp") + echo $cpp_diff if [[ $cpp_diff ]]; then git diff --name-only upstream/dev | grep -E "*.cc|*.h|*.cpp|*.hpp" | xargs ./run-clang-format.py --clang-format-executable /tmp/clang-format fi -- cgit v1.3 From 163eedb236921672bb2d83b7b7483b5bc1c13e45 Mon Sep 17 00:00:00 2001 From: Nick Date: Fri, 13 Sep 2019 11:10:27 -0400 Subject: Change to the correct directory for clang-format (away from tmp) --- Jenkinsfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'Jenkinsfile') diff --git a/Jenkinsfile b/Jenkinsfile index 12b620a..6b064d9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -14,9 +14,8 @@ pipeline { git remote add upstream https://github.com/purdue-aalp/gpgpu-sim_distribution git fetch upstream cpp_diff= $(git diff --name-only upstream/dev | grep -E "*.cc|*.h|*.cpp|*.hpp") - echo $cpp_diff if [[ $cpp_diff ]]; then - git diff --name-only upstream/dev | grep -E "*.cc|*.h|*.cpp|*.hpp" | xargs ./run-clang-format.py --clang-format-executable /tmp/clang-format + git diff --name-only upstream/dev | grep -E "*.cc|*.h|*.cpp|*.hpp" | xargs ./run-clang-format.py --clang-format-executable /tgrogers-raid/a/common/clang-format/6.0.1/clang-format fi ''' } -- cgit v1.3 From 366d4eda8cb19ecb34dec2e4d821a28914ebfb5a Mon Sep 17 00:00:00 2001 From: Nick Date: Fri, 13 Sep 2019 11:13:41 -0400 Subject: ry and fix condition --- Jenkinsfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'Jenkinsfile') diff --git a/Jenkinsfile b/Jenkinsfile index 6b064d9..f9a87b7 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -13,8 +13,7 @@ pipeline { source /home/tgrogers-raid/a/common/gpgpu-sim-setup/common/export_gcc_version.sh 5.3.0 git remote add upstream https://github.com/purdue-aalp/gpgpu-sim_distribution git fetch upstream - cpp_diff= $(git diff --name-only upstream/dev | grep -E "*.cc|*.h|*.cpp|*.hpp") - if [[ $cpp_diff ]]; then + if git diff --name-only upstream/dev | grep -E "*.cc|*.h|*.cpp|*.hpp" ; then git diff --name-only upstream/dev | grep -E "*.cc|*.h|*.cpp|*.hpp" | xargs ./run-clang-format.py --clang-format-executable /tgrogers-raid/a/common/clang-format/6.0.1/clang-format fi ''' -- cgit v1.3 From d65f6d38f054a48733bd1dfd22cb37864b5bded6 Mon Sep 17 00:00:00 2001 From: Nick Date: Fri, 13 Sep 2019 11:17:45 -0400 Subject: fix path --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Jenkinsfile') diff --git a/Jenkinsfile b/Jenkinsfile index f9a87b7..2db645c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -14,7 +14,7 @@ pipeline { git remote add upstream https://github.com/purdue-aalp/gpgpu-sim_distribution git fetch upstream if git diff --name-only upstream/dev | grep -E "*.cc|*.h|*.cpp|*.hpp" ; then - git diff --name-only upstream/dev | grep -E "*.cc|*.h|*.cpp|*.hpp" | xargs ./run-clang-format.py --clang-format-executable /tgrogers-raid/a/common/clang-format/6.0.1/clang-format + git diff --name-only upstream/dev | grep -E "*.cc|*.h|*.cpp|*.hpp" | xargs ./run-clang-format.py --clang-format-executable /home/tgrogers-raid/a/common/clang-format/6.0.1/clang-format fi ''' } -- cgit v1.3