How to skip git clone step

I want to skip the git clone step at the beginning.
I used buildkite agent on embedded linux system(armeabi) without bash and git support(only with unix shell).
I had already tried the pre-checkout hook and the plugin from the article : How do I skip the "Preparing Working Directory" step?.
But without bash support, the pre-checkout hook will not work, and generate the error message:

Error: Error running /bin/bash -c /tmp/buildkite-agent-bootstrap-hook-runner-497379975: fork/exec /bin/bash: no such file or directory

Our test binary will be sended by the scp. Is there any other way to skip the git clone step at the beginning?

Welcome! Hrmm it’s a good question. I think you should be able to achieve what you want by implementing the checkout hook, which will skip the git checkout (and also creating the build directory)?

We actually made a simple plugin for this purpose (uber-workflow/run-without-clone), but you can also use an agent checkout hook if you don’t want to add a plugin to every pipeline step

Thanks for @anon46008679 and @deacy. After implement the checkout hook. There still have error from bash. So I modified the buildkite agent from /bin/bash to /bin/sh(The buildkite use the /bin/bash as default, and cannot be change by the BUILDKITE_SHELL). Now it works well. The hooks can be run inside /bin/sh and the git clone step would be skipped.

The patch can be seen at https://github.com/splasky/agent/commit/296176a6536b1586ce79559ba9d698c6c9a98a44

Hey @Hao-Yen! That’s odd, the BUILDKITE_SHELL environment variable should work for changing the default shell command and flags of the agent – if it doesn’t you might have discovered a bug? Let me know if you have any other questions about this one. :smile: