From de49d2ed6d66f59b592a3d07be74bcd53c110301 Mon Sep 17 00:00:00 2001 From: Hang Park Date: Sat, 15 Apr 2017 02:36:01 +0900 Subject: [PATCH 1/3] [#97] Make the repository public --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 05df026..6479a23 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Pintos Project of CS330 in KAIST -[![Build Status](https://travis-ci.com/hangpark/pintos.svg?token=gQa4om5Q1o59ZGsZT1Tf&branch=develop)](https://travis-ci.com/hangpark/pintos) +[![Build Status](https://travis-ci.org/hangpark/pintos.svg?branch=develop)](https://travis-ci.org/hangpark/pintos) Repository for Pintos implementation project of CS330 in KAIST. From 741563dc9dc30e9846f0c85a51b96f97ab34c392 Mon Sep 17 00:00:00 2001 From: Hang Park Date: Fri, 28 Apr 2017 19:12:11 +0900 Subject: [PATCH 2/3] [#99] Add ShowBadge --- .showbadge-travis.sh | 38 ++++++++++++++++++++++++++++++++++++++ .travis.yml | 1 + README.md | 2 +- 3 files changed, 40 insertions(+), 1 deletion(-) create mode 100755 .showbadge-travis.sh diff --git a/.showbadge-travis.sh b/.showbadge-travis.sh new file mode 100755 index 0000000..771d99e --- /dev/null +++ b/.showbadge-travis.sh @@ -0,0 +1,38 @@ +#! /bin/sh +# ShowBadge script for Travis-CI +# Version: ShowBadge v0.1.0 +# Author: Hang Park + +# If the build is of a pull request +if [ $TRAVIS_PULL_REQUEST != "false" ]; then + echo "[ShowBadge] Pull request builds are not supported." + exit 1 +fi + +# If server is not specified +if [ -z $SHOWBADGE_SERVER ]; then + echo "[ShowBadge] Server is not specified." + exit 1 +fi + +# If key-value pair is not given +if [ -z "$1" ] || [ -z "$2" ]; then + echo "[ShowBadge] Key-value pair is not given." + exit 1 +fi + +# Print data to send +echo "[ShowBadge] Push following data into the server:" +echo "" +echo " Server $SHOWBADGE_SERVER" +echo " User/Repo $TRAVIS_REPO_SLUG" +echo " Commit $TRAVIS_COMMIT" +echo " Key $1" +echo " Value $2" +echo "" + +# Send data +curl -X POST -d "commit=$TRAVIS_COMMIT&key=$1&value=$2" \ + ${SHOWBADGE_SERVER%%/}/$TRAVIS_REPO_SLUG/ + +exit 0 diff --git a/.travis.yml b/.travis.yml index b95ba76..bd69ded 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,4 +17,5 @@ script: - docker run -v $TRAVIS_BUILD_DIR:/pintos hangpark/pintos-dev-env-kaist /bin/bash -c "cd /pintos/src/$TARGET_DIRECTORY && make grade" > /dev/null after_success: + - ./.showbadge-travis.sh grade `sed -n 's/^Total\ *\([0-9.]\+\)%\/\([0-9.]\+\)%$/\1\/\2/p' src/$TARGET_DIRECTORY/build/grade` - cat src/$TARGET_DIRECTORY/build/grade diff --git a/README.md b/README.md index 6479a23..07e615f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Pintos Project of CS330 in KAIST -[![Build Status](https://travis-ci.org/hangpark/pintos.svg?branch=develop)](https://travis-ci.org/hangpark/pintos) +[![Build Status](https://travis-ci.org/hangpark/pintos.svg?branch=develop)](https://travis-ci.org/hangpark/pintos) [![Test Coverage](http://showbadge.hangpark.com/hangpark/pintos/?branch=develop&key=grade)](https://github.com/hangpark/pintos) Repository for Pintos implementation project of CS330 in KAIST. From 4ecb1c6ef22f6ab71b29fb0fb0dab249f5e560fb Mon Sep 17 00:00:00 2001 From: Hang Park Date: Fri, 28 Apr 2017 22:28:37 +0900 Subject: [PATCH 3/3] [#104] Update ShowBadge to v0.2.1 --- .showbadge-travis.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.showbadge-travis.sh b/.showbadge-travis.sh index 771d99e..3a157a1 100755 --- a/.showbadge-travis.sh +++ b/.showbadge-travis.sh @@ -31,6 +31,11 @@ echo " Key $1" echo " Value $2" echo "" +# Purge caching +if [ -n "$SHOWBADGE_CAMO" ]; then + curl -X PURGE $SHOWBADGE_CAMO +fi + # Send data curl -X POST -d "commit=$TRAVIS_COMMIT&key=$1&value=$2" \ ${SHOWBADGE_SERVER%%/}/$TRAVIS_REPO_SLUG/