Skip to content

Support repository-less builds #233

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
toolmantim opened this issue Jan 18, 2016 · 6 comments
Closed

Support repository-less builds #233

toolmantim opened this issue Jan 18, 2016 · 6 comments

Comments

@toolmantim
Copy link
Contributor

In some you just want to run a pipeline that executes a script on a machine… there's actually no repository attached.

One way to support this, without any changes to the web UI, would be to allow people to export BUILDKITE_REPO="" in a pre-checkout hook. In this case the build would just mkdir -p $BUILDKITE_PROJECT_SLUG; cd $BUILDKITE_PROJECT_SLUG, so the build directory is the same as the checked out ones (builds/my-org/my-builds)

@toolmantim
Copy link
Contributor Author

To do this now you can create an agent with a customized checkout hook that simply has:

#!/bin/bash

echo "--- Skipping code checkout"

and with meta-data no-checkout=true. Then you can target this in a pipeline, and it'll ignore whatever was set as the repository URL (which could just be "skip")

@solemnwarning
Copy link

I would also find this useful.

I have a pipeline that has a build step which uploads the build as an artefact for multiple test steps (different environments) to run. Having to check out doesn't break anything, but it is unnecessary and does mean poking another hole in the sandbox so the test host(s) can reach Github.

@lox lox added the enhancement label Nov 4, 2017
@keithpitt keithpitt added this to the v4.0.0 milestone Mar 13, 2018
@keithpitt
Copy link
Contributor

Just slated this for a 4.0 release, gotta have it!

@dch
Copy link
Contributor

dch commented Mar 20, 2018

As an example, I have an ansible task that runs in a different repo (the ansible one) after each successful commit/tests on the active projects.

Currently I do a little hack:

  - command: |
      cd /home/buildkite/src/ansible
      buildkite-agent artifact download "_build/w*.txz" pkg/
      make app

which works, but unfortunately triggers another source code checkout. Having metadata no-checkout=true set at the agent level stops this working, as then the ansible repo never gets updated.

Ideally repository-less pipeline steps could co-exist in the same build agent config as git-triggered builds, which @toolmantim 's hack would block, I think. Is there an alternative arrangement?

@reidab
Copy link

reidab commented May 2, 2018

I ran into something similar today where some steps needed to run scripts on a mounted volume without needing a checkout.

Instead of running a separate no-checkout agent, I threw together a quick plugin that wraps up a no-op checkout hook with an optional post-checkout hook to set BUILDKITE_BUILD_CHECKOUT_PATH to chosen directory.

🎉 https://github.com/thedyrt/skip-checkout-buildkite-plugin

@lox
Copy link
Contributor

lox commented Feb 18, 2019

Implemented in #909.

@lox lox closed this as completed Feb 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants