Skip to content

Commit

Permalink
Merge pull request #2 from DanArmor/master
Browse files Browse the repository at this point in the history
улучшенная проверка vendor deps + set -e для init.sh
  • Loading branch information
Kostyavas authored Apr 12, 2024
2 parents 185f9e6 + d12e3a2 commit c38aeae
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
10 changes: 7 additions & 3 deletions app/init.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

set -e

echo "Initializing"

USERNAME="www-data"
Expand All @@ -24,12 +26,14 @@ mkhomedir_helper $USERNAME

mkdir -p /var/www/bearpass

if [ ! -d "/var/www/bearpass/vendor" ]
then
echo "Downloading vendor deps..."
vendor_deps_status=$(composer install --no-dev --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist --dry-run 2>&1 | grep "Nothing to install, update or remove")
if [[ -z $vendor_deps_status ]]; then
echo "Downloading / updating vendor deps..."
cd /var/www/bearpass && \
composer install --no-dev -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist && \
composer dump-autoload
else
echo "Vendor deps are up-to-date"
fi

if [ ! -f "/var/www/bearpass/.env" ]
Expand Down
2 changes: 2 additions & 0 deletions cron/init.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

set -e

USERNAME="www-data"
GROUPNAME="www-data"

Expand Down
2 changes: 2 additions & 0 deletions nginx/init.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/sh

set -e

USERNAME="www-data"
GROUPNAME="www-data"

Expand Down

0 comments on commit c38aeae

Please sign in to comment.