#!/bin/bash

set +x
set -e

function finish {
  docker-compose -f docker-compose.builder.yml down --volumes
}
trap finish EXIT

sudo rm -f .env
cp $ENV_FILE .env

docker-compose -f docker-compose.builder.yml run -e BUILD_NUMBER=$BUILD_NUMBER -e GIT_BRANCH=$GIT_BRANCH builder
docker-compose -f docker-compose.builder.yml build image
docker-compose -f docker-compose.builder.yml down --volumes
docker tag openlmis/referencedata:latest openlmis/referencedata:$STAGING_VERSION
docker push openlmis/referencedata:$STAGING_VERSION


#!/bin/bash

set +x
set -e

function finish {
  docker-compose -f docker-compose.builder.yml down --volumes
}
trap finish EXIT

sudo rm -f .env
cp $ENV_FILE .env
if [ "$GIT_BRANCH" != "master" ]; then
    sed -i '' -e "s#^TRANSIFEX_PUSH=.*#TRANSIFEX_PUSH=false#" .env  2>/dev/null || true
fi

docker-compose -f docker-compose.builder.yml run -e BUILD_NUMBER=$BUILD_NUMBER -e GIT_BRANCH=$GIT_BRANCH builder
docker-compose -f docker-compose.builder.yml build image
docker-compose -f docker-compose.builder.yml down --volumes
docker tag openlmis/referencedata:latest openlmis/referencedata:$STAGING_VERSION
docker push openlmis/referencedata:$STAGING_VERSION


Disable Transifex push for branches other than master
OLMIS-4795: Disable Transifex push for branches other than master
