-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add linux automation script and extend support for linux
- Loading branch information
tushar5526
committed
Dec 28, 2023
1 parent
a16aca0
commit 63a0353
Showing
4 changed files
with
63 additions
and
12 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 |
---|---|---|
@@ -1,10 +1,8 @@ | ||
# vars mostly used in local development | ||
BASE_DIR='/Users/tusharsamagra/projects/sarthi/server/deployments' | ||
NGINX_PROXY_CONF_LOCATION='/Users/tusharsamagra/projects/sarthi/server/nginx-confs' | ||
DEPLOYMENTS_MOUNT_DIR='/home/ubuntu/sarthi/server' | ||
NGINX_PROXY_CONF_LOCATION='/home/ubuntu/sarthi/server/nginx-confs' | ||
ENV=local | ||
DEPLOYMENT_HOST='localhost' | ||
# mac hack | ||
DOCKER_MOUNT_DIR='/Users/tusharsamagra/projects/sarthi/server/deployments' | ||
|
||
|
||
# this should be your wildcard domain name | ||
DOMAIN_NAME=localhost |
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 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,48 @@ | ||
#!/bin/bash | ||
|
||
# Colors | ||
GREEN='\033[0;32m' | ||
YELLOW='\033[1;33m' | ||
RED='\033[0;31m' | ||
NC='\033[0m' # No Color | ||
|
||
# Emojis | ||
CHECK_MARK='✔️' | ||
CROSS_MARK='❌' | ||
WARNING='⚠️' | ||
DOCKER='🐳' | ||
|
||
# Check if script is run as root | ||
if [ "$EUID" -ne 0 ]; then | ||
echo -e "${RED}${CROSS_MARK} Please run as root.${NC}" >&2 | ||
exit 1 | ||
fi | ||
|
||
# Update package index | ||
echo -e "${YELLOW}${WARNING} Updating package index...${NC}" | ||
apt update | ||
|
||
# Install prerequisites | ||
echo -e "${YELLOW}${WARNING} Installing prerequisites...${NC}" | ||
apt install -y apt-transport-https ca-certificates curl software-properties-common | ||
|
||
# Install Docker | ||
echo -e "${YELLOW}${WARNING} Installing Docker...${NC}" | ||
curl -fsSL https://get.docker.com -o get-docker.sh | ||
sh get-docker.sh | ||
rm get-docker.sh | ||
|
||
# Add user to docker group | ||
echo -e "${YELLOW}${WARNING} Adding user to the docker group...${NC}" | ||
usermod -aG docker $USER | ||
newgrp docker | ||
|
||
|
||
# Install Docker Compose | ||
echo -e "${YELLOW}${WARNING} Installing Docker Compose...${NC}" | ||
curl -sSL https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose | ||
chmod +x /usr/local/bin/docker-compose | ||
|
||
# Display success message | ||
echo -e "${GREEN}${CHECK_MARK} Docker and Docker Compose installed successfully.${NC}" | ||
echo -e "${DOCKER} ${YELLOW}You may need to restart your shell or log out and log back in to apply the changes.${NC}" |