diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 00000000..563cafed --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,33 @@ +image: node:26 + +stages: + - test + - build + +cache: + paths: + - node_modules/ + +before_script: + - corepack enable + - pnpm install --frozen-lockfile + +lint: + stage: test + script: + - pnpm run lint + +typecheck: + stage: test + script: + - pnpm run typecheck + +test: + stage: test + script: + - pnpm run test + +build: + stage: build + script: + - pnpm run build diff --git a/deploy.sh b/deploy.sh index 7bdad1e8..66714c1c 100755 --- a/deploy.sh +++ b/deploy.sh @@ -18,6 +18,12 @@ echo "Stopping containers..." docker compose down echo "Starting deployment..." -docker compose up -d --build +if docker compose up -d --build; then + ./scripts/alert.sh "Deployment successful for EpicNext-Cms" + echo "--- Deployment successful ---" +else + ./scripts/alert.sh "Deployment FAILED for EpicNext-Cms" + echo "--- Deployment FAILED ---" + exit 1 +fi -echo "--- Deployment initiated ---" diff --git a/scripts/logrotate.conf b/scripts/logrotate.conf new file mode 100644 index 00000000..e75f8a2c --- /dev/null +++ b/scripts/logrotate.conf @@ -0,0 +1,7 @@ +/var/www/atom-nexst/logs/*.log /var/www/atom-nexst/*.log { + daily + rotate 7 + compress + missingok + notifempty +} diff --git a/scripts/setup-logrotate.sh b/scripts/setup-logrotate.sh new file mode 100755 index 00000000..acef0a69 --- /dev/null +++ b/scripts/setup-logrotate.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash +# Setup log rotation +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +CONFIG_FILE="$SCRIPT_DIR/logrotate.conf" + +echo "To apply log rotation, run:" +echo "sudo cp $CONFIG_FILE /etc/logrotate.d/epicnext-cms"