diff options
| author | yyamashita <yyamashita@hetzner.yyamashita.com> | 2026-06-15 23:25:39 +0900 |
|---|---|---|
| committer | yyamashita <yyamashita@hetzner.yyamashita.com> | 2026-06-15 23:25:39 +0900 |
| commit | 090cf7d92e8e660b1dccf8d64780bd2430660cbc (patch) | |
| tree | 7d066972e89a47ca36f87e1faebec3366c8c8a94 /official-site-scripts/deploy.sh | |
| parent | 0443c8c9972cbe792716cca193f7ad1ae64c0eda (diff) | |
Add official-site-2023-dev as git submodule at official-site/
- Move management scripts from official-site/ to official-site-scripts/
- Update CLAUDE.md paths accordingly
- Deploy key configured at ~/.ssh/mosquitone_official_site_deploy
with SSH alias github-mosquitone-official-site
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'official-site-scripts/deploy.sh')
| -rwxr-xr-x | official-site-scripts/deploy.sh | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/official-site-scripts/deploy.sh b/official-site-scripts/deploy.sh new file mode 100755 index 0000000..32574e0 --- /dev/null +++ b/official-site-scripts/deploy.sh @@ -0,0 +1,41 @@ +#!/usr/bin/env bash +set -euo pipefail + +REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)" +[ -f "$REPO_ROOT/.env" ] && set -a && source "$REPO_ROOT/.env" && set +a + +AWS_CLI="${AWS_CLI:-/tmp/awscli/aws/dist/aws}" +APP_ID="d33773t2lyrxkx" +BRANCH="main" +REGION="${AWS_DEFAULT_REGION:-ap-northeast-1}" + +echo "Starting Amplify build: app=$APP_ID branch=$BRANCH" +JOB=$("$AWS_CLI" amplify start-job \ + --app-id "$APP_ID" \ + --branch-name "$BRANCH" \ + --job-type RELEASE \ + --region "$REGION" \ + --output json) + +JOB_ID=$(echo "$JOB" | python3 -c "import json,sys; print(json.load(sys.stdin)['jobSummary']['jobId'])") +echo "Job started: $JOB_ID" +echo "Console: https://ap-northeast-1.console.aws.amazon.com/amplify/apps/$APP_ID/branches/$BRANCH/deployments/$JOB_ID" + +echo "Waiting for build to complete..." +while true; do + STATUS=$("$AWS_CLI" amplify get-job \ + --app-id "$APP_ID" \ + --branch-name "$BRANCH" \ + --job-id "$JOB_ID" \ + --region "$REGION" \ + --output json | python3 -c "import json,sys; print(json.load(sys.stdin)['job']['summary']['status'])") + echo " Status: $STATUS" + if [[ "$STATUS" == "SUCCEED" ]]; then + echo "Build succeeded! https://www.mosquit.one" + break + elif [[ "$STATUS" == "FAILED" || "$STATUS" == "CANCELLED" ]]; then + echo "Build $STATUS" + exit 1 + fi + sleep 15 +done |
