mirror of
https://github.com/mykitserver/docker-limesurvey.git
synced 2026-02-06 20:05:52 +01:00
Add shell upgrade script
This commit is contained in:
29
upgrade.sh
Executable file
29
upgrade.sh
Executable file
@@ -0,0 +1,29 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Upgrade script
|
||||||
|
|
||||||
|
if [ $# -eq 0 ]
|
||||||
|
then
|
||||||
|
echo 'Pass new LimeSurvey Version tag:'
|
||||||
|
echo 'upgrade.sh 3.15.8+190130'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
NEW_VERSION=$1
|
||||||
|
|
||||||
|
grep -qc $NEW_VERSION apache/Dockerfile fpm/Dockerfile fpm-alpine/Dockerfile
|
||||||
|
|
||||||
|
if [ $? -eq 0 ]
|
||||||
|
then
|
||||||
|
echo "Already at version ${NEW_VERSION}"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Download, unzip and chmod LimeSurvey from official GitHub repository
|
||||||
|
wget -P /tmp "https://github.com/LimeSurvey/LimeSurvey/archive/${NEW_VERSION}.tar.gz"
|
||||||
|
SHA256_CHECKSUM=$(sha256 "${NEW_VERSION}.tar.gz")
|
||||||
|
|
||||||
|
# Update lines in the files
|
||||||
|
sed -r -i -e "s/[0-9]+(\.[0-9]+)+\+[0-9]+/$NEW_VERSION/" apache/Dockerfile fpm/Dockerfile fpm-alpine/Dockerfile
|
||||||
|
sed -r -i -e "s/[A-Fa-f0-9]{64}/$SHA256_CHECKSUM/" apache/Dockerfile fpm/Dockerfile fpm-alpine/Dockerfile
|
||||||
|
|
||||||
|
# After that, check and commit
|
||||||
Reference in New Issue
Block a user