Compare commits

...

6 Commits

View File

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