#!/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 login happens correctly
    command: grep 005820773040 ~/.docker/config.json
    plugins:
      ${BUILDKITE_REPO}#${commit}:
        login: "true"
        account-ids: 005820773040
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 login happens correctly
    command: cat ~/.docker/config.json
    plugins:
      ${BUILDKITE_REPO}#${commit}:
        login: "true"
YAML
--- 
+++ 
@@ -23,8 +23,9 @@
 
   - wait
   - label: check login happens correctly
-    command: cat ~/.docker/config.json
+    command: grep 005820773040 ~/.docker/config.json
     plugins:
       ${BUILDKITE_REPO}#${commit}:
         login: "true"
+        account-ids: 005820773040
 YAML
Add a test for the aws account
