chore(ci): purge legacy docker-compose and certbot scripts, update cloud-init user to adam (#42)
### Summary of Changes - **Legacy Cleanup**: - Deleted `ci/deploy/` (`docker-compose.yml`, `.env.template`, `nginx/`) - Deleted `ci/scripts/deploy-certbot.sh` - Deleted `ci/scripts/deploy-new-tags.sh` - **Cloud-Init Template Updates**: - Replaced username `debian` with `adam` - Removed deprecated `disable: - servicelb` - Cleaned up heredoc YAML formatting
This commit is contained in:
1 parent
3643eca3f7
commit
9e129ccfb8
8 files changed
+31
-301
No files matched your search
@@ -1,42 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# Usage: ./deploy-certbot.sh [domain1] [domain2] ...
|
||||
EMAIL="personal@ermnvldmr.com"
|
||||
CLOUDFLARE_INI="/etc/letsencrypt/cloudflare.ini"
|
||||
|
||||
# Collect domains from arguments, fallback to default if none provided
|
||||
if [ $# -eq 0 ]; then
|
||||
DOMAINS=("docs.ermnvldmr.com")
|
||||
else
|
||||
DOMAINS=("$@")
|
||||
fi
|
||||
|
||||
# Build domain arguments for certbot
|
||||
DOMAIN_ARGS=()
|
||||
for d in "${DOMAINS[@]}"; do
|
||||
DOMAIN_ARGS+=("-d" "$d")
|
||||
done
|
||||
|
||||
echo "Installing certbot and Cloudflare DNS plugin..."
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y certbot python3-certbot-cloudflare
|
||||
|
||||
if [ ! -f "$CLOUDFLARE_INI" ]; then
|
||||
echo "Error: Cloudflare credentials file not found at $CLOUDFLARE_INI"
|
||||
echo "Please ensure it exists and has 600 permissions."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Requesting certificate for ${DOMAINS[*]} via Cloudflare DNS challenge..."
|
||||
sudo certbot certonly \
|
||||
--dns-cloudflare \
|
||||
--dns-cloudflare-credentials "$CLOUDFLARE_INI" \
|
||||
"${DOMAIN_ARGS[@]}" \
|
||||
--email "$EMAIL" \
|
||||
--agree-tos \
|
||||
--no-eff-email \
|
||||
--non-interactive
|
||||
|
||||
echo "Certificates for ${DOMAINS[*]} have been processed."
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# Setup paths relative to the script location
|
||||
DEPLOY_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../deploy" && pwd)"
|
||||
ENV_FILE="$DEPLOY_DIR/.env"
|
||||
TEMPLATE_FILE="$DEPLOY_DIR/.env.template"
|
||||
|
||||
echo "Starting deployment for com-ermnvldmr..."
|
||||
|
||||
# 1. Load existing .env values as defaults (do NOT overwrite environment variables)
|
||||
if [ -f "$ENV_FILE" ]; then
|
||||
while IFS= read -r line || [ -n "$line" ]; do
|
||||
# Skip comments and empty lines
|
||||
[[ "$line" =~ ^# ]] || [[ -z "$line" ]] && continue
|
||||
|
||||
key="${line%%=*}"
|
||||
val="${line#*=}"
|
||||
|
||||
# Only export if the variable is not already set in the environment
|
||||
if [ -z "${!key}" ]; then
|
||||
export "$key"="$val"
|
||||
fi
|
||||
done < "$ENV_FILE"
|
||||
fi
|
||||
|
||||
# 2. Apply final fallback defaults
|
||||
export DOCS_TAG="${DOCS_TAG:-latest}"
|
||||
export WWW_TAG="${WWW_TAG:-latest}"
|
||||
|
||||
# 3. Generate the .env file from template
|
||||
# Explicitly list variables to substitute to avoid messing with other values
|
||||
echo "Generating .env from template..."
|
||||
envsubst '$DOCS_TAG $WWW_TAG' < "$TEMPLATE_FILE" > "$ENV_FILE"
|
||||
|
||||
# 4. Run Docker operations
|
||||
cd "$DEPLOY_DIR"
|
||||
echo "Pulling images..."
|
||||
docker compose pull
|
||||
|
||||
echo "Starting containers..."
|
||||
docker compose up -d --remove-orphans
|
||||
|
||||
echo "Pruning unused images..."
|
||||
docker image prune -f
|
||||
|
||||
echo "Deployment complete."
|
||||
Reference in new issue
Block a user