Skip to content

Commit

Permalink
chore: remove unwanted setup in fly.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
muco-rolle committed Oct 20, 2024
1 parent 514401b commit d5dc74b
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 66 deletions.
64 changes: 11 additions & 53 deletions .fly/scripts/1_storage_init.sh
Original file line number Diff line number Diff line change
@@ -1,56 +1,14 @@
#!/bin/bash

# Ensure the storage folder has the correct structure
STORAGE_PATH=/var/www/html/storage
STORAGE_BACKUP_PATH=/var/www/html/storage_

if [ ! -d "$STORAGE_PATH/app" ]; then
echo "$STORAGE_PATH/app is not a directory, copying content from $STORAGE_BACKUP_PATH to $STORAGE_PATH"
cp -r $STORAGE_BACKUP_PATH/. $STORAGE_PATH
echo "Deleting $STORAGE_BACKUP_PATH..."
rm -rf $STORAGE_BACKUP_PATH
fi

# Ensure the database folder and SQLite file exist
DB_FOLDER=$STORAGE_PATH/database
DB_FILE=$DB_FOLDER/database.sqlite

if [ ! -d "$DB_FOLDER" ]; then
echo "$DB_FOLDER does not exist, initializing database folder"
mkdir -p $DB_FOLDER
FOLDER=/var/www/html/storage/app
if [ ! -d "$FOLDER" ]; then
echo "$FOLDER is not a directory, copying storage_ content to storage"
cp -r /var/www/html/storage_/. /var/www/html/storage
echo "deleting storage_..."
rm -rf /var/www/html/storage_
fi

if [ ! -f "$DB_FILE" ]; then
echo "$DB_FILE not found, creating SQLite database"
touch $DB_FILE
FOLDER=/var/www/html/storage/database
if [ ! -d "$FOLDER" ]; then
echo "$FOLDER is not a directory, initializing database"
mkdir /var/www/html/storage/database
touch /var/www/html/storage/database/database.sqlite
fi

echo "Script execution completed."
#!/bin/bash

# Ensure the storage folder has the correct structure
STORAGE_PATH=/var/www/html/storage
STORAGE_BACKUP_PATH=/var/www/html/storage_

if [ ! -d "$STORAGE_PATH/app" ]; then
echo "$STORAGE_PATH/app is not a directory, copying content from $STORAGE_BACKUP_PATH to $STORAGE_PATH"
cp -r $STORAGE_BACKUP_PATH/. $STORAGE_PATH
echo "Deleting $STORAGE_BACKUP_PATH..."
rm -rf $STORAGE_BACKUP_PATH
fi

# Ensure the database folder and SQLite file exist
DB_FOLDER=$STORAGE_PATH/database
DB_FILE=$DB_FOLDER/database.sqlite

if [ ! -d "$DB_FOLDER" ]; then
echo "$DB_FOLDER does not exist, initializing database folder"
mkdir -p $DB_FOLDER
fi

if [ ! -f "$DB_FILE" ]; then
echo "$DB_FILE not found, creating SQLite database"
touch $DB_FILE
fi

echo "Script execution completed."
12 changes: 11 additions & 1 deletion .fly/scripts/caches.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
#!/usr/bin/env bash

set -e # Exit immediately if a command exits with a non-zero status

echo "Caching config..."
/usr/bin/php /var/www/html/artisan config:cache --no-ansi -q

echo "Caching routes..."
/usr/bin/php /var/www/html/artisan route:cache --no-ansi -q

echo "Caching views..."
/usr/bin/php /var/www/html/artisan view:cache --no-ansi -q

php artisan migrate --force
echo "Running database migrations..."
/usr/bin/php /var/www/html/artisan migrate --force --no-ansi -q

echo "Deployment script completed successfully."
14 changes: 2 additions & 12 deletions fly.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# fly.toml app configuration file generated for keza-starter-kit on 2024-10-20T17:07:58+02:00
# fly.toml app configuration file generated for keza on 2024-10-20T18:45:26+02:00
#
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
#

app = 'keza-starter-kit'
app = 'keza'
primary_region = 'jnb'
console_command = 'php /var/www/html/artisan tinker'

Expand All @@ -12,9 +12,6 @@ console_command = 'php /var/www/html/artisan tinker'
NODE_VERSION = '18'
PHP_VERSION = '8.2'

[deploy]
strategy = 'bluegreen'

[env]
APP_ENV = 'production'
DB_CONNECTION = 'sqlite'
Expand Down Expand Up @@ -42,13 +39,6 @@ console_command = 'php /var/www/html/artisan tinker'
min_machines_running = 0
processes = ['app']

[[http_service.checks]]
interval = '30s'
timeout = '5s'
grace_period = '10s'
method = 'GET'
path = '/'

[[vm]]
memory = '512mb'
cpu_kind = 'shared'
Expand Down

0 comments on commit d5dc74b

Please sign in to comment.