Files
coredns-web-ui/deploy.sh
T
bryanpedini 7089a6f408 build: add makefile, dockerfile, ci and development stack
- build: add makefile, dockerfile, ci and development stack
- feat(config): add environment configuration and logger
- feat(server): add server lifecycle with health and version routes
- feat(db): add connection, contract check, migrations and stores
- feat(cli): add command dispatch and user management
- test(db): add integration tests against mysql
2026-11-19 15:46:12 +01:00

36 lines
931 B
Bash
Executable File

#!/usr/bin/env bash
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2026 Bryan Joshua Pedini
ENVIRONMENTS=($DEPLOYMENT_PATHS)
if [ -z "${DEPLOYMENT_PATH}" ]; then
if [ "${#ENVIRONMENTS[@]}" -gt 1 ]; then
for i in "${!ENVIRONMENTS[@]}"; do
echo "$i: ${ENVIRONMENTS[$i]}"
done
read -p "Deployment environment: " DEPLOYMENT_ENVIRONMENT
fi
if [ -z "${DEPLOYMENT_ENVIRONMENT}" ]; then
DEPLOYMENT_ENVIRONMENT=0
fi
DEPLOYMENT_PATH="${ENVIRONMENTS[$DEPLOYMENT_ENVIRONMENT]}"
fi
if [ -z "${DEPLOYMENT_VERSION}" ]; then
read -p "Version [latest]: " DEPLOYMENT_VERSION
if [ -z "${DEPLOYMENT_VERSION}" ]; then
DEPLOYMENT_VERSION=latest
fi
fi
echo "${DEPLOYMENT_PATH}"
echo "${DEPLOYMENT_VERSION}"
ssh "$DEPLOYMENT_HOST" \
"cd ${DEPLOYMENT_PATH} && \
git pull && \
sed -i 's/VERSION=.*/VERSION=${DEPLOYMENT_VERSION}/' .env && \
docker compose pull && \
docker compose up -d"