Skip to content

Instantly share code, notes, and snippets.

@esolitos
Last active August 17, 2017 07:31
Show Gist options
  • Save esolitos/0c52ae6b1f1eef1da4afa193bf9efc41 to your computer and use it in GitHub Desktop.
Save esolitos/0c52ae6b1f1eef1da4afa193bf9efc41 to your computer and use it in GitHub Desktop.
#!/bin/sh
branchname="hotfix/SA-CONTRIB-2017-068"
cd $1;
for repos in $(ls); do
echo;
echo "########## Starting with with $repos";
if [ $(grep -c 'core = 7.x' $repos/web/modules/update/update.info) -eq 1 ]; then
cd $repos;
if [ $(git status | grep -c 'nothing to commit') -ne 1 ]; then
echo "Uncommited changes in $repos";
else
git checkout master;
git checkout -b $branchname;
cd web;
drush upc -yq views entity_reference
if [ $? -ne 0 ]; then
echo "Error updating views and entity_reference in $repos" ;
else
git add . ;
git commit -m "Security Update: SA-CONTRIB-2017-067 and SA-CONTRIB-2017-068";
git push --set-upstream origin "$branchname";
echo ;
echo "Pushed in $branchname, test on dev site and deploy on live afterwards.";
fi;
fi;
else
echo "Not a Drupal 7 site. Skipping.";
fi;
echo "########## Finished with $repos";
echo;
cd "$1";
done;
#!/bin/sh
branchname="hotfix/SA-CORE-2017-004"
cd $1;
for repos in $(ls); do
echo;
echo "########## Starting with with $repos";
if [ -f "$repos/composer.lock" ]; then
cd $repos;
if [ $(git status | grep -c 'nothing to commit') -ne 1 ]; then
echo "Uncommited changes in $repos";
else
git checkout master;
git checkout -b $branchname;
composer update -n -q drupal/core;
if [ $? -ne 0 ]; then
echo "Error updating drupal core in $repos";
else
git add composer.lock;
git commit -m "Security Update: SA-CORE-2017-004";
git push --set-upstream origin "$branchname";
echo "Pushed in $branchname, test on dev site and deploy on live afterwards.";
fi;
fi;
else
echo "Not a Drupal 8 site. Skipping;
fi;
echo "########## Finished with $repos";
echo;
cd "$1";
done;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment