Skip to content

Commit

Permalink
Merge pull request #21 from calendly/add-precommand-hook
Browse files Browse the repository at this point in the history
Add precommand hook/parameter
  • Loading branch information
echoboomer authored Oct 8, 2020
2 parents c9ab44c + a251f32 commit bcb8a8d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
14 changes: 14 additions & 0 deletions hooks/pre-command
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

# if a pre-command has been specified, run it now
PRECOMMAND=${BUILDKITE_PLUGIN_TERRAFORM_PRECOMMAND:-false}

if [ "$PRECOMMAND" != "false" ]; then
if [ -f "$PRECOMMAND" ]; then
# if it's a file, then just source it
source $PRECOMMAND
else
# otherwise, attempt to execute it directly
eval $PRECOMMAND
fi
fi
2 changes: 2 additions & 0 deletions plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,5 @@ configuration:
type: string
workspace:
type: string
precommand:
type: string

0 comments on commit bcb8a8d

Please sign in to comment.