#!/usr/bin/env bash

#
#	MetaCall Build Bash Script by Parra Studios
#	Build and install bash script utility for MetaCall.
#
#	Copyright (C) 2016 - 2021 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>
#
#	Licensed under the Apache License, Version 2.0 (the "License");
#	you may not use this file except in compliance with the License.
#	You may obtain a copy of the License at
#
#		http://www.apache.org/licenses/LICENSE-2.0
#
#	Unless required by applicable law or agreed to in writing, software
#	distributed under the License is distributed on an "AS IS" BASIS,
#	WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#	See the License for the specific language governing permissions and
#	limitations under the License.
#

# Show message
echo "[***] Push hook running"
echo "[***]  - Tagging and pushing $DOCKER_REPO:{deps, dev, runtime, cli, latest}"

# Tag the deps image and push it
docker tag metacall/core:deps $DOCKER_REPO:deps
docker push $DOCKER_REPO:deps

# Tag the dev image and push it
docker tag metacall/core:dev $DOCKER_REPO:dev
docker push $DOCKER_REPO:dev

# Tag the runtime image and push it
docker tag metacall/core:runtime $DOCKER_REPO:runtime
docker push $DOCKER_REPO:runtime

# Tag the cli image and push it
docker tag metacall/core:cli $DOCKER_REPO:cli
docker push $DOCKER_REPO:cli

# Tag the latest image and push it (alias for cli)
docker tag metacall/core:cli $DOCKER_REPO:latest
docker push $DOCKER_REPO:latest
