Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

Confirmation before push with info of branch and repo user is on #45

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,21 @@ log "Pushing initial cluster configuration"
git add config.yaml footloose.yaml machines.yaml flux.yaml wks-controller.yaml

git diff-index --quiet HEAD || git commit -m "Initial cluster configuration"
git push "${git_remote}" HEAD

ORIGN=$(git config --get remote.origin.url)
BRANCH=$(git rev-parse --abbrev-ref HEAD)
echo 'Working on Repository: '$ORIGN
echo 'On Branch: '$BRANCH

read -p "Are you sure you want to push to \"$BRANCH\" ? (y/N): " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]];
then
git push "${git_remote}" HEAD
else
echo "Push aborted."
exit
fi

log "Installing Kubernetes cluster"
wksctl apply --git-url="$(git_http_url "$(git_remote_fetchurl "${git_remote}")")" --git-branch="$(git_current_branch)" ${git_deploy_key}
Expand Down