aboutsummaryrefslogtreecommitdiff
path: root/files
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2020-07-21 17:15:39 -0300
committerSilvio Rhatto <rhatto@riseup.net>2020-07-21 17:15:39 -0300
commit54adff4e3ba0e31a70f50da76af0f65857fafbf7 (patch)
tree5cfa24d50a6f78bf946406008d28f1ba062d4a8a /files
parent38b5ec3e760701866b7baa498a1df0c43b36e684 (diff)
downloadpuppet-drupal-54adff4e3ba0e31a70f50da76af0f65857fafbf7.tar.gz
puppet-drupal-54adff4e3ba0e31a70f50da76af0f65857fafbf7.tar.bz2
Feat: drupal 9 support
Diffstat (limited to 'files')
-rwxr-xr-xfiles/drupal18
1 files changed, 13 insertions, 5 deletions
diff --git a/files/drupal b/files/drupal
index e43fd49..bc4b12f 100755
--- a/files/drupal
+++ b/files/drupal
@@ -5,7 +5,8 @@
BASE=${BASE:="/var/www/data"}
SITES=${SITES:="$BASE/drupal"}
-SERIES="6 7 8"
+SERIES="6 7 8 9"
+LATEST_SERIES="9"
# Ensure we have a proper path, useful when called through cron
export PATH='/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
@@ -152,7 +153,7 @@ function drupal_current {
local series="$1"
if [ -z "$series" ]; then
- series="8"
+ series="$LATEST_SERIES"
fi
if [ -e "$BASE/drupal-${series}" ]; then
@@ -169,7 +170,7 @@ function drupal_latest {
local series="$1"
if [ -z "$series" ]; then
- series="8"
+ series="$LATEST_SERIES"
fi
latest="`wget -O- -q https://updates.drupal.org/release-history/drupal/${series}.x | grep -oPm1 "(?<=<download_link>)[^<]+" | grep -v -- '-dev' | grep -v -- '-alpha' | grep -v -- '-beta' | grep -v -- '-rc' | head -1`"
@@ -188,7 +189,10 @@ function drupal_download {
fi
# Check for latest releases if no specific version was given
- if [ "$new" == "8" ]; then
+ if [ "$new" == "9" ]; then
+ drupal_series="9"
+ new="`drupal_latest 9`"
+ elif [ "$new" == "8" ]; then
drupal_series="8"
new="`drupal_latest 8`"
elif [ "$new" == "7" ]; then
@@ -237,7 +241,11 @@ function drupal_upgrade {
new="$2"
# Fix versions if just a series is given
- if [ "$old" == "8" ] && [ -z "$new" ]; then
+ if [ "$old" == "9" ] && [ -z "$new" ]; then
+ old="`drupal_current 9`"
+ new="`drupal_latest 9`"
+ drupal_series="9"
+ elif [ "$old" == "8" ] && [ -z "$new" ]; then
old="`drupal_current 8`"
new="`drupal_latest 8`"
drupal_series="8"