2016-10-25 14:09:53 +13:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
2017-01-12 20:19:41 +13:00
|
|
|
# process production html
|
2017-09-20 08:40:59 +12:00
|
|
|
BUILD=$(date +%s)
|
2017-09-20 10:47:20 +12:00
|
|
|
VERSION=$(cat VERSION.md)
|
2017-09-20 08:40:59 +12:00
|
|
|
|
2017-09-20 09:46:05 +12:00
|
|
|
echo -e "Building $VERSION ($BUILD)"
|
|
|
|
|
|
|
|
|
|
# copy assets
|
|
|
|
|
echo -e Copying assets $SERVER
|
|
|
|
|
rsync -avr src/assets/ mopidy_iris/static/assets/ 2>&1 >/dev/null
|
|
|
|
|
|
|
|
|
|
# create HTML files
|
|
|
|
|
echo -e Copying index.html
|
|
|
|
|
cp src/index.html mopidy_iris/static/index.html
|
|
|
|
|
|
|
|
|
|
echo -e "Setting version in static HTML"
|
2017-09-20 08:40:59 +12:00
|
|
|
sed -i 's/VERSION_HERE/'$VERSION'/g' mopidy_iris/static/index.html
|
|
|
|
|
sed -i 's/BUILD_HERE/'$BUILD'/g' mopidy_iris/static/index.html
|
|
|
|
|
|
2017-09-20 09:46:05 +12:00
|
|
|
echo -e "Setting version in Python"
|
2017-09-21 09:23:07 +12:00
|
|
|
sed -i "/__version__ = '/c\__version__ = '"$VERSION"'" mopidy_iris/__init__.py
|
2017-09-20 09:46:05 +12:00
|
|
|
|
|
|
|
|
echo -e "Setting version in NPM"
|
2017-09-20 08:40:59 +12:00
|
|
|
sed -i '/ "version": "/c\ "version": "'$VERSION'",' package.json
|
2017-01-13 08:23:07 +13:00
|
|
|
|
|
|
|
|
echo -e "\x1b[32;01m"Done!"\x1b[39;49;00m"
|