Skip to content

Commit

Permalink
Merge pull request #106 from hangpark/develop
Browse files Browse the repository at this point in the history
Release v2.0.2
  • Loading branch information
hangpark authored Apr 28, 2017
2 parents 633f2c9 + 82d6032 commit c188da4
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 1 deletion.
43 changes: 43 additions & 0 deletions .showbadge-travis.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#! /bin/sh
# ShowBadge script for Travis-CI
# Version: ShowBadge v0.1.0
# Author: Hang Park <[email protected]>

# 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 ""

# 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/

exit 0
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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) [![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.

Expand Down

0 comments on commit c188da4

Please sign in to comment.