This repository has been archived on 2025-04-11. You can view files and clone it, but cannot push or open issues or pull requests.
bee-backend-ARCHIVED/bin/script/init
2024-08-24 20:33:05 +00:00

36 lines
950 B
Bash
Executable File

#!/bin/bash
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
PROJECT_DIR=$(realpath $SCRIPT_DIR/../../)
ENV_DIR=$(realpath $PROJECT_DIR/../../../)
# Check .env file
if [ ! -f "$PROJECT_DIR/.env" ]
then
echo "Create .env file from example..."
cp "$PROJECT_DIR/.env.example" "$PROJECT_DIR/.env"
echo ".env file created, please change variables and call init again"
exit 1
fi
# Source key-scripts
source $ENV_DIR/bin/drun
source $ENV_DIR/bin/dexec
# Build and start docker containers
dexec template-backend build
dexec template-backend up -d
# Install PHP packages
drun template-backend composer install
# Dump autoload
drun template-backend composer da
# Migrate databases to current version
drun template-backend composer dmm
drun template-backend composer dmlm
# Insert setup for project after this line
drun template-backend composer console rbac:update
drun template-backend composer console init:data