2023-01-05 01:15:12 +03:00
#!/bin/sh
set -e
# Development container builder
#
# Must authenticate first: https://docs.github.com/en/packages/using-github-packages-with-your-projects-ecosystem/configuring-docker-for-use-with-github-packages#authenticating-to-github-packages
2023-01-20 21:47:20 +03:00
# env vars:
2023-01-05 01:15:12 +03:00
# $EARTHLY_BUILD_BRANCH: git branch to checkout
# $EARTHLY_BUILD_TAG: tag for container image
EARTHLY_IMAGE_NAME = "owncast"
2023-01-28 03:18:02 +03:00
BUILD_TAG = ${ EARTHLY_BUILD_TAG :- develop }
2023-01-05 01:15:12 +03:00
DATE = $( date +"%Y%m%d" )
VERSION = " ${ DATE } - ${ BUILD_TAG } "
echo " Building container image ${ EARTHLY_IMAGE_NAME } : ${ BUILD_TAG } ... "
# Change to the root directory of the repository
cd " $( git rev-parse --show-toplevel) " || exit
if [ -n " ${ EARTHLY_BUILD_BRANCH } " ] ; then
2023-01-20 21:47:20 +03:00
git checkout " ${ EARTHLY_BUILD_BRANCH } " || exit
2023-01-05 01:15:12 +03:00
fi
2023-01-20 21:47:20 +03:00
earthly --ci +docker-all --images= " ghcr.io/owncast/ ${ EARTHLY_IMAGE_NAME } : ${ BUILD_TAG } " --version= " ${ VERSION } "