#!/bin/bash

set -eu

# If you build HEAD the pipeline.sh step, because it runs first, won't yet
# have the updated commit SHA. So we have to figure it out ourselves.
if [[ "${BUILDKITE_COMMIT:-HEAD}" == "HEAD" ]]; then
  commit=$(git show HEAD -s --pretty='%h')
else
  commit="${BUILDKITE_COMMIT}"
fi

# We have to use cat because pipeline.yml $ interpolation doesn't work in YAML
# keys, only values

cat <<YAML
steps:
  - label: run bats tests
    command: tests/
    plugins:
      ${BUILDKITE_REPO}#${commit}:
        run: tests

  - wait
  - label: check secrets are exposed correctly
    command: env
    plugins:
      ${BUILDKITE_REPO}#${commit}:
        s3_bucket: my_test_bucket
YAML
#!/bin/bash

set -eu

# If you build HEAD the pipeline.sh step, because it runs first, won't yet
# have the updated commit SHA. So we have to figure it out ourselves.
if [[ "${BUILDKITE_COMMIT:-HEAD}" == "HEAD" ]]; then
  commit=$(git show HEAD -s --pretty='%h')
else
  commit="${BUILDKITE_COMMIT}"
fi

# We have to use cat because pipeline.yml $ interpolation doesn't work in YAML
# keys, only values

cat <<YAML
steps:
  - label: run bats tests
    command: tests/
    plugins:
      docker-compose#v1.2.1
        run: tests

  - wait
  - label: check secrets are exposed correctly
    command: env
    plugins:
      ${BUILDKITE_REPO}#${commit}:
        s3_bucket: my_test_bucket
YAML
Use the docker-compose plugin to runs tests
Use the docker-compose plugin to runs tests
