Adding dependency for Taskfile

My static site uses Taskfile.dev to build. This is not currently installed on any of Netlify’s images, as far as I can tell. The sole dependency is a single Go binary that has no other dependencies and is otherwise self-contained. Since it is not present, the build fails when it tries to invoke the expected default command:

11:57:31 PM: ────────────────────────────────────────────────────────────────
11:57:31 PM:   1. Build command from Netlify app                             
11:57:31 PM: ────────────────────────────────────────────────────────────────
11:57:31 PM: ​
11:57:31 PM: $ task build
11:57:31 PM: bash: task: command not found
11:57:31 PM: ​
11:57:31 PM: ────────────────────────────────────────────────────────────────
11:57:31 PM:   "build.command" failed                                        
11:57:31 PM: ────────────────────────────────────────────────────────────────
11:57:31 PM: ​
11:57:31 PM:   Error message
11:57:31 PM:   Command failed with exit code 127: task build (https://ntl.fyi/exit-code-127)
11:57:31 PM: ​
11:57:31 PM:   Error location
11:57:31 PM:   In Build command from Netlify app:
11:57:31 PM:   task build

Is there a way to add this binary to a build environment?

If there isn’t a way to add the binary to the build environment, would doing something like the following work?

  • Have the build command be, say, sh deploy.sh.
  • Have deploy.sh download the task binary.
  • Invoke task build using the newly downloaded task binary.

Would be delighted to hear any and all feedback on the feasibility of this.

Update: I tried the proposed approach I laid out above, and it worked as expected.

1 Like