#!/bin/sh

cp -Rf /tmp/src /sti-fake/
touch /sti-fake/assemble-invoked

if [ -f /tmp/secret ]; then
  grep -q secret /tmp/secret && touch /sti-fake/secret-delivered
fi

if [ -f /opt/app-root/src/secret ]; then
  grep -q secret /opt/app-root/src/secret && touch /sti-fake/relative-secret-delivered
fi

if [ -e /tmp/artifacts/save-artifacts-invoked ]; then
  touch /sti-fake/save-artifacts-invoked
fi

mkdir -p /tmp/.s2i/
cat > /tmp/.s2i/image_metadata.json << EOL
{
  "labels": [
    {"testLabel": "testLabel_value"}
  ]
}
EOL
