-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathautomate_release.sh
executable file
·77 lines (62 loc) · 2.61 KB
/
automate_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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/usr/bin/env bash
read -r -p "RELEASE_VERSION: " RELEASE_VERSION
read -r -p "RC_NUM: " RC_NUM
read -r -p "COMMIT_REF: " COMMIT_REF
# echo $RELEASE_VERSION $RC_NUM $COMMIT_REF
echo "==================== Tag a chosen commit for the RC ======================="
read -r -p "Do you want to do a dry run [y/n]: " dry_run
read -r -p "Do you already have a cloned repo that includes the commit ref ${COMMIT_REF} [y/n]: " dont_need_clone
# echo $dry_run $dont_need_clone
if [[ "$dry_run" == "y" && "$dont_need_clone" == "y" ]]; then
# echo "dry run and don't need clone"
./release/src/main/scripts/choose_rc_commit.sh \
--release "${RELEASE_VERSION}" \
--rc "${RC_NUM}" \
--commit "${COMMIT_REF}"
elif [[ "$dry_run" = "y" && "$dont_need_clone" = "n" ]]; then
# echo "dry run, need clone"
./release/src/main/scripts/choose_rc_commit.sh \
--release "${RELEASE_VERSION}" \
--rc "${RC_NUM}" \
--commit "${COMMIT_REF}" \
--clone
elif [[ "$dry_run" = "n" && "$dont_need_clone" = "y" ]]; then
# echo "not a dry run, dont need clone"
./release/src/main/scripts/choose_rc_commit.sh \
--release "${RELEASE_VERSION}" \
--rc "${RC_NUM}" \
--commit "${COMMIT_REF}" \
--push-tag
else
# echo "not a dry run, need clone"
./release/src/main/scripts/choose_rc_commit.sh \
--release "${RELEASE_VERSION}" \
--rc "${RC_NUM}" \
--commit "${COMMIT_REF}" \
--clone \
--push-tag
fi
printf "\n\nPlease confirm the following...
* The release branch is unchanged.
* There is a commit not on the release branch with the version adjusted.
* The RC tag points to that commit.\n"
read -r -p "Continue [y/n]: " continue
# echo $continue
if [[ "$continue" = "n" ]]; then
exit 0
fi
echo "==================== Run build_release_candidate GitHub Action to create a release candidate ======================="
# NOTE!!! need to 1. configure github cli (e..g brew install gh), set up auth, and then make sure the github actions ur calling (the yml files) have on: workflow_dispatch
gh workflow run build_release_candidate.yml #--ref idk NEED TO CHOOSE THE RIGHT REF.. i think its just the release branch?
echo "==================== Verify docker images ======================="
RC_TAG=${RELEASE_VERSION}rc${RC_NUM}
for pyver in 3.8 3.9 3.10 3.11; do
docker run --rm --entrypoint sh \
apache/beam_python${pyver}_sdk:${RC_TAG} \
-c 'ls -al /opt/apache/beam/third_party_licenses/ | wc -l'
done
for javaver in 8 11 17; do
docker run --rm --entrypoint sh \
apache/beam_java${javaver}_sdk:${RC_TAG} \
-c 'ls -al /opt/apache/beam/third_party_licenses/ | wc -l'
done