2021-07-12 23:14:39 +03:00
|
|
|
#!/bin/bash
|
|
|
|
|
2021-09-30 00:08:53 +03:00
|
|
|
set -eu
|
2022-10-21 23:15:34 +03:00
|
|
|
source script/lib/deploy-helpers.sh
|
2021-07-12 23:14:39 +03:00
|
|
|
|
2024-02-01 21:54:49 +03:00
|
|
|
if [[ $# != 1 ]]; then
|
|
|
|
echo "Usage: $0 <production|staging>"
|
2021-09-30 00:08:53 +03:00
|
|
|
exit 1
|
|
|
|
fi
|
2022-10-22 01:50:14 +03:00
|
|
|
environment=$1
|
2024-02-01 21:54:49 +03:00
|
|
|
tag="$(tag_for_environment $environment)"
|
2022-10-20 01:31:47 +03:00
|
|
|
|
2024-02-01 21:54:49 +03:00
|
|
|
branch=$(git rev-parse --abbrev-ref HEAD)
|
|
|
|
if [ "$branch" != "main" ]; then
|
|
|
|
echo "You must be on main to run this script"
|
|
|
|
exit 1
|
|
|
|
fi
|
2022-10-22 01:50:14 +03:00
|
|
|
|
2024-02-01 21:57:09 +03:00
|
|
|
git pull --ff-only origin main
|
|
|
|
git tag -f $tag
|
|
|
|
git push -f origin $tag
|