Add extras folder for packagein and CI

This commit is contained in:
Martino Facchin 2017-11-13 11:53:21 +01:00
parent 3f63f2975e
commit b3b2f44491
5 changed files with 278 additions and 0 deletions

51
extras/pack.hourlybuild.bash Executable file
View File

@ -0,0 +1,51 @@
#!/bin/bash -ex
# pack.*.bash - Bash script to help packaging avr core releases.
# Copyright (c) 2015 Arduino LLC. All right reserved.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
BUILD_NUMBER=$1
CURR_TIME=`date "+%Y-%m-%d %H:%M"`
CURR_TIME_SED=`date "+%Y\\-%m\\-%d %H:%M"`
VERSION=9.9.9-Hourly
PWD=`pwd`
FOLDERNAME=`basename $PWD`
THIS_SCRIPT_NAME=`basename $0`
FILENAME=package_avr-hourly-b${BUILD_NUMBER}.tar.bz2
rm -f $FILENAME
# Change name in platform.txt
sed -i "s/name=.*/name=SAMD Hourly Build ${BUILD_NUMBER} (${CURR_TIME})/" platform.txt
cd ..
tar --transform "s|$FOLDERNAME|avr-hourly_b${BUILD_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.Hourly.template |
sed "s/%%BUILD_NUMBER%%/${BUILD_NUMBER}/" |
sed "s/%%CURR_TIME%%/${CURR_TIME_SED}/" |
sed "s/%%VERSION%%/${VERSION}/" |
sed "s/%%FILENAME%%/${FILENAME}/" |
sed "s/%%CHECKSUM%%/${CHKSUM}/" |
sed "s/%%SIZE%%/${SIZE}/" > package_avr-hourly-build_index.json

50
extras/pack.pullrequest.bash Executable file
View File

@ -0,0 +1,50 @@
#!/bin/bash -ex
# pack.*.bash - Bash script to help packaging avr core releases.
# Copyright (c) 2015 Arduino LLC. All right reserved.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
PR_NUMBER=$1
BUILD_NUMBER=$2
VERSION=`grep version= platform.txt | sed 's/version=//g'`
PWD=`pwd`
FOLDERNAME=`basename $PWD`
THIS_SCRIPT_NAME=`basename $0`
FILENAME=package_avr-b${BUILD_NUMBER}.tar.bz2
rm -f $FILENAME
# Change name in platform.txt
sed -i "s/name=.*/name=SAMD Pull request #${PR_NUMBER} (Build ${BUILD_NUMBER})/" platform.txt
cd ..
tar --transform "s|$FOLDERNAME|avr-PR${PR_NUMBER}_b${BUILD_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/%%BUILD_NUMBER%%/${BUILD_NUMBER}/ |
sed s/%%VERSION%%/${VERSION}-build-${BUILD_NUMBER}/ |
sed s/%%FILENAME%%/${FILENAME}/ |
sed s/%%CHECKSUM%%/${CHKSUM}/ |
sed s/%%SIZE%%/${SIZE}/ > package_avr-b${BUILD_NUMBER}_index.json

33
extras/pack.release.bash Executable file
View File

