|
@@ -49,7 +49,10 @@ spec:
|
|
|
# Execute the original entrypoint with all arguments
|
|
# Execute the original entrypoint with all arguments
|
|
|
/usr/local/bin/rclone "$@"
|
|
/usr/local/bin/rclone "$@"
|
|
|
# Capture the exit code
|
|
# Capture the exit code
|
|
|
- echo $? > /shared/exit-code
|
|
|
|
|
|
|
+ EXIT_CODE=$?
|
|
|
|
|
+ echo $EXIT_CODE > /shared/exit-code
|
|
|
|
|
+ echo "Exit code is $EXIT_CODE"
|
|
|
|
|
+ exit $EXIT_CODE
|
|
|
EOF
|
|
EOF
|
|
|
chmod +x /shared/wrapper.sh
|
|
chmod +x /shared/wrapper.sh
|
|
|
volumeMounts:
|
|
volumeMounts:
|
|
@@ -82,15 +85,20 @@ spec:
|
|
|
|
|
|
|
|
AUTH_HEADER="Authorization: Bearer tk_up3glyzhhojl1w5lt32jq5vqjzdgb"
|
|
AUTH_HEADER="Authorization: Bearer tk_up3glyzhhojl1w5lt32jq5vqjzdgb"
|
|
|
URL="http://ntfy/backup"
|
|
URL="http://ntfy/backup"
|
|
|
- MESSAGE="Remote restic backup"
|
|
|
|
|
|
|
+ MESSAGE="Remote rclone restic repo backup"
|
|
|
|
|
+ EXIT_CODE=$(cat /shared/exit-code)
|
|
|
|
|
|
|
|
- if [ "$(cat /shared/exit-code)" -eq 0 ]; then
|
|
|
|
|
|
|
+ echo "Captured exit code is $EXIT_CODE"
|
|
|
|
|
+
|
|
|
|
|
+ if [ "$EXIT_CODE" -eq 0 ]; then
|
|
|
STATUS="was successful"
|
|
STATUS="was successful"
|
|
|
else
|
|
else
|
|
|
STATUS="FAILED"
|
|
STATUS="FAILED"
|
|
|
fi
|
|
fi
|
|
|
|
|
|
|
|
curl -X POST -H "$AUTH_HEADER" -d "${MESSAGE} ${STATUS}." "$URL"
|
|
curl -X POST -H "$AUTH_HEADER" -d "${MESSAGE} ${STATUS}." "$URL"
|
|
|
|
|
+
|
|
|
|
|
+ exit $EXIT_CODE
|
|
|
volumeMounts:
|
|
volumeMounts:
|
|
|
- name: shared-data
|
|
- name: shared-data
|
|
|
mountPath: /shared
|
|
mountPath: /shared
|