#!/bin/bash -e

# To ensure this script always executes relative to the repo root
cd "$(dirname "$0")/.."

if [ ! "${SKIP_VALIDATION}" == "true" ]; then
  echo "Running validations..."
  docker run --rm \
    -v $PWD:/root \
    -w /root \
    puppet/pdk validate control-repo,metadata,puppet,ruby,yaml
fi

echo "Running specs..."
mkdir -p ./spec/output
docker run --rm \
  -v $PWD:/root \
  -w /root \
  puppet/pdk test unit --format=junit:./spec/output/rspec.xml --format=text
echo "Tests complete!"

#!/bin/bash -e

# To ensure this script always executes relative to the repo root
cd "$(dirname "$0")/.."

docker build -t puppet-pdk -f ./ci/Dockerfile.pdk .

if [ ! "${SKIP_VALIDATION}" == "true" ]; then
  echo "Running validations..."
  docker run --rm \
    -v $PWD:/root \
    -w /root \
    puppet-pdk \
    bash -ec "
      pdk validate control-repo,metadata,puppet,ruby,yaml
    "
fi

echo "Running specs..."
mkdir -p ./spec/output
docker run --rm \
  -v $PWD:/root \
  -w /root \
  puppet-pdk \
  bash -ec "
    pdk test unit --format=junit:./spec/output/rspec.xml --format=text
  "

echo "Tests complete!"

Add workaround for broken upstream PDK image
Add workaround for broken upstream PDK image

This workaround for cyberark/conjur-puppet/issues/246 ensures
e our own PDK image since PDK image breaks on the first run
while not affecting the subsequent runs.
