Skip to content

Commit 6fd04fc

Browse files
committed
Makefile: update Docker image when toolchain changes
Update Docker image whenever we update the toolchange to force rebuild. Fixes tailscale/corp#26816 Signed-off-by: kari-ts <[email protected]>
1 parent 6a3342e commit 6fd04fc

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

Makefile

+13-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,19 @@
1010
# with this name, it will be used.
1111
#
1212
# The convention here is tailscale-android-build-amd64-<date>
13-
DOCKER_IMAGE=tailscale-android-build-amd64-191124
13+
#
14+
# Compute a quarterly version string.
15+
year=$(date +%y)
16+
month=$(date +%m)
17+
# Convert month to an integer.
18+
month_int=$(printf "%d" "$month")
19+
# Calculate the quarter's start month:
20+
# Quarter = floor((month-1)/3), then start = (quarter*3)+1.
21+
quarter_start=$(( ((month_int - 1) / 3) * 3 + 1 ))
22+
formatted_quarter=$(printf "%02d" "$quarter_start")
23+
24+
# Set the Docker image name. This will update every 3 months.
25+
DOCKER_IMAGE="tailscale-android-build-amd64-${year}${formatted_quarter}"
1426
export TS_USE_TOOLCHAIN=1
1527

1628
DEBUG_APK=tailscale-debug.apk

0 commit comments

Comments
 (0)