Skip to content

Commit

Permalink
[symfony4] Use correct logs dir (ezsystems#459)
Browse files Browse the repository at this point in the history
  • Loading branch information
wizhippo authored and lserwatka committed Oct 1, 2019
1 parent 43b297f commit 9d9e820
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 30 deletions.
16 changes: 3 additions & 13 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,12 @@ auth.json
# Skipped as it makes build very slow and since it is needed by composer when working on dev branches
#vendor/*/*/.git

### Symfony template
# Cache and logs (Symfony2)
app/cache/*
app/logs/*
!app/cache/.keep
!app/logs/.keep

# Email spool folder
app/spool/*

# Cache, session files and logs (Symfony3)
# Cache, session files and logs (Symfony4)
var/cache/*
var/logs/*
var/log/*
var/sessions/*
!var/cache/.gitkeep
!var/logs/.gitkeep
!var/log/.gitkeep
!var/sessions/.gitkeep

# Parameters (should be regenerated in container)
Expand Down
13 changes: 3 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
# in the official GitHub article: https://help.github.com/articles/ignoring-files/

/.web-server-pid
/app/config/parameters.yml
/build/
/phpunit.xml
/.phpunit.result.cache
Expand All @@ -27,9 +26,9 @@
!/var/cache
/var/cache/*
!var/cache/.gitkeep
!/var/logs
/var/logs/*
!var/logs/.gitkeep
!/var/log
/var/log/*
!var/log/.gitkeep
!/var/sessions
/var/sessions/*
!var/sessions/.gitkeep
Expand All @@ -52,12 +51,6 @@

.php~

# Legacy related ignores, that are generated by composer (settings not handled out of the box)
/ezpublish_legacy
/web/index_treemenu.php
/web/index_rest.php
/web/index_cluster.php

/doc/docker/entrypoint/*/*.sql
/dfsdata

Expand Down
2 changes: 1 addition & 1 deletion bin/.ci/prepare_archive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ composer install --no-interaction --prefer-dist --no-dev --no-scripts --optimize
mv .gitignore .gitignore.dist

# Archive: Remove cache (wrong paths), logs (generated by composer call above) & zeta tests (too big)
rm -Rf var/cache/*/* var/logs/* vendor/zetacomponents/*/tests
rm -Rf var/cache/*/* var/log/* vendor/zetacomponents/*/tests

# Remove .git folder from archives
rm -Rf .git/
Expand Down
2 changes: 1 addition & 1 deletion bin/.travis/trusty/setup_from_external_repo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ if [ "$RUN_INSTALL" = "1" ] ; then
echo "> Run composer install (try 3 times)"
for i in $(seq 1 3); do composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader && s=0 && break || s=$? && sleep 1; done; (exit $s)
mkdir -p web/var
rm -Rf var/logs/* var/cache/*/*
rm -Rf var/log/* var/cache/*/*
sudo chown -R www-data:www-data var web/var
find var web/var -type d | xargs chmod -R 775
find var web/var -type f | xargs chmod -R 664
Expand Down
2 changes: 1 addition & 1 deletion doc/docker/Dockerfile-app
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ RUN composer dump-autoload --optimize

# Next, remove everything we don't want to be copied to next build stage
# Clear cache again so env variables are taken into account on startup
RUN rm -Rf var/logs/* var/cache/*/*
RUN rm -Rf var/log/* var/cache/*/*

# Looks like we need to keep public/bundles ( like public/bundles/ezstudioui/js/views/ezs-landingpageview.js ) or else
# urls like http://localhost:8080/_ezcombo?/bundles/ezstudioui/js/views/ezs-landingpageview.js&/tpl/handlebars/studiolandingpageconfigview-ez-template.js&/bundles/ezstudioui/js/views/ezs-landingpageconfigview.js&/tpl/handlebars/studiolayoutselectorview-ez-template.js&/bundles/ezstudioui/js/views/ezs-layoutselectorview.js&/tpl/handlebars/studiolandingpageconfigpopupformview-ez-template.js&/bundles/ezstudioui/js/views/forms/ezs-landingpageconfigpopupformview.js&/tpl/handlebars/landingpagecreatorview-ez-template.js&/bundles/ezsystemsformbuilder/js/models/fb-formfield-model.js&/bundles/ezsystemsformbuilder/js/lists/fb-formfields-modellist.js&/bundles/ezsystemsformbuilder/js/models/fb-formpage-model.js&/bundles/ezsystemsformbuilder/js/lists/fb-formpages-modellist.js&/bundles/ezsystemsformbuilder/js/models/fb-form-model.js&/tpl/handlebars/fbbasetabview-ez-template.js&/bundles/ezsystemsformbuilder/js/tabs/fb-base-tabview.js&/tpl/handlebars/fbpanelview-ez-template.js&/bundles/ezsystemsformbuilder/js/panels/fb-panelview.js
Expand Down
8 changes: 4 additions & 4 deletions doc/docker/install_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ if [ "${INSTALL_DATABASE}" == "1" ]; then
mysqldump -u $DATABASE_USER --password=$DATABASE_PASSWORD -h $DATABASE_HOST --add-drop-table --extended-insert --protocol=tcp $DATABASE_NAME > doc/docker/entrypoint/mysql/2_dump.sql;
fi;

rm -Rf var/logs/* var/cache/*/*;
chown -R www-data:www-data var/cache var/logs public/var;
find var/cache var/logs public/var -type d -print0 | xargs -0 chmod -R 775;
find var/cache var/logs public/var -type f -print0 | xargs -0 chmod -R 664;
rm -Rf var/log/* var/cache/*/*;
chown -R www-data:www-data var/cache var/log public/var;
find var/cache var/log public/var -type d -print0 | xargs -0 chmod -R 775;
find var/cache var/log public/var -type f -print0 | xargs -0 chmod -R 664;
chown -R www-data:www-data config src;
Empty file added var/log/.gitkeep
Empty file.

0 comments on commit 9d9e820

Please sign in to comment.