Alright, NOW, it should do the trick
This commit is contained in:
@@ -37,11 +37,19 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Notify Watchtower
|
- name: Notify Watchtower
|
||||||
run: |
|
run: |
|
||||||
# 1. Dynamically grab the Docker gateway IP of the host machine
|
# 1. Grab the default gateway hex code from the routing table
|
||||||
HOST_IP=$(ip route | awk '/default/ {print $3}')
|
HEX_GW=$(awk '$2 == "00000000" {print $3; exit}' /proc/net/route)
|
||||||
|
|
||||||
|
# 2. Convert little-endian Hex (e.g., 010011AC) to standard Decimal IP (172.17.0.1)
|
||||||
|
if [ -n "$HEX_GW" ]; then
|
||||||
|
HOST_IP=$(printf "%d.%d.%d.%d" 0x${HEX_GW:6:2} 0x${HEX_GW:4:2} 0x${HEX_GW:2:2} 0x${HEX_GW:0:2})
|
||||||
|
else
|
||||||
|
HOST_IP="172.17.0.1" # Standard fallback
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Detected Docker Host Gateway IP: $HOST_IP"
|
echo "Detected Docker Host Gateway IP: $HOST_IP"
|
||||||
|
|
||||||
# 2. Trigger Watchtower directly over local HTTP port 8080
|
# 3. Trigger Watchtower directly over local HTTP port 8080
|
||||||
curl -i -X POST \
|
curl -i -X POST \
|
||||||
-H "Authorization: Bearer ${{ secrets.WATCHTOWER_TOKEN }}" \
|
-H "Authorization: Bearer ${{ secrets.WATCHTOWER_TOKEN }}" \
|
||||||
"http://$HOST_IP:8007/v1/update"
|
"http://$HOST_IP:8080/v1/update"
|
||||||
Reference in New Issue
Block a user