#!/bin/bash
set -ue

: "${DOCKER_TAG:=ftl-sdk}"

echo "> docker create $DOCKER_TAG"
CONTAINER_ID=$(docker create "$DOCKER_TAG")

rm -rf publish

echo "> docker cp ${CONTAINER_ID}:/opt/ftl-sdk/publish ."
docker cp "${CONTAINER_ID}:/opt/ftl-sdk/publish" .

echo "> docker rm $CONTAINER_ID"
docker rm "$CONTAINER_ID"

echo '> tar czvpf publish.tar.gz publish'
tar czvpf publish.tar.gz publish

