#!/usr/bin/env bash

CURRENT_DIR=$(dirname "$0")
source "${CURRENT_DIR}/build.docker.env.sh"
source "${CURRENT_DIR}/start.docker.compose.env.sh"
echo "updating image version to ${VERSION} in compose file ${COMPOSE_FILE}"
#export TAG=docker.rschneider.hu/infra/yogastic:$VERSION

case $(uname) in
  "Darwin")
  echo "Detected macOS"
  sed -i'' -e "s/docker.rschneider.hu\\/infra\\/yogastic:.*/docker.rschneider.hu\\/infra\\/yogastic:$VERSION/g" $COMPOSE_FILE
  ;;
  *)
  sed -i "s/docker.rschneider.hu\\/infra\\/yogastic:.*/docker.rschneider.hu\\/infra\\/yogastic:$VERSION/g" $COMPOSE_FILE
#sed -i "s/docker.rschneider.hu\\/infra\\/yogastic:.*/docker.rschneider.hu\\/infra\\/yogastic:$VERSION/g" $COMPOSE_FILE
  ;;
esac
