From 2e047ccad2d76d5482da0a7edfbb5d4328a09956 Mon Sep 17 00:00:00 2001 From: Tomoya Tanjo Date: Fri, 22 Mar 2019 14:44:17 +0900 Subject: [PATCH 1/5] WIP: Generate badges in Jenkins CI --- jenkins.bash | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/jenkins.bash b/jenkins.bash index 962eee6b7..ef17a2b3d 100755 --- a/jenkins.bash +++ b/jenkins.bash @@ -81,9 +81,13 @@ EOF then EXTRA="EXTRA=${EXTRA}" fi + if [[ "$version" = "v1.0" ]] && [[ "$CONTAINER" = "docker" ]] && [ $PYTHON_VERSION -eq 3 ] + then + BADGE=" --badgedir=badges" + fi # shellcheck disable=SC2086 LC_ALL=C.UTF-8 ./run_test.sh --junit-xml=result${PYTHON_VERSION}.xml \ - RUNNER=${CWLTOOL_WITH_COV} "-j$(nproc)"\ + RUNNER=${CWLTOOL_WITH_COV} "-j$(nproc)" ${BADGE} \ ${DRAFT} "${EXTRA}" \ "--classname=py${PYTHON_VERSION}_${CONTAINER}" # LC_ALL=C is to work around junit-xml ASCII only bug @@ -100,5 +104,12 @@ if [ "$GIT_BRANCH" = "origin/master" ] && [[ "$version" = "v1.0" ]] then ./build-cwl-docker.sh fi + +if [ "$GIT_BRANCH" = "origin/master" ] && [ -e badges ] +then + # TODO: push badgedir to the badge repository + true +fi + #docker rm -v $(docker ps -a -f status=exited | sed 's/ */ /g' | cut -d' ' -f1) exit ${CODE} From d9bc6c758b992bb70753cc883392f3d355aaecb5 Mon Sep 17 00:00:00 2001 From: Tomoya Tanjo Date: Wed, 27 Mar 2019 12:30:13 +0900 Subject: [PATCH 2/5] Fix badgedir --- jenkins.bash | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/jenkins.bash b/jenkins.bash index ef17a2b3d..16e7cf3fa 100755 --- a/jenkins.bash +++ b/jenkins.bash @@ -83,7 +83,10 @@ EOF fi if [[ "$version" = "v1.0" ]] && [[ "$CONTAINER" = "docker" ]] && [ $PYTHON_VERSION -eq 3 ] then - BADGE=" --badgedir=badges" + tool_ver=master + badgedir=conformance/cwltool/cwl_${version}/cwltool_${tool_ver} + mkdir -p "$badgedir" + BADGE=" --badgedir=${badgedir}" fi # shellcheck disable=SC2086 LC_ALL=C.UTF-8 ./run_test.sh --junit-xml=result${PYTHON_VERSION}.xml \ @@ -105,11 +108,5 @@ then ./build-cwl-docker.sh fi -if [ "$GIT_BRANCH" = "origin/master" ] && [ -e badges ] -then - # TODO: push badgedir to the badge repository - true -fi - #docker rm -v $(docker ps -a -f status=exited | sed 's/ */ /g' | cut -d' ' -f1) exit ${CODE} From 7074595e8e20b36e28532be02972af767217e9f4 Mon Sep 17 00:00:00 2001 From: "Michael R. Crusoe" <1330696+mr-c@users.noreply.github.com> Date: Wed, 27 Mar 2019 15:22:43 +0100 Subject: [PATCH 3/5] record the version --- jenkins.bash | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jenkins.bash b/jenkins.bash index 16e7cf3fa..eb693a7f9 100755 --- a/jenkins.bash +++ b/jenkins.bash @@ -83,8 +83,8 @@ EOF fi if [[ "$version" = "v1.0" ]] && [[ "$CONTAINER" = "docker" ]] && [ $PYTHON_VERSION -eq 3 ] then - tool_ver=master - badgedir=conformance/cwltool/cwl_${version}/cwltool_${tool_ver} + tool_ver=$(cwltool --version | awk '{ print $2 }') + badgedir=${PWD}/conformance/cwltool/cwl_${version}/cwltool_${tool_ver} mkdir -p "$badgedir" BADGE=" --badgedir=${badgedir}" fi From b8f660cfe4acdce961f9b279d2cf2acabb4a136d Mon Sep 17 00:00:00 2001 From: "Michael R. Crusoe" <1330696+mr-c@users.noreply.github.com> Date: Wed, 27 Mar 2019 15:48:43 +0100 Subject: [PATCH 4/5] let cwltool make the badgedir itself --- jenkins.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jenkins.bash b/jenkins.bash index eb693a7f9..ec486142d 100755 --- a/jenkins.bash +++ b/jenkins.bash @@ -85,7 +85,7 @@ EOF then tool_ver=$(cwltool --version | awk '{ print $2 }') badgedir=${PWD}/conformance/cwltool/cwl_${version}/cwltool_${tool_ver} - mkdir -p "$badgedir" + mkdir -p ${PWD}/conformance/cwltool/cwl_${version}/ BADGE=" --badgedir=${badgedir}" fi # shellcheck disable=SC2086 From e5fe9d9e4b850ecc368fb71fd49305d5779afd1b Mon Sep 17 00:00:00 2001 From: Tomoya Tanjo Date: Thu, 28 Mar 2019 11:48:26 +0900 Subject: [PATCH 5/5] Minimize diff --- jenkins.bash | 1 - 1 file changed, 1 deletion(-) diff --git a/jenkins.bash b/jenkins.bash index ec486142d..e01e978b1 100755 --- a/jenkins.bash +++ b/jenkins.bash @@ -107,6 +107,5 @@ if [ "$GIT_BRANCH" = "origin/master" ] && [[ "$version" = "v1.0" ]] then ./build-cwl-docker.sh fi - #docker rm -v $(docker ps -a -f status=exited | sed 's/ */ /g' | cut -d' ' -f1) exit ${CODE}