Skip to content

Commit

Permalink
Merge pull request #202 from buildkite-plugins/add-skip-checkout-option
Browse files Browse the repository at this point in the history
Add skip checkout option
  • Loading branch information
lox committed Feb 24, 2019
2 parents b96db48 + f0ebdf1 commit 39cdabc
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,10 @@ Set the shell to use for the command. Set it to `false` to pass the command dire

Example: `[ "powershell", "-Command" ]`

### `skip-checkout` (optional, run only)

Whether to skip the repository checkout phase. This is useful for steps that use a pre-built image. This will fail if there is no pre-built image.

### `workdir` (optional, run only)

Specify the container working directory via `docker-compose run --workdir`.
Expand Down
15 changes: 15 additions & 0 deletions hooks/pre-checkout
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash
set -ueo pipefail

DIR="$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)"

# shellcheck source=lib/shared.bash
. "$DIR/../lib/shared.bash"
# shellcheck source=lib/metadata.bash
. "$DIR/../lib/metadata.bash"

# skip checkout if skip-checkout is set
if [[ "$(plugin_read_config SKIP_CHECKOUT "false")" == "true" ]] ; then
export BUILDKITE_REPO=""
export BUILDKITE_PLUGIN_DOCKER_COMPOSE_REQUIRE_PREBUILD="true"
fi
2 changes: 2 additions & 0 deletions plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ configuration:
minimum: 1
command:
type: array
skip-checkout:
type: boolean
leave-volumes:
type: boolean
no-cache:
Expand Down

0 comments on commit 39cdabc

Please sign in to comment.