feat(deploy): SSH deploy hook, Dockerfile includes scripts/docs
This commit is contained in:
@@ -59,10 +59,17 @@ git push origin $NEW_TAG
|
|||||||
|
|
||||||
### 3. Deploy
|
### 3. Deploy
|
||||||
```bash
|
```bash
|
||||||
cd /repos/enduro-trails
|
# Deploy через SSH на хост (orchestrator имеет SSH ключ)
|
||||||
git fetch origin && git checkout main && git pull origin main
|
DEPLOY_USER=${DEPLOY_SSH_USER:-slin}
|
||||||
# Deploy зависит от проекта. Для enduro-trails:
|
DEPLOY_HOST=${DEPLOY_SSH_HOST:-127.0.0.1}
|
||||||
# Файлы уже на месте после merge в main, nginx обслуживает static
|
HOOK=${DEPLOY_HOOK_SCRIPT:-/home/slin/bin/enduro-deploy-hook.sh}
|
||||||
|
|
||||||
|
ssh -o StrictHostKeyChecking=no -o ConnectTimeout=10 ${DEPLOY_USER}@${DEPLOY_HOST} "bash ${HOOK}"
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo "ERROR: Deploy hook failed"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "Deploy OK"
|
||||||
```
|
```
|
||||||
|
|
||||||
### 4. Healthcheck (до 60 сек)
|
### 4. Healthcheck (до 60 сек)
|
||||||
|
|||||||
@@ -4,6 +4,9 @@ COPY src/api/requirements.txt .
|
|||||||
RUN pip install --no-cache-dir -r requirements.txt
|
RUN pip install --no-cache-dir -r requirements.txt
|
||||||
COPY src/api/ ./src/api/
|
COPY src/api/ ./src/api/
|
||||||
COPY src/web/ ./src/web/
|
COPY src/web/ ./src/web/
|
||||||
|
COPY scripts/ ./scripts/
|
||||||
|
COPY migrations/ ./migrations/
|
||||||
|
COPY docs/ ./docs/
|
||||||
ENV STATIC_DIR=/app/src/web
|
ENV STATIC_DIR=/app/src/web
|
||||||
ENV PORT=5556
|
ENV PORT=5556
|
||||||
EXPOSE 5556
|
EXPOSE 5556
|
||||||
|
|||||||
Reference in New Issue
Block a user