-
Notifications
You must be signed in to change notification settings - Fork 204
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ballerine_install.sh): add ballerine_install.sh script to automa… (
#2122) * feat: add ballerine_install.sh script for installing and configuring Ballerine The `ballerine_install.sh` script is added to the repository. This script is used to install and configure Ballerine. It takes a domain name as an argument and performs the following tasks: - Updates frontend build variables in the `.env.example` files of the `apps` directory, replacing the `localhost` with the provided domain name. - Updates environment variables in the `.env` files of the `deploy` directory, replacing the `DOMAIN_NAME=""` with the provided domain name. - Installs Docker and Docker Compose. - If a domain name is provided, it updates the frontend build variables and environment variables. - If a domain name is not provided, it displays a message to provide a domain name. The `ballerine_install.sh` script can be executed with a domain name argument to install and configure Ballerine on a specific domain. --- docs: update deploy/README.md The `deploy/README.md` file is updated to reflect the changes made in the installation process. The instructions for running the `docker-compose.yml` file are modified to include running the `ballerine_install.sh` script with a domain name argument. --- chore: remove deploy/scripts/boot.sh The `deploy/scripts/boot.sh` script is removed from the repository as it is no longer needed. The functionality provided by this script is now handled by the `ballerine_install.sh` script. * chore(ballerine_install.sh): add command to bring up docker container after updating build variables and environment configuration * Update ballerine_install.sh --------- Co-authored-by: Alon Peretz <[email protected]>
- Loading branch information
1 parent
70be7c7
commit 04fd4d6
Showing
4 changed files
with
62 additions
and
103 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,55 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
# Example Usage: | ||
# ./ballerine_install.sh <VITE_API_URL_DOMAIN_NAME> | ||
|
||
echo "Running as: $(id)" | ||
|
||
WORKFLOW_SERVICE_DOMAIN_NAME=$1 | ||
|
||
function update_frontend_build_variables() { | ||
## Get frontend application env files | ||
echo "Updating frontend Build Variables" | ||
env_files=$(find ./apps -name "*.env.example") | ||
echo $env_files | ||
for i in $env_files; | ||
do | ||
echo "Updating env variables of $i" | ||
sed -i "s/localhost/${WORKFLOW_SERVICE_DOMAIN_NAME}/g" $i | ||
done | ||
|
||
} | ||
|
||
function update_env_docker_compose(){ | ||
## update env variables for docker-compose yaml | ||
echo "Updating docker-compose env variables" | ||
env_files=$(find ./deploy -name "*.env") | ||
for i in $env_files; | ||
do | ||
echo "Updating env variables of $i" | ||
sed -i "s/DOMAIN_NAME=\"\"/DOMAIN_NAME=\"${WORKFLOW_SERVICE_DOMAIN_NAME}\"/g" $i; | ||
done | ||
} | ||
|
||
function install_docker(){ | ||
sudo apt update; | ||
sudo apt install -y docker.io | ||
mkdir -p ~/.docker/cli-plugins/ | ||
curl -SL https://github.com/docker/compose/releases/download/v2.3.3/docker-compose-linux-x86_64 -o ~/.docker/cli-plugins/docker-compose | ||
chmod +x ~/.docker/cli-plugins/docker-compose | ||
sudo mv ~/.docker/cli-plugins/docker-compose /usr/bin/docker-compose | ||
} | ||
|
||
|
||
install_docker | ||
|
||
if [[ ! -z "${WORKFLOW_SERVICE_DOMAIN_NAME}" ]]; then | ||
### Update frontend build variables only if domain_name is given | ||
update_frontend_build_variables | ||
update_env_docker_compose | ||
fi | ||
|
||
## Bring docker-container up | ||
cd deploy; sudo docker-compose -f docker-compose-build.yml up -d |
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
This file was deleted.
Oops, something went wrong.