diff options
| author | Menny Even Danan <menny@evendanan.net> | 2020-06-10 02:04:21 +0000 |
|---|---|---|
| committer | Menny Even Danan <menny@evendanan.net> | 2020-06-10 02:04:21 +0000 |
| commit | f5b39b9927a28f8e109a903ccb0d97396b3eaf67 (patch) | |
| tree | 60e1d088175510a6015dccc200f41e016a7790bd /.github/actions | |
| parent | fc5314ff4faff45808b864f16714343d093f57f7 (diff) | |
| download | AnySoftKeyboard-f5b39b9927a28f8e109a903ccb0d97396b3eaf67.tar.gz AnySoftKeyboard-f5b39b9927a28f8e109a903ccb0d97396b3eaf67.tar.bz2 | |
Pushing halt-deployment marker on full roll out
Diffstat (limited to '.github/actions')
| -rwxr-xr-x | .github/actions/deploy/deploy.sh | 38 |
1 files changed, 21 insertions, 17 deletions
diff --git a/.github/actions/deploy/deploy.sh b/.github/actions/deploy/deploy.sh index d5763b1de..bafce7138 100755 --- a/.github/actions/deploy/deploy.sh +++ b/.github/actions/deploy/deploy.sh @@ -86,22 +86,26 @@ fi echo "Counter is ${BUILD_COUNT_FOR_VERSION}, crash email: ${ANYSOFTKEYBOARD_CRASH_REPORT_EMAIL}, and tasks: ${DEPLOY_TASKS[*]}" ./gradlew "${DEPLOY_TASKS[@]}" -# -##Making sure no future deployments will happen on this branch. -#if [[ "${FRACTION}" == "1.00" ]] && [[ "${DEPLOY_CHANNEL}" == "production" ]]; then -# echo "A succesfull full deploy to production has finished." -# MARKER_FILE="deployment/halt_deployment_marker" -# if [[ -f "${MARKER_FILE}" ]]; then -# echo "${MARKER_FILE} exits. No need to create another." -# else -# echo "Full deployment to production '${DEPLOYMENT_ENVIRONMENT}' was done succesfully" > "${MARKER_FILE}" -# git config --global user.email "ask@evendanan.net" -# git config --global user.name "Polyglot" -# git add "${MARKER_FILE})" -# git commit -m "Halting deploy to ${DEPLOYMENT_ENVIRONMENT}" -# #cleaning repo -# git clean -f -d && git reset --hard HEAD -# fi -#fi + +#Making sure no future deployments will happen on this branch. +if [[ "${FRACTION}" == "1.00" ]] && [[ "${DEPLOY_CHANNEL}" == "production" ]]; then + echo "A succesfull full deploy to production has finished." + MARKER_FILE="deployment/halt_deployment_marker" + if [[ -f "${MARKER_FILE}" ]]; then + echo "${MARKER_FILE} exits. No need to create another." + else + BRANCH_NAME="$(git name-rev --name-only HEAD)" + echo "Will create ${MARKER_FILE} to halt future releases in the branch '${BRANCH_NAME}'." + echo "Full deployment to production '${DEPLOYMENT_ENVIRONMENT}' was done succesfully" > "${MARKER_FILE}" + git config --global user.email "ask@evendanan.net" + git config --global user.name "Polyglot" + git add "${MARKER_FILE}" + git commit -m "Halting deploy to ${DEPLOYMENT_ENVIRONMENT}" + git push origin "HEAD:${BRANCH_NAME}" || { + echo "Failed to push to origin HEAD:${BRANCH_NAME}" + git remote -v + } + fi +fi [[ -n "${GITHUB_ACTIONS}" ]] && chmod -R a+rwx . |
