Skip to content
This repository was archived by the owner on Aug 5, 2022. It is now read-only.

Adding deploy.sh, package_index.template and updated main.go from http… #69

Open
wants to merge 1 commit into
base: linux64
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified arduino101load/arduino101load
Binary file not shown.
43 changes: 43 additions & 0 deletions arduino101load/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/bin/bash -xe

VERSION=`cat main.go| grep "const Version" |cut -f4 -d " " | tr -d '"'`

#Remember to set GOROOT accordingly with your installation

export GOPATH=$PWD

declare -a target_folders=("linux_amd64" "linux_386" "linux_arm" "darwin_amd64" "windows_386")

rm -rf distrib
mkdir distrib

package_index=`cat package_index.template | sed s/%%VERSION%%/${VERSION}/`

for folder in "${target_folders[@]}"
do
rm -rf arduino101load*
rm -rf bin
mkdir bin
IFS=_ read -a fields <<< $folder
GOOS=${fields[0]} GOARCH=${fields[1]} go build
FILENAME=arduino101load-${VERSION}-${folder}.tar.bz2
cp -r arduino101load* firmwares/ bin
tar cjvf ${FILENAME} bin/
T_OS=`echo ${folder} | awk '{print toupper($0)}'`
SHASUM=`sha256sum ${FILENAME} | cut -f1 -d" "`
SIZE=`stat --printf="%s" ${FILENAME}`
package_index=`echo $package_index |
sed s/%%FILENAME_${T_OS}%%/${FILENAME}/ |
sed s/%%FILENAME_${T_OS}%%/${FILENAME}/ |
sed s/%%SIZE_${T_OS}%%/${SIZE}/ |
sed s/%%SHA_${T_OS}%%/${SHASUM}/`

mv ${FILENAME} distrib/
done

set +x

echo ================== CUT ME HERE =====================

echo ${package_index} | python -m json.tool

Binary file added arduino101load/firmwares/1.0.8/ble_core.bin
Binary file not shown.
Binary file added arduino101load/firmwares/1.0.8/quark.bin
Binary file not shown.
Binary file added arduino101load/firmwares/2.0.0/ble_core.bin
Binary file not shown.
Binary file added arduino101load/firmwares/2.0.0/quark.bin
Binary file not shown.
Loading