-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update deployment process to support multiple environments
- Loading branch information
Showing
2 changed files
with
21 additions
and
11 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,24 +1,35 @@ | ||
#!/bin/bash | ||
# | ||
# - Update frontend docker and restart | ||
# - Make sure we have all environment variables set | ||
# Update frontend docker and restart | ||
# | ||
# Usage: ./update-production <version-tag> | ||
# | ||
|
||
set -e | ||
|
||
if [ -z "$TS_PUBLIC_FRONTEND_VERSION_TAG" ] ; then | ||
echo "Please set TS_PUBLIC_FRONTEND_VERSION_TAG" | ||
echo "export TS_PUBLIC_FRONTEND_VERSION_TAG=" | ||
if [ $# -ne 1 ]; then | ||
echo "Please provide version tag as argument" | ||
echo "Usage: $0 <version-tag>" | ||
echo "See https://github.com/tradingstrategy-ai/frontend/pkgs/container/frontend" | ||
exit 1 | ||
fi | ||
|
||
# Set version tag | ||
export TS_PUBLIC_FRONTEND_VERSION_TAG="$1" | ||
|
||
# Set project name based on directory name, or override with env var | ||
export COMPOSE_PROJECT_NAME=${TS_PROJECT_NAME:-$(basename $(pwd))} | ||
|
||
source ~/secrets.env | ||
|
||
docker-compose up -d | ||
# Source local config if exists (overrides shared secrets) | ||
if [ -f ./config.env ]; then | ||
source ./config.env | ||
fi | ||
|
||
docker compose up -d | ||
|
||
echo "All ok" | ||
sleep 5 | ||
docker ps | grep frontend | ||
|
||
|
||
docker ps --filter name="${COMPOSE_PROJECT_NAME}-frontend-1" | ||
docker compose logs --tail=20 |