castopod/prepare-release.sh
Yassine Doghri 391c349daa refactor(database): add / update fields to optimize storage
- harmonize field types and use explicit names
- store html value alongside markdown descriptions for better performance
- add duration and bandwidth to podcast analytics
- add new analytics table for podcast hits by hour
- replace visible MAXMIND_LICENCE_KEY with variable
2020-10-29 15:45:19 +00:00

24 lines
1001 B
Bash

#!/bin/bash
VERSION=$1
COMPOSER_VERSION=$(echo "$VERSION" | perl -pe 's/(?<=[alpha|beta])\.//g')
# replace composer.json version using jq
echo "$( jq '.version = "'$COMPOSER_VERSION'"' composer.json )" > composer.json
# replace CP_VERSION constant in app/config/constants
sed -i "s/^defined('CP_VERSION').*/defined('CP_VERSION') || define('CP_VERSION', '$VERSION');/" ./app/Config/Constants.php
# download GeoLite2-City archive and extract it to writable/uploads
wget -c "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-City&license_key=$MAXMIND_LICENCE_KEY&suffix=tar.gz" -O - | tar -xz -C ./writable/uploads/
# rename extracted archives' folders
mv ./writable/uploads/GeoLite2-City* ./writable/uploads/GeoLite2-City
# create castopod folder bundle: uses .rsync-filter (-F) file to copy only needed files
rsync -aF --progress . ./castopod
# create zip and tar.gz packages for release upload
zip -r castopod-$VERSION.zip castopod
tar -zcvf castopod-$VERSION.tar.gz castopod