Currently a git push production does not trigger a gulp run. We can't just bluntly start doing so, since we don't know if a project uses SASS nor if the gulpfile.js has been configured correctly.
If those are set up correctly, this addition would run Gulp:
--- a/scripts/git-hooks/post-receive
+++ b/scripts/git-hooks/post-receive
@@ -35,11 +35,15 @@ done
# Check files which have triggers
COMPOSER_CHANGED=false
NGINX_CHANGED=false
+SCSS_CHANGED=false
while read -r line; do
if [ "$line" = "composer.json" ] || [ "$line" = "composer.lock" ]; then
COMPOSER_CHANGED=true
elif [ "$line" = "nginx/*.conf" ]; then
NGINX_CHANGED=true
+ elif [[ "$line" =~ \.scss ]]; then
+ SCSS_CHANGED=true
fi
done <<< "$changed_files"
@@ -54,6 +58,10 @@ if $NGINX_CHANGED; then
wp-restart-nginx
fi
+if $SCSS_CHANGED; then
+ echo "Eeco: SASS files changed, running Gulp..."
+ gulp
+fi
If we some more smarts here, maybe we could test if gulpfile.json is configured (=modified from default, points to real directories) and run it. We could also consider shipping Gulp by default so the npm install step would be optional.
Currently a
git push production
does not trigger agulp
run. We can't just bluntly start doing so, since we don't know if a project uses SASS nor if thegulpfile.js
has been configured correctly.If those are set up correctly, this addition would run Gulp:
If we some more smarts here, maybe we could test if
gulpfile.json
is configured (=modified from default, points to real directories) and run it. We could also consider shipping Gulp by default so thenpm install
step would be optional.