When I add this build command to my local netlify.toml:
[dev]
command = “make all” # Command to start your dev server
I get an error, after the build process (which builds what’s needed, though it had nothing to build this time):
netlify dev
◈ Netlify Dev ◈
◈ Injecting environment variable values for all scopes
◈ Ignored general context env var: LANG (defined in process)
◈ No app server detected. Using simple static server
◈ Running static server from "badmintondoubles.com/public"
◈ Setting up local development server
make[1]: Entering directory '/home/s6mike/git_projects/badmintondoubles.com'
make public
make[2]: Entering directory '/home/s6mike/git_projects/badmintondoubles.com'
◈ Static server listening to 3999
make[2]: Nothing to be done for 'public'.
make[2]: Leaving directory '/home/s6mike/git_projects/badmintondoubles.com'
make[1]: Leaving directory '/home/s6mike/git_projects/badmintondoubles.com'
◈ "make all" exited with code 0. Shutting down Netlify Dev server
make: *** [makefile:29: dev] Error 1
The same build command works fine when I deploy everything to netlify online, this has to build everything so this screenshot only shows the end of the build process:
I’ve tried added the make flag which hides the ‘leaving directory’ messages (in netlify.toml), but this didn’t fix the issue.
My full netlify.toml:
[[redirects]]
from = "/badmintondoubles.com/*"
to = "/:splat"
[[redirects]]
from = "/wp-content/uploads/complianz/css*"
to = "/wp-content/plugins/complianz-gdpr/assets/css/:splat"
status = 302 # 200 rewrite?
[build]
publish = "public/" # The path to your static content folder
command = "make all" # Command to start your dev server
[dev]
command = "make all" # Command to start your dev server autoLaunch = false # a Boolean value that determines if Netlify Dev launches the local server address in your browser
publish = "public/" # The path to your static content folder
I’m assuming my makefile content is not relevant since it runs successfully on dev, but I can provide that if desired.
Heya @s6mike - thanks for being so thorough in your report!
I had the long below written up but it seems like maybe you’ve fixed things in the meantime? I see a few successes, and befoer that the last build as failing - Netlify App due to the lighthouse plugin instead of anything to do with Make AFAICT).
I am not a Makefile expert (nobody on our Support team is, though I suppose I’ve probably used it more than anyone else since I am a longtime unix user), but if I am reading your file correctly, make all just does this, right?
I wonder if that command is failing? Maybe you could turn it into a shell script instead so we can debug it more easily - specifically by using set -x:
#!/bin/sh
set -x
<do that thing>
(I am not clear if foreach is a make primitive, since last time I used it it was in csh which is AFAICT not even installed in our build image, so you may have to do something more like:
for i in files/* ; do sed -is/${CONTENT_DIR}\//${PUBLIC_DIR})\//g ; done
…or something like that (I didn’t try that out, but I think you can see what I’ve done)
The reason I suggest this is that it seems like your Make command is exiting with status code 1 and I am trying to understand what could be causing that.