Skip to content

Commit

Permalink
fix install
Browse files Browse the repository at this point in the history
  • Loading branch information
BenediktMKuehne committed Aug 5, 2024
1 parent ebab62b commit 9832942
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 19 deletions.
4 changes: 2 additions & 2 deletions dev-tools/check_project.sh
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,10 @@ dockerchecker(){
ENV=0
fi
echo -e "\\n""${ORANGE}""${BOLD}""EMBArk docker-files check""${NC}""\\n""${BOLD}""=================================================================""${NC}"
mapfile -t DOCKER_COMPS < <(find . -maxdepth 1 -type d -name migrations -prune -false -o -iname "docker-compose*.yml")
mapfile -t DOCKER_COMPS < <(find . -maxdepth 1 -type d -name migrations -prune -false -o -iname "docker compose*.yml")
for DOCKER_COMP in "${DOCKER_COMPS[@]}"; do
echo -e "\\n""${GREEN}""Run docker check on ${DOCKER_COMP}:""${NC}""\\n"
if docker-compose -f "${DOCKER_COMP}" config 1>/dev/null || [[ $? -ne 1 ]]; then
if docker compose -f "${DOCKER_COMP}" config 1>/dev/null || [[ $? -ne 1 ]]; then
echo -e "${GREEN}""${BOLD}""==> SUCCESS""${NC}""\\n"
else
echo -e "\\n""${ORANGE}${BOLD}==> FIX ERRORS""${NC}""\\n"
Expand Down
4 changes: 2 additions & 2 deletions helper/helper_embark_general.sh
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ check_db() {
HOST_ENV=$(grep DATABASE_HOST ./.env | sed 's/DATABASE\_HOST\=//')
echo -e "\\n${ORANGE}""${BOLD}""checking database""${NC}\\n""${BOLD}=================================================================${NC}"
echo -e "${BLUE}""${BOLD}""1. checking startup""${NC}\\n"
if docker-compose -f ./docker-compose.yml up -d ; then
if docker compose -f ./docker compose.yml up -d ; then
echo -e "${GREEN}""${BOLD}""Finished setup mysql and redis docker images""${NC}"
add_to_env_history "${PW_ENV}" "$(docker-compose ps -q embark_db)"
add_to_env_history "${PW_ENV}" "$(docker compose ps -q embark_db)"
else
echo -e "${ORANGE}""${BOLD}""Failed setup mysql and redis docker images""${NC}"
exit 1
Expand Down
28 changes: 13 additions & 15 deletions installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -249,12 +249,16 @@ install_debs(){
if ! command -v gcc > /dev/null ; then
apt-get install -y build-essential
fi
# Docker + docker-compose
# Docker + docker compose
if [[ "${WSL}" -eq 1 ]]; then
echo -e "\n${ORANGE}WARNING: If you are using WSL2, disable docker integration from the docker-desktop daemon!${NC}"
read -p "Fix docker stuff, then continue. Press any key to continue ..." -n1 -s -r
fi
if ! command -v docker > /dev/null || ! command -v docker-compose > /dev/null ; then
if ! command -v docker-compose > /dev/null;
echo -e "\n${RED}""${BOLD}""Old docker-compose version found, please uninstall""${NC}"
exit 1
fi
if ! command -v docker > /dev/null || ! command -v docker compose > /dev/null ; then
# Add Docker's official GPG key:
apt-get install -y ca-certificates curl gnupg
install -m 0755 -d /etc/apt/keyrings
Expand All @@ -265,13 +269,7 @@ install_debs(){
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
apt-get update -y
apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
fi
# alias for compose to stay backwards comp
if ! command -v docker-compose > /dev/null ; then
if docker --help | grep -q compose; then
alias docker-compose="docker compose"
fi
apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker compose-plugin
fi
# python3-dev
if ! dpkg -l python3.10-dev &>/dev/null; then
Expand Down Expand Up @@ -394,13 +392,13 @@ install_embark_default(){
fi

# download images for container
docker-compose pull
docker-compose up -d
docker compose pull
docker compose up -d

# activate daemon
systemctl start embark.service
check_db
docker-compose stop
docker compose stop
echo -e "${GREEN}""${BOLD}""Ready to use \$sudo ./run-server.sh ""${NC}"
echo -e "${GREEN}""${BOLD}""Which starts the server on (0.0.0.0) port 80 ""${NC}"
}
Expand Down Expand Up @@ -473,11 +471,11 @@ install_embark_dev(){
chmod 644 .env

# download images for container
docker-compose pull
docker-compose up -d
docker compose pull
docker compose up -d

check_db
docker-compose stop
docker compose stop
echo -e "${GREEN}""${BOLD}""Ready to use \$sudo ./dev-tools/debug-server-start.sh""${NC}"
echo -e "${GREEN}""${BOLD}""Or use otherwise""${NC}"
}
Expand Down

0 comments on commit 9832942

Please sign in to comment.