2019-04-28 20:16:19 +00:00
#!/bin/sh
setup_git( ) {
git config --global user.email "dl9rdz@darc.de"
git config --global user.name "dl9rdz (via Travis CI)"
}
generate_website_index( ) {
2019-04-29 20:00:09 +00:00
echo "<html><head>" > download.html
echo "<meta charset=\"UTF-8\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">" >> download.html
echo "<title>rdz_ttgo_sonde</title>" >> download.html
2019-05-03 12:11:18 +00:00
echo '<link rel="stylesheet" href="/assets/css/style.css?v=a43710928bb200926b87aed147b540673ccb0378">' >> download.html
2019-04-29 20:00:09 +00:00
echo "</head><body>" >> download.html
echo '<div class="wrapper"><header><h1><a href="https://dl9rdz.github.io/rdz_ttgo_sonde/">rdz_ttgo_sonde</a></h1><p></p>' >> download.html
echo '<p class="view"><a href="https://github.com/dl9rdz/rdz_ttgo_sonde">View the Project on GitHub <small>dl9rdz/rdz_ttgo_sonde</small></a></p>' >> download.html
echo '</header><section><h1 id="rdz_ttgo_sonde">rdz_ttgo_sonde</h1>' >> download.html
echo "<h2>Master repository</h2><ul>" >> download.html
2019-04-28 20:16:19 +00:00
for i in ` ls master` ; do
TS = ` git log master/$i | grep "Date:" | head -1 | awk '{$1="";$2="";$7="";print substr($0,3,length($0)-3)}' `
if [ -z " $TS " ] ; then TS = ` date` ; fi
echo " <li><a href=\"master/ $i \"> $i </a> ( $TS )</li>\n " >> download.html;
done
2019-04-29 20:00:09 +00:00
echo "</ul><h2>Development repository</h2><ul>" >> download.html
2019-04-28 20:16:19 +00:00
for i in ` ls devel` ; do
TS = ` git log devel/$i | grep "Date:" | head -1 | awk '{$1="";$2="";$7="";print substr($0,3,length($0)-3)}' `
2019-05-03 12:11:18 +00:00
if [ -z " $TS " ] ; then TS = ` date` ; fi
2019-04-28 20:16:19 +00:00
echo " <li><a href=\"devel/ $i \"> $i </a> ( $TS )</li>\n " >> download.html;
done
2020-11-11 07:43:10 +00:00
echo " </ul>
<br>
<p>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.</p>
</section></body></html>" >> download.html
2019-04-28 20:16:19 +00:00
git add download.html
2019-06-08 13:51:36 +00:00
git commit --amend --message " Travis build: $TRAVIS_BUILD_NUMBER "
2019-04-28 20:16:19 +00:00
}
commit_website_files( ) {
2019-04-28 22:17:05 +00:00
BRANCH = $TRAVIS_BRANCH
2020-11-11 07:43:10 +00:00
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
2019-04-28 22:17:05 +00:00
MYPATH = $PWD
2019-04-28 20:16:19 +00:00
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
2019-04-28 22:24:15 +00:00
mkdir -p master
mkdir -p devel
2019-04-28 22:17:05 +00:00
cp ${ MYPATH } /out.bin ${ BRANCH } /${ VERSION } -full.bin
2019-04-28 20:16:19 +00:00
git add ${ BRANCH } /${ VERSION } -full.bin
2019-05-03 12:11:18 +00:00
cp ${ MYPATH } /build/RX_FSK.ino.bin ${ BRANCH } /update.ino.bin
git add ${ BRANCH } /update.ino.bin
2019-06-08 13:51:36 +00:00
git commit --message " Travis build: $TRAVIS_BUILD_NUMBER "
2019-04-28 20:16:19 +00:00
}
upload_files( ) {
2019-04-28 22:17:05 +00:00
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
2019-04-28 20:16:19 +00:00
}
setup_git
commit_website_files
generate_website_index
upload_files