File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -180,6 +180,26 @@ jobs:
180180 test -f deploy_bundle/monitoring/loki-config.yml
181181 test -f deploy_bundle/monitoring/promtail-config.yml
182182
183+ - name : Pre-clean monitoring paths on server
184+ 185+ with :
186+ host : ${{ secrets.SSH_HOST }}
187+ username : ${{ secrets.SSH_USER }}
188+ key : ${{ secrets.SSH_PRIVATE_KEY }}
189+ port : ${{ secrets.SSH_PORT }}
190+ script : |
191+ set -euo pipefail
192+ DEPLOY_DIR='${{ steps.targetdir.outputs.DEPLOY_DIR_FINAL }}'
193+ mkdir -p "$DEPLOY_DIR/monitoring/grafana/provisioning"
194+
195+ # Nếu lỡ có THƯ MỤC trùng tên file, xóa đi
196+ for f in prometheus.yml loki-config.yml promtail-config.yml; do
197+ if [ -d "$DEPLOY_DIR/monitoring/$f" ]; then
198+ echo "Found directory at $DEPLOY_DIR/monitoring/$f -> removing"
199+ rm -rf "$DEPLOY_DIR/monitoring/$f"
200+ fi
201+ done
202+
183203 - name : Upload bundle to server
184204185205 with :
You can’t perform that action at this time.
0 commit comments