From 8fe631f9a6c1a52b0e3ffbda436a42ff53bd3de5 Mon Sep 17 00:00:00 2001 From: Cristian Maglie <c.maglie@arduino.cc> Date: Tue, 23 Jun 2015 18:40:06 +0200 Subject: [PATCH] Added pull request builder scripts --- extras/pack.pullrequest.bash | 31 +++++++++++++++ pack.bash => extras/pack.release.bash | 2 +- extras/package_index.json.PR.template | 54 +++++++++++++++++++++++++++ 3 files changed, 86 insertions(+), 1 deletion(-) create mode 100755 extras/pack.pullrequest.bash rename pack.bash => extras/pack.release.bash (59%) create mode 100644 extras/package_index.json.PR.template diff --git a/extras/pack.pullrequest.bash b/extras/pack.pullrequest.bash new file mode 100755 index 00000000..816490b6 --- /dev/null +++ b/extras/pack.pullrequest.bash @@ -0,0 +1,31 @@ +#!/bin/bash -ex + +PR_NUMBER=$1 +VERSION=PR-$PR_NUMBER + +PWD=`pwd` +FOLDERNAME=`basename $PWD` +THIS_SCRIPT_NAME=`basename $0` +FILENAME=package_samd-PR-$PR_NUMBER.tar.bz2 + +rm -f $FILENAME + +# Change name in platform.txt +sed -i "s/name=.*/name=SAMD Pull request Build ${PR_NUMBER}/" platform.txt + +cd .. +tar --transform "s|$FOLDERNAME|samd-PR-$PR_NUMBER|g" --exclude=extras/** --exclude=.git* --exclude=.idea -cjf $FILENAME $FOLDERNAME +cd - + +mv ../$FILENAME . + +CHKSUM=`sha256sum $FILENAME | awk '{ print $1 }'` +SIZE=`wc -c $FILENAME | awk '{ print $1 }'` + +cat extras/package_index.json.PR.template | +sed s/%%PR_NUMBER%%/${PR_NUMBER}/ | +sed s/%%VERSION%%/${VERSION}/ | +sed s/%%FILENAME%%/${FILENAME}/ | +sed s/%%CHECKSUM%%/${CHKSUM}/ | +sed s/%%SIZE%%/${SIZE}/ > package_samd-PR-${PR_NUMBER}_index.json + diff --git a/pack.bash b/extras/pack.release.bash similarity index 59% rename from pack.bash rename to extras/pack.release.bash index 6ff0fc92..6ccb1310 100755 --- a/pack.bash +++ b/extras/pack.release.bash @@ -9,7 +9,7 @@ THIS_SCRIPT_NAME=`basename $0` rm -f samd-$VERSION.tar.bz2 cd .. -tar --transform "s|$FOLDERNAME|$VERSION|g" --exclude=.git --exclude=.idea --exclude=$THIS_SCRIPT_NAME -cjf samd-$VERSION.tar.bz2 $FOLDERNAME +tar --transform "s|$FOLDERNAME|$FOLDERNAME-$VERSION|g" --exclude=extras/** --exclude=.git* --exclude=.idea -cjf samd-$VERSION.tar.bz2 $FOLDERNAME cd - mv ../samd-$VERSION.tar.bz2 . diff --git a/extras/package_index.json.PR.template b/extras/package_index.json.PR.template new file mode 100644 index 00000000..bb48518d --- /dev/null +++ b/extras/package_index.json.PR.template @@ -0,0 +1,54 @@ +{ + "packages": [ + { + "name": "arduino-beta", + "maintainer": "Arduino Betatesting", + "websiteURL": "http://www.arduino.cc/", + "email": "packages@arduino.cc", + "help": { + "online": "http://www.arduino.cc/en/Reference/HomePage" + }, + "platforms": [ + { + "name": "Arduino SAMD core - Pull request build num. %%PR_NUMBER%%", + "architecture": "samd", + "version": "%%VERSION%%", + "category": "Arduino", + "url": "http://downloads.arduino.cc/PR/samd/%%FILENAME%%", + "archiveFileName": "%%FILENAME%%", + "checksum": "SHA-256:%%CHECKSUM%%", + "size": "%%SIZE%%", + "boards": [ + { + "name": "Arduino Zero" + } + ], + "toolsDependencies": [ + { + "packager": "arduino", + "name": "arm-none-eabi-gcc", + "version": "4.8.3-2014q1" + }, + { + "packager": "arduino", + "name": "bossac", + "version": "1.5-arduino" + }, + { + "packager": "arduino", + "name": "openocd", + "version": "0.9.0-arduino" + }, + { + "packager": "arduino", + "name": "CMSIS", + "version": "4.0.0-atmel" + } + ] + } + ], + "tools": [ + ] + } + ] +} -- GitLab