-
Notifications
You must be signed in to change notification settings - Fork 1
/
release.sh
executable file
·30 lines (23 loc) · 1005 Bytes
/
release.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash -e
echo "Releasing docker-worker on Github"
if [ "$DOCKER_WORKER_GITHUB_TOKEN" == "" ]; then
echo "You need to define the environment variable DOCKER_WORKER_GITHUB_TOKEN" >&2
echo "with a valid Github personal token." >&2
echo "If you intended to only deploy AMIs, then run the deploy.sh script." >&2
exit 1
fi
remote=$(git remote -v | grep 'taskcluster/docker-worker-deploy' | head -1 | awk '{print $1}')
if [ "$remote" == "" ]; then
git remote add tcdw [email protected]/taskcluster/docker-worker-deploy
remote=tcdw
fi
git fetch $remote
branch=$(git rev-parse --abbrev-ref HEAD)
current_branch_head_sha=$(git rev-parse $branch)
remote_branch_head_sha=$(git rev-parse $remote/$branch)
if [ "$current_branch_head_sha" != "$remote_branch_head_sha" ]; then
echo "$branch and $remote/$branch mismatch!" >&2
exit 1
fi
release_name=$(deploy/bin/github-release.js)
echo "$release_name has been released at https://github.com/taskcluster/docker-worker/releases/tag/$release_name"