Skip to content

Commit

Permalink
[4.2.1] Fixed some bugs
Browse files Browse the repository at this point in the history
- Fixed duplication in environment variables for import script
- Added missing migration command
- Added missing mailpit local site setup
  • Loading branch information
GoodM4ven committed Oct 31, 2024
1 parent 73b880c commit 13c1d1f
Show file tree
Hide file tree
Showing 20 changed files with 33 additions and 12 deletions.
3 changes: 3 additions & 0 deletions scripts/TALL/create.sh
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ minioUp $escaped_project_name

cd $projects_directory/$escaped_project_name

# ? Migrate the database
php artisan migrate:fresh --seed

# TODO Install vpremiss/tall-stacker package manager via Composer when it's ready -_-"

if [[ -n "$EXPOSE_TOKEN" ]]; then
Expand Down
3 changes: 3 additions & 0 deletions scripts/TALL/import.sh
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ minioUp $escaped_project_name

cd $projects_directory/$escaped_project_name

# ? Migrate the database
php artisan migrate:fresh --seed

# TODO Install TALL-STACKER package manager via Composer

if [[ -n "$EXPOSE_TOKEN" ]]; then
Expand Down
Empty file modified scripts/functions/helpers/continue_or_abort.sh
100644 → 100755
Empty file.
Empty file modified scripts/functions/mailpit_up.sh
100644 → 100755
Empty file.
17 changes: 10 additions & 7 deletions scripts/functions/memcached_up.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,16 @@ memcachedUp() {

# ? Modify the Laravel project's environment variables
sed -i 's/^CACHE_STORE=.*/CACHE_STORE=memcached/' ./.env
awk -v id="$memcached_id" 'BEGIN{added=0} /^REDIS_/ && !added {
print "MEMCACHED_HOST=127.0.0.1";
print "MEMCACHED_PERSISTENT_ID=" id "\n";
print;
added=1;
next
} {print}' ./.env > temp.env && mv temp.env ./.env
awk -v id="$memcached_id" '
BEGIN{added=0}
/^MEMCACHED_HOST=127.0.0.1/ {memcached_exists=1}
/^REDIS_/ && !added && !memcached_exists {
print "MEMCACHED_HOST=127.0.0.1";
print "MEMCACHED_PERSISTENT_ID=" id;
added=1;
}
{print}
' ./.env > temp.env && mv temp.env ./.env
sed -i '/^REDIS_/{s/^/# /}' ./.env

echo -e "\nConfigured Memcached to replace Redis in environment variables." >&3
Expand Down
13 changes: 8 additions & 5 deletions scripts/functions/minio_up.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,14 @@ EOF

# ? Update the Laravel project's environment variables for MinIO storage
cd $projects_directory/$escaped_project_name
sed -i "s/FILESYSTEM_DISK=local/FILESYSTEM_DISK=s3/g" ./.env
sed -i "s/AWS_ACCESS_KEY_ID=/AWS_ACCESS_KEY_ID=minioadmin/g" ./.env
sed -i "s/AWS_SECRET_ACCESS_KEY=/AWS_SECRET_ACCESS_KEY=minioadmin/g" ./.env
sed -i "s/AWS_BUCKET=/AWS_BUCKET=$escaped_project_name/g" ./.env
sed -i "s|AWS_USE_PATH_STYLE_ENDPOINT=false|AWS_ENDPOINT=http://localhost:9000\nAWS_URL=http://localhost:9000/$escaped_project_name\nAWS_USE_PATH_STYLE_ENDPOINT=true|g" ./.env
sed -i "/^FILESYSTEM_DISK=/c\FILESYSTEM_DISK=s3" ./.env
sed -i "/^AWS_ACCESS_KEY_ID=/c\AWS_ACCESS_KEY_ID=minioadmin" ./.env
sed -i "/^AWS_SECRET_ACCESS_KEY=/c\AWS_SECRET_ACCESS_KEY=minioadmin" ./.env
sed -i "/^AWS_DEFAULT_REGION=/c\AWS_DEFAULT_REGION=us-east-1" ./.env
sed -i "/^AWS_BUCKET=/c\AWS_BUCKET=$escaped_project_name" ./.env
sed -i "/^AWS_ENDPOINT=/c\AWS_ENDPOINT=http://localhost:9000" ./.env
sed -i "/^AWS_URL=/c\AWS_URL=http://localhost:9000/$escaped_project_name" ./.env
sed -i "/^AWS_USE_PATH_STYLE_ENDPOINT=/c\AWS_USE_PATH_STYLE_ENDPOINT=true" ./.env

echo -e "\nSet up a MinIO storage for the project." >&3
}
Empty file modified scripts/functions/mysql_down.sh
100644 → 100755
Empty file.
Empty file modified scripts/functions/mysql_up.sh
100644 → 100755
Empty file.
Empty file modified scripts/functions/vite_up.sh
100644 → 100755
Empty file.
Empty file modified scripts/functions/workspace_up.sh
100644 → 100755
Empty file.
Empty file modified scripts/functions/xdebug_up.sh
100644 → 100755
Empty file.
9 changes: 9 additions & 0 deletions scripts/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,15 @@ RestartSec=10
[Install]
WantedBy=multi-user.target" | sudo tee /etc/systemd/system/minio.service >/dev/null

# ? Add an entry for the service to the /etc/hosts file if it doesn't exist
if ! grep -q "127.0.0.1 mailpit" /etc/hosts; then
echo "127.0.0.1 mailpit" | sudo tee -a /etc/hosts >/dev/null

echo -e "\nAdded the service to [/etc/hosts] file." >&3
else
echo -e "\nThe service mailpit is already in the [/etc/hosts] file." >&3
fi

sudo systemctl daemon-reload
if $cancel_suppression; then
sudo systemctl enable minio.service 2>&1
Expand Down
Empty file modified stubs/1_top_status_indicator.stub.sh
100644 → 100755
Empty file.
Empty file modified stubs/2_initial_validations.stub.sh
100644 → 100755
Empty file.
Empty file modified stubs/3_setup_isnt_run.stub.sh
100644 → 100755
Empty file.
Empty file modified stubs/4_env_vars_preparation.stub.sh
100644 → 100755
Empty file.
Empty file modified stubs/5_set_echoing_level.stub.sh
100644 → 100755
Empty file.
Empty file modified stubs/6_check_for_vsc.stub.sh
100644 → 100755
Empty file.
Empty file modified stubs/7_source_procedural_functions.stub.sh
100644 → 100755
Empty file.
Empty file modified stubs/8_the_ending_prompt.stub.sh
100644 → 100755
Empty file.

0 comments on commit 13c1d1f

Please sign in to comment.