Compare commits

..

6 Commits

View File

@@ -564,12 +564,15 @@
echo -e "\n*** `basename $project` ***"
cd $project
if [[ -d .git ]]; then
git ls-remote --exit-code origin dev
git ls-remote --exit-code --heads origin dev
dev_exists="$?"
if [[ "$dev_exists" == 0 ]]; then
git switch dev
else
elif [[ "$dev_exists" == 2 ]]; then
git switch main
else
echo "ERROR: Unknown status for dev_exists, '$dev_exists'."
continue
fi
git pull
git push
@@ -893,19 +896,39 @@
function load-branch {
rcvr="$1" # branch which we want to modify
base="$2" # branch with the changes we want
if [[ "$1" == main ]]; then
echo "Are you nuts, fool!? Not main! Do it manually!"
if [[ "$rcvr" == "main" ]]; then
echo "*** ERROR: Are you nuts, fool!? Not main! Do it manually! ***"
exit 1
fi
if [[ -z "$base" ]]; then
if [[ "$rcvr" == "prod" ]]; then
base="stage"
elif [[ "$rcvr" == "stage" ]]; then
base="dev"
else
echo "* Unsure which branch to use for '$rcvr'. Please specify."
exit 1
fi
echo "* Base not specified, using '$base' for '$rcvr'."
fi
echo "* Ensuring we are on base branch '$base'."
git switch "$base"
echo "* Changing pointer for '$rcvr' to '$base'."
git branch -f "$rcvr" "$base"
#echo "* Switching to branch '$rcvr'."
#git switch "$rcvr"
echo "* Forcing push on branch '$rcvr'."
git push --force --set-upstream origin "$rcvr"
git switch "$base"
git branch
#echo "* Switching back to '$base'."
#git switch "$base"
echo "* Done! Displaying list of remote branches."
git ls-remote --heads | sort
}
alias load-prod="load-branch prod dev"
alias load-stage="load-branch stage dev"
alias load-prod="load-branch prod"
alias load-stage="load-branch stage"
alias rollback-prod="load-branch prod main"
alias rollback-stage="load-branch stage main"
alias rollback-dev="load-branch dev main"
- name: General | Account Management | Users | Files | Common Variable
set_fact: