#!/bin/bash
# See CONTRIBUTING.md for usage.

set -ex

TAG="docker-compose:$(git rev-parse --short HEAD)"

docker build -t "$TAG" .
docker run \
  --rm \
  --volume="/var/run/docker.sock:/var/run/docker.sock" \
  -e DOCKER_VERSIONS \
  -e "TAG=$TAG" \
  -e "affinity:image==$TAG" \
  --entrypoint="script/test-versions" \
  "$TAG" \
  "$@"
