-
Notifications
You must be signed in to change notification settings - Fork 1
/
checkupdates
executable file
·37 lines (37 loc) · 1.37 KB
/
checkupdates
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
# Requires https://github.com/pantheon-systems/terminus-composer-plugin
SITES=$(terminus site:list --format=list)
for SITE in $SITES; do
LIVESITE=$SITE.live
INITIALIZED=$(terminus env:info $LIVESITE --field=initialized 2> /dev/null)
if [ $INITIALIZED ]; then
DOMAIN=$(terminus env:info $LIVESITE --field=domain)
FRAMEWORK=$(terminus site:info $SITE --field=framework)
echo --------------------------------------------------------------------------------
echo https://$DOMAIN: $FRAMEWORK
echo --------------------------------------------------------------------------------
case $FRAMEWORK in
drupal)
terminus drush $LIVESITE pm-refresh
terminus drush $LIVESITE ups 2>&1 | grep -v ^Checking | grep -v ^\(
;;
drupal8)
DRUSH=$(terminus drush $LIVESITE version | cut -d':' -f2 | cut -d'.' -f1 | xargs)
if [ $DRUSH == 9 ]; then
terminus drush $LIVESITE pm:refresh
terminus drush $LIVESITE pm:security
terminus composer $LIVESITE outdated ^drupal/*
else
terminus drush $LIVESITE pm-refresh
terminus drush $LIVESITE ups 2>&1 | grep -v ^Checking | grep -v ^\(
fi
;;
wordpress)
terminus wp $LIVESITE core -- check-update
terminus wp $LIVESITE plugin -- update --all --dry-run
;;
esac
echo
echo
fi
done