2016-10-25 14:09:53 +13:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
2017-01-12 20:19:41 +13:00
|
|
|
# copy assets
|
2017-01-13 08:23:07 +13:00
|
|
|
echo -e Copying assets $SERVER
|
2017-09-07 16:21:35 +12:00
|
|
|
rsync -avr src/assets/ mopidy_iris/static/assets/ 2>&1 >/dev/null
|
2017-01-12 20:19:41 +13:00
|
|
|
|
|
|
|
|
# create HTML files
|
2017-09-03 21:00:17 +12:00
|
|
|
echo -e Copying index.html
|
2017-01-12 20:19:41 +13:00
|
|
|
cp src/index.html mopidy_iris/static/index.html
|
|
|
|
|
|
|
|
|
|
# process production html
|
2017-09-20 08:40:59 +12:00
|
|
|
BUILD=$(date +%s)
|
|
|
|
|
if [ $# -eq 0 ]; then
|
2017-09-20 09:41:25 +12:00
|
|
|
VERSION="0.0.0"
|
2017-09-20 08:40:59 +12:00
|
|
|
else
|
|
|
|
|
VERSION=$1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
echo -e "Injecting build details to js/css URLs (version=$VERSION, build=$BUILD)"
|
|
|
|
|
sed -i 's/VERSION_HERE/'$VERSION'/g' mopidy_iris/static/index.html
|
|
|
|
|
sed -i 's/BUILD_HERE/'$BUILD'/g' mopidy_iris/static/index.html
|
|
|
|
|
|
|
|
|
|
echo -e "Injecting version to static files"
|
|
|
|
|
sed -i '/__version__ = "/c\__version__ = "'$VERSION'"' mopidy_iris/__init__.py
|
|
|
|
|
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"
|