Last active
October 4, 2019 06:34
-
-
Save em230418/fdb6fe176d5e3f9d69946aaf2522bcce to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# ORGANIZATION GITHUB URL | |
ORG=it-projects-llc | |
UPSTREAM_URL_GIT=https://github.com/$ORG | |
# DEVELOPER INFO | |
USERNAME=em230418 | |
# WHERE TO CLONE | |
DIRECTORY_CLONE=./ | |
# DESCRIPTION OF THE UPDATES | |
MSG=":shield: travis.yml bump odoo version" | |
BRANCH_SUFFIX=travis-notifications | |
REPOS=( | |
#misc-addons | |
#saas-addons | |
#pos-addons | |
#access-addons | |
#mail-addons | |
#website-addons | |
) | |
BRANCHES=( | |
13.0 | |
) | |
for REPO in "${REPOS[@]}"; do | |
if [ ! -d $DIRECTORY_CLONE/$REPO ] | |
then | |
git clone $UPSTREAM_URL_GIT/$REPO.git $DIRECTORY_CLONE/$REPO -o upstream | |
cd $DIRECTORY_CLONE/$REPO | |
git remote add origin [email protected]:$USERNAME/$REPO.git | |
fi | |
cd $DIRECTORY_CLONE/$REPO | |
for BRANCH in "${BRANCHES[@]}"; do | |
git checkout -b $BRANCH-$BRANCH_SUFFIX upstream/$BRANCH | |
# CHECK THAT UPDATES ARE NOT DONE YET | |
if grep -q 'VERSION="13.0"' .travis.yml | |
then | |
echo "File are already updated in $REPO#$BRANCH" | |
continue | |
fi | |
# MAKE UPDATE | |
sed -i .travis.yml -e 's/VERSION="12.0"/VERSION="13.0"/' | |
git commit -a -m "$MSG" | |
git push origin $BRANCH-$BRANCH_SUFFIX | |
hub pull-request -b it-projects-llc:$BRANCH -m "$MSG" | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment