Initial dev deployment [infra]
This commit is contained in:
@@ -9,6 +9,7 @@ REPO_ROOT="$(cd "$(dirname "$0")/../../.." && pwd)"
|
||||
cd "${REPO_ROOT}"
|
||||
|
||||
sh ci/scripts/common/ensure_env_version.sh
|
||||
. ci/scripts/common/runtime_env.sh
|
||||
|
||||
normalize_env_file() {
|
||||
file="$1"
|
||||
@@ -32,19 +33,10 @@ load_env_file() {
|
||||
done <"$file"
|
||||
}
|
||||
|
||||
MNTX_GATEWAY_ENV_NAME="${MNTX_GATEWAY_ENV:-prod}"
|
||||
RUNTIME_ENV_FILE="./ci/${MNTX_GATEWAY_ENV_NAME}/.env.runtime"
|
||||
MNTX_GATEWAY_ENV_NAME="${MNTX_GATEWAY_ENV:-$(resolve_runtime_env_name)}"
|
||||
load_runtime_env_bundle "${MNTX_GATEWAY_ENV_NAME}"
|
||||
|
||||
if [ ! -f "${RUNTIME_ENV_FILE}" ]; then
|
||||
echo "[mntx-gateway-build] runtime env file not found: ${RUNTIME_ENV_FILE}" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
normalize_env_file "${RUNTIME_ENV_FILE}"
|
||||
normalize_env_file ./.env.version
|
||||
|
||||
load_env_file "${RUNTIME_ENV_FILE}"
|
||||
load_env_file ./.env.version
|
||||
IMAGE_TAG="$(compute_image_tag)"
|
||||
|
||||
REGISTRY_URL="${REGISTRY_URL:?missing REGISTRY_URL}"
|
||||
APP_V="${APP_V:?missing APP_V}"
|
||||
@@ -93,7 +85,7 @@ fi
|
||||
/kaniko/executor \
|
||||
--context "${BUILD_CONTEXT}" \
|
||||
--dockerfile "${MNTX_GATEWAY_DOCKERFILE}" \
|
||||
--destination "${REGISTRY_URL}/${MNTX_GATEWAY_IMAGE_PATH}:${APP_V}" \
|
||||
--destination "${REGISTRY_URL}/${MNTX_GATEWAY_IMAGE_PATH}:${IMAGE_TAG}" \
|
||||
--build-arg APP_VERSION="${APP_V}" \
|
||||
--build-arg GIT_REV="${GIT_REV}" \
|
||||
--build-arg BUILD_BRANCH="${BUILD_BRANCH}" \
|
||||
|
||||
@@ -32,24 +32,14 @@ load_env_file() {
|
||||
|
||||
. ci/scripts/common/nats_env.sh
|
||||
|
||||
MNTX_GATEWAY_ENV_NAME="${MNTX_GATEWAY_ENV:-prod}"
|
||||
RUNTIME_ENV_FILE="./ci/${MNTX_GATEWAY_ENV_NAME}/.env.runtime"
|
||||
MNTX_GATEWAY_ENV_NAME="${MNTX_GATEWAY_ENV:-$(resolve_runtime_env_name)}"
|
||||
load_runtime_env_bundle "${MNTX_GATEWAY_ENV_NAME}"
|
||||
|
||||
if [ ! -f "${RUNTIME_ENV_FILE}" ]; then
|
||||
echo "[mntx-gateway-deploy] runtime env file not found: ${RUNTIME_ENV_FILE}" >&2
|
||||
exit 1
|
||||
fi
|
||||
if [ ! -f ./.env.version ]; then
|
||||
echo "[mntx-gateway-deploy] .env.version is missing; run version step first" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
normalize_env_file "${RUNTIME_ENV_FILE}"
|
||||
normalize_env_file ./.env.version
|
||||
|
||||
load_env_file "${RUNTIME_ENV_FILE}"
|
||||
load_env_file ./.env.version
|
||||
|
||||
MNTX_GATEWAY_MONGO_SECRET_PATH="${MNTX_GATEWAY_MONGO_SECRET_PATH:?missing MNTX_GATEWAY_MONGO_SECRET_PATH}"
|
||||
MNTX_GATEWAY_MONETIX_SECRET_PATH="${MNTX_GATEWAY_MONETIX_SECRET_PATH:-sendico/gateway/monetix}"
|
||||
MNTX_GATEWAY_NATS_SECRET_PATH="${MNTX_GATEWAY_NATS_SECRET_PATH:-sendico/nats}"
|
||||
|
||||
Reference in New Issue
Block a user