-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3950 from dev-hato/fix_fly
fly.ioへのデプロイ処理修正
- Loading branch information
Showing
3 changed files
with
8 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,11 @@ | ||
#!/usr/bin/env bash | ||
set -x | ||
set -xe -o pipefail | ||
|
||
# この時点では必要な環境変数がセットされていないため、起動に失敗する (コマンドが異常終了する) | ||
fly launch --copy-config --vm-memory=256mb -y | ||
|
||
set -e | ||
POSTGRES_APP_NAME="$(yq '.app' fly.toml)-db" | ||
APP_NAME=$(yq '.app' fly.toml) | ||
fly apps create --name="$APP_NAME" | ||
grep -v DATABASE_URL .env | fly secrets import | ||
POSTGRES_APP_NAME="${APP_NAME}-db" | ||
fly postgres create --name="$POSTGRES_APP_NAME" --region="$(yq '.primary_region' fly.toml)" --initial-cluster-size=1 \ | ||
--vm-size="$(yq '.vm.[0].size' fly.toml)" --volume-size=1 | ||
fly postgres attach "$POSTGRES_APP_NAME" | ||
sleep 60 | ||
grep -v DATABASE_URL .env | fly secrets import | ||
sleep 60 | ||
|
||
# shellcheck disable=SC2046 | ||
fly machine start $(fly machine list --json | yq '.[].id' | tr "\n" ' ') | ||
fly deploy --vm-memory=256 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters