-
Notifications
You must be signed in to change notification settings - Fork 0
/
agorakit.sh
46 lines (35 loc) · 1.32 KB
/
agorakit.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash
# Declare site in YAML, as documented on the documentation: https://help.alwaysdata.com/en/marketplace/build-application-script/
# site:
# type: php
# path: '{INSTALL_PATH_RELATIVE}/public'
# php_version: '8.3'
# php_ini: extension=imap.so
# database:
# type: mysql
# requirements:
# disk: 100
set -e
# https://docs.agorakit.org/install.html
# Download and install dependancies
git clone https://github.com/agorakit/agorakit.git --branch main --depth 1 --single-branch
cd agorakit
COMPOSER_CACHE_DIR=/dev/null composer2 install --no-dev
# Configuration
sed -i "s|APP_URL=https://example.com|APP_URL=https://$INSTALL_URL|" .env.example
sed -i "s|DB_HOST=localhost|DB_HOST=$DATABASE_HOST|" .env.example
sed -i "s|DB_DATABASE=database_database|DB_DATABASE=$DATABASE_NAME|" .env.example
sed -i "s|DB_USERNAME=database_username|DB_USERNAME=$DATABASE_USERNAME|" .env.example
sed -i "s|DB_PASSWORD=database_user_password|DB_PASSWORD=$DATABASE_PASSWORD|" .env.example
sed -i "s|MAIL_HOST=database_user_password|DB_PASSWORD=$DATABASE_PASSWORD|" .env.example
mv .env.example .env
php artisan key:generate --force
php artisan migrate --force
php artisan storage:link
# Clean install environment
cd ..
rm -rf .config .local
shopt -s dotglob
mv agorakit/* .
rmdir agorakit
# Create a first user, it will be super admin