#!/bin/sh setup_git() { git config --global user.email "dl9rdz@darc.de" git config --global user.name "dl9rdz (via Travis CI)" } generate_website_index() { echo "" > download.html echo "" >> download.html echo "rdz_ttgo_sonde" >> download.html echo '' >> download.html echo "" >> download.html echo '

rdz_ttgo_sonde

' >> download.html echo '

View the Project on GitHub dl9rdz/rdz_ttgo_sonde

' >> download.html echo '

rdz_ttgo_sonde

' >> download.html echo "

Master repository

Development repository


Last latter/number of version number indicate SPIFFS file system version. If the first (upper-case) letter has changed, then this version is incompabible with prevision versions and you have to flash the full image. If the second part (number) has changed, then this version has some changes (e.g. internal web page layout, LCD/TFT display layout) in the file system which you will not get with a code-only (OTA or flashing update.bin) update, but it should not break anything.

" >> download.html git add download.html git commit --amend --message "Travis build: $TRAVIS_BUILD_NUMBER" } commit_website_files() { BRANCH=$TRAVIS_BRANCH VERSION=`cat RX_FSK/version.h | grep version_id | egrep -o '".*"' | sed 's/"//g' | sed 's/ /_/g'` FSMAJOR=`cat RX_FSK/version.h | grep SPIFFS_MAJOR | perl -e '$_=<>;print /=(.*);/?chr($1+64):""'` FSMINOR=`cat RX_FSK/version.h | grep SPIFFS_MINOR | perl -e '$_=<>;print /=(.*);/?$1:""'` VERSION=$VERSION-$FSMAJOR$FSMINOR MYPATH=$PWD echo "On branch $BRANCH" echo "Version $VERSION" cd /tmp git clone https://github.com/dl9rdz/rdz_ttgo_sonde.git -b gh-pages cd rdz_ttgo_sonde mkdir -p master mkdir -p devel cp ${MYPATH}/out.bin ${BRANCH}/${VERSION}-full.bin git add ${BRANCH}/${VERSION}-full.bin cp ${MYPATH}/build/RX_FSK.ino.bin ${BRANCH}/update.ino.bin git add ${BRANCH}/update.ino.bin echo "${TRAVIS_COMMIT_MESSAGE}" >> ${BRANCH}/${VERSION}-changelog.txt git add ${BRANCH}/${VERSION}-changelog.txt echo "

${VERSION}

" > ${BRANCH}/update-info.html git add ${BRANCH}/update-info.html ${MYPATH}/scripts/makefsupdate.py ${MYPATH}/RX_FSK/data/ > ${BRANCH}/update.fs.bin git add ${BRANCH}/update.fs.bin git commit --message "Travis build: $TRAVIS_BUILD_NUMBER" } upload_files() { git remote add origin-pages https://${GITHUB_API_KEY}@github.com/dl9rdz/rdz_ttgo_sonde.git > /dev/null 2>&1 git push --quiet --set-upstream origin-pages gh-pages } setup_git commit_website_files generate_website_index upload_files