Skip to content

Instantly share code, notes, and snippets.

@dhensby
Created July 24, 2018 22:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dhensby/87997ac48cd037044bd972f057e18d5b to your computer and use it in GitHub Desktop.
Save dhensby/87997ac48cd037044bd972f057e18d5b to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
echo `pwd`
LEGACY_CORE=('cms' 'reports' 'siteconfig' 'framework' 'installer')
LEGACY_TAG="4.2.0-beta1"
LEGACY_BRANCH="4.2.0"
RECIPES=('recipe-cms' 'recipe-core')
NEW_CORE=('assets' 'admin' 'asset-admin' 'campaign-admin' 'errorpage' 'versioned')
NEW_TAG="1.2.0-beta1"
NEW_BRANCH="1.2.0"
GRAPHQL=('graphql')
GRAPHQL_TAG="2.0.0-beta1"
GRAPHQL_BRANCH="2.0.0"
CONFIG=('config')
CONFIG_TAG="1.0.5-beta1"
CONFIG_BRANCH="1.0.5"
for i in "${LEGACY_CORE[@]}"; do
echo "Checkout $i:$LEGACY_TAG and branch $LEGACY_BRANCH"
if [ ! -d "$i" ]; then
git clone "https://github.com/silverstripe/silverstripe-$i" "$i"
fi
cd "$i"
# git rev-parse --verify "$LEGACY_BRANCH"
# if [ $? -ne 0 ]; then
# echo "Nothing to do here"
# else
git checkout master
git branch -D "$LEGACY_BRANCH"
git push origin ":refs/heads/$LEGACY_BRANCH"
# fi
cd ..
done
for i in "${RECIPES[@]}"; do
echo "Checkout $i:$LEGACY_TAG and branch $LEGACY_BRANCH"
if [ ! -d "$i" ]; then
git clone "https://github.com/silverstripe/silverstripe-$i" "$i"
fi
cd "$i"
# git rev-parse --verify "$LEGACY_BRANCH"
# if [ $? -ne 0 ]; then
# echo "Nothing to do here"
# else
git checkout master
git branch -D "$LEGACY_BRANCH"
git push origin ":refs/heads/$LEGACY_BRANCH"
# fi
cd ..
done
for i in "${NEW_CORE[@]}"; do
echo "Checkout $i:$NEW_TAG and branch $NEW_BRANCH"
if [ ! -d "$i" ]; then
git clone "https://github.com/silverstripe/silverstripe-$i" "$i"
fi
cd "$i"
# git rev-parse --verify "$NEW_BRANCH"
# if [ $? -ne 0 ]; then
# echo "Nothing to do here"
# else
git checkout master
git branch -D "$NEW_BRANCH"
git push origin ":refs/heads/$NEW_BRANCH"
# fi
cd ..
done
for i in "${GRAPHQL[@]}"; do
echo "Checkout $i:$GRAPHQL_TAG and branch $GRAPHQL_BRANCH"
if [ ! -d "$i" ]; then
git clone "https://github.com/silverstripe/silverstripe-$i" "$i"
fi
cd "$i"
# git rev-parse --verify "$GRAPHQL_BRANCH"
# if [ $? -ne 0 ]; then
# echo "Nothing to do here"
# else
git checkout master
git branch -D "$GRAPHQL_BRANCH"
git push origin ":refs/heads/$GRAPHQL_BRANCH"
# fi
cd ..
done
for i in "${CONFIG[@]}"; do
echo "Checkout $i:$CONFIG_TAG and branch $CONFIG_BRANCH"
if [ ! -d "$i" ]; then
git clone "https://github.com/silverstripe/silverstripe-$i" "$i"
fi
cd "$i"
# git rev-parse --verify "$CONFIG_BRANCH"
# if [ $? -ne 0 ]; then
# echo "Nothing to do here"
# else
git checkout master
git branch -D "$CONFIG_BRANCH"
git push origin ":refs/heads/$CONFIG_BRANCH"
# fi
cd ..
done
read -p "Continue"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment