This repository has been archived by the owner on Apr 23, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 947
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
53 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
echo "Node Version: $(node -v)" | ||
echo "cURL Version: $(curl --version | head -n 1)" | ||
echo "Docker Version: $(docker -v)" | ||
echo "Docker Compose Version: $(docker compose version)" | ||
|
||
if [ ! -f docker/.env ] | ||
then | ||
echo "Generating .env file..." | ||
|
||
ENV="develop" | ||
|
||
echo "Preparing your keys from https://my.telegram.org/" | ||
read -p "Enter your TG_API_ID: " TG_API_ID | ||
read -p "Enter your TG_API_HASH: " TG_API_HASH | ||
|
||
echo | ||
read -p "Enter your ADMIN_USERNAME: " ADMIN_USERNAME | ||
read -p "Enter your PORT: " PORT | ||
PORT="${PORT:=4000}" | ||
|
||
DB_PASSWORD=$(node -e "console.log(require('crypto').randomBytes(48).toString('base64'));") | ||
|
||
echo "ENV=$ENV" > docker/.env | ||
echo "PORT=$PORT" >> docker/.env | ||
echo "TG_API_ID=$TG_API_ID" >> docker/.env | ||
echo "TG_API_HASH=$TG_API_HASH" >> docker/.env | ||
echo "ADMIN_USERNAME=$ADMIN_USERNAME" >> docker/.env | ||
echo "DB_PASSWORD=$DB_PASSWORD" >> docker/.env | ||
|
||
cd docker | ||
docker compose build teledrive | ||
docker compose up -d | ||
sleep 2 | ||
docker compose exec teledrive yarn workspace api prisma migrate deploy | ||
else | ||
git reset --hard | ||
git clean -f | ||
git pull origin main | ||
|
||
export $(cat docker/.env | xargs) | ||
|
||
cd docker | ||
docker compose down | ||
docker compose up --build --force-recreate -d | ||
sleep 2 | ||
docker compose up -d | ||
docker compose exec teledrive yarn workspace api prisma migrate deploy | ||
docker image prune -f | ||
fi |
8bb65aa
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
teledrive-web – ./
teledrive-web.vercel.app
teledrive-web-restfire-studio.vercel.app
teledrive-web-git-main-restfire-studio.vercel.app