ci: output version info as JSON format and update e2e parser
TaxBaik CI/CD / build-and-deploy (push) Successful in 58s
TaxBaik CI/CD / build-and-deploy (push) Successful in 58s
This commit is contained in:
@@ -47,9 +47,9 @@ jobs:
|
||||
echo "Expected short version: $SHORT_VERSION"
|
||||
for i in $(seq 1 30); do
|
||||
# Suppress stderr and allow failures to handle transition/down periods cleanly
|
||||
VERSION_BODY="$(curl -fsS "http://${DEPLOY_HOST}/taxbaik/version.txt" 2>/dev/null || true)"
|
||||
VERSION_BODY="$(curl -fsS "http://${DEPLOY_HOST}/taxbaik/version.json" 2>/dev/null || true)"
|
||||
BLOG_STATUS="$(curl -s -o /dev/null -w '%{http_code}' "http://${DEPLOY_HOST}/taxbaik/blog/accountant-mistakes-5" || true)"
|
||||
if echo "$VERSION_BODY" | grep -q "Version: ${SHORT_VERSION}" && [ "$BLOG_STATUS" = "200" ]; then
|
||||
if echo "$VERSION_BODY" | grep -q "\"version\": \"${SHORT_VERSION}\"" && [ "$BLOG_STATUS" = "200" ]; then
|
||||
echo "Deployment is ready for ${SHORT_VERSION}"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
@@ -63,7 +63,7 @@ jobs:
|
||||
COMMIT_HASH=$(git rev-parse --short HEAD)
|
||||
BUILD_TIME=$(date -u +'%Y-%m-%d %H:%M:%S UTC')
|
||||
mkdir -p ./publish/wwwroot
|
||||
printf 'Version: %s\nBuilt: %s\n' "$COMMIT_HASH" "$BUILD_TIME" > ./publish/wwwroot/version.txt
|
||||
printf '{\n "version": "%s",\n "built": "%s"\n}\n' "$COMMIT_HASH" "$BUILD_TIME" > ./publish/wwwroot/version.json
|
||||
echo "✓ Build: $COMMIT_HASH @ $BUILD_TIME"
|
||||
|
||||
- name: Setup SSH
|
||||
|
||||
Reference in New Issue
Block a user