@ -0,0 +1,33 @@
#!/bin/bash -ex
# pack.*.bash - Bash script to help packaging avr core releases.
# Copyright (c) 2015 Arduino LLC. All right reserved.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
VERSION=`grep version= platform.txt | sed 's/version=//g'`
PWD=`pwd`
FOLDERNAME=`basename $PWD`
THIS_SCRIPT_NAME=`basename $0`
rm -f avr-$VERSION.tar.bz2
cd ..
tar --transform "s|$FOLDERNAME|$FOLDERNAME-$VERSION|g" --exclude=extras/** --exclude=.git* --exclude=.idea -cjf avr-$VERSION.tar.bz2 $FOLDERNAME
cd -
mv ../avr-$VERSION.tar.bz2 .

View File

@ -0,0 +1,72 @@
{
"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 AVR core - Hourly build",
"architecture": "avr",
"version": "%%VERSION%%",
"category": "Arduino",
"url": "http://downloads.arduino.cc/Hourly/avr/%%FILENAME%%",
"archiveFileName": "%%FILENAME%%",
"checksum": "SHA-256:%%CHECKSUM%%",
"size": "%%SIZE%%",
"boards": [
{"name": "Arduino Yún"},
{"name": "Arduino/Genuino Uno"},
{"name": "Arduino Uno WiFi"},
{"name": "Arduino Diecimila"},
{"name": "Arduino Nano"},
{"name": "Arduino/Genuino Mega"},
{"name": "Arduino MegaADK"},
{"name": "Arduino Leonardo"},
{"name": "Arduino Leonardo Ethernet"},
{"name": "Arduino/Genuino Micro"},
{"name": "Arduino Esplora"},
{"name": "Arduino Mini"},
{"name": "Arduino Ethernet"},
{"name": "Arduino Fio"},
{"name": "Arduino BT"},
{"name": "Arduino LilyPadUSB"},
{"name": "Arduino Lilypad"},
{"name": "Arduino Pro"},
{"name": "Arduino ATMegaNG"},
{"name": "Arduino Robot Control"},
{"name": "Arduino Robot Motor"},
{"name": "Arduino Gemma"},
{"name": "Adafruit Circuit Playground"},
{"name": "Arduino Yún Mini"},
{"name": "Arduino Industrial 101"},
{"name": "Linino One"}
],
"toolsDependencies": [
{
"packager": "arduino",
"name": "avr-gcc",
"version": "4.9.2-atmel3.5.4-arduino2"
},
{
"packager": "arduino",
"name": "avrdude",
"version": "6.3.0-arduino9"
},
{
"packager": "arduino",
"name": "arduinoOTA",
"version": "1.1.1"
}
]
}
],
"tools": [
]
}
]
}

View File

@ -0,0 +1,72 @@
{
"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 AVR core - Pull request #%%PR_NUMBER%% (build %%BUILD_NUMBER%%)",
"architecture": "avr",
"version": "%%VERSION%%",
"category": "Arduino",
"url": "http://downloads.arduino.cc/PR/a/%%FILENAME%%",
"archiveFileName": "%%FILENAME%%",
"checksum": "SHA-256:%%CHECKSUM%%",
"size": "%%SIZE%%",
"boards": [
{"name": "Arduino Yún"},
{"name": "Arduino/Genuino Uno"},
{"name": "Arduino Uno WiFi"},
{"name": "Arduino Diecimila"},
{"name": "Arduino Nano"},
{"name": "Arduino/Genuino Mega"},
{"name": "Arduino MegaADK"},
{"name": "Arduino Leonardo"},
{"name": "Arduino Leonardo Ethernet"},
{"name": "Arduino/Genuino Micro"},
{"name": "Arduino Esplora"},
{"name": "Arduino Mini"},
{"name": "Arduino Ethernet"},
{"name": "Arduino Fio"},
{"name": "Arduino BT"},
{"name": "Arduino LilyPadUSB"},
{"name": "Arduino Lilypad"},
{"name": "Arduino Pro"},
{"name": "Arduino ATMegaNG"},
{"name": "Arduino Robot Control"},
{"name": "Arduino Robot Motor"},
{"name": "Arduino Gemma"},
{"name": "Adafruit Circuit Playground"},
{"name": "Arduino Yún Mini"},
{"name": "Arduino Industrial 101"},
{"name": "Linino One"}
],
"toolsDependencies": [
{
"packager": "arduino",
"name": "avr-gcc",
"version": "4.9.2-atmel3.5.4-arduino2"
},
{
"packager": "arduino",
"name": "avrdude",
"version": "6.3.0-arduino9"
},
{
"packager": "arduino",
"name": "arduinoOTA",
"version": "1.1.1"
}
]
}
],
"tools": [
]
}
]
}