Compare commits
32 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9b5aec1c96 | |||
| 8eae5f1a10 | |||
| 1cfe24037c | |||
| 8c8ea75d69 | |||
| 958dcab3fa | |||
| 797ad67b90 | |||
| 5f2ba688e9 | |||
| 9dcf1f829b | |||
| 5d64ae8732 | |||
| 2b2daa5117 | |||
| cf1b161794 | |||
| baf27b42bb | |||
| 6627a62853 | |||
| 348a9bbe73 | |||
| 20a1c062e3 | |||
| 7bef51f350 | |||
| a912d08482 | |||
| 4255c00ba0 | |||
| 3d8de18123 | |||
| 26203c617d | |||
| 5daef4f2d5 | |||
| 49a5c19f6c | |||
| 6668f65528 | |||
| 4e205e0eae | |||
| ebd04134bf | |||
| 89815ffe55 | |||
| 011287ba4f | |||
| ef784f00d8 | |||
| 9863bfdf7d | |||
| 3806c5c2cc | |||
| 35ff8bc862 | |||
| d3a695bde9 |
+86
-24
@@ -1,29 +1,91 @@
|
|||||||
name: ci
|
name: Docker Build and Push # Имя CI джобы
|
||||||
on:
|
|
||||||
|
on: # Выполняется если производится push в ветку main
|
||||||
push:
|
push:
|
||||||
branches:
|
branches: [ main ]
|
||||||
- master
|
|
||||||
- main
|
env: # Переменные окружения
|
||||||
permissions:
|
REGISTRY: gitea.trastinfo.ru
|
||||||
contents: write
|
IMAGE_NAME: sailor/mkdocs
|
||||||
jobs:
|
PLATFORMS: linux/amd64,linux/arm64
|
||||||
deploy:
|
|
||||||
|
jobs: # Список выполняемых джоб
|
||||||
|
need-build: # джоба проверки изменений в зависимостях. Если requirements.txt был изменен, то будет выполнена сборка и пуш образа
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
src_changed: ${{ steps.need-build.outputs.src }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: dorny/paths-filter@v2
|
||||||
|
id: need-build
|
||||||
|
with:
|
||||||
|
filters: |
|
||||||
|
src:
|
||||||
|
- 'requirements.txt'
|
||||||
|
|
||||||
|
need-deploy: # джоба проверки изменений в файлах. При изменении пулит новые файлы и перезапускает контейнер
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
src_changed: ${{ steps.need-deploy.outputs.src }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: dorny/paths-filter@v2
|
||||||
|
id: need-deploy
|
||||||
|
with:
|
||||||
|
filters: |
|
||||||
|
src:
|
||||||
|
- 'docs/*'
|
||||||
|
- 'mkdocs.yml'
|
||||||
|
|
||||||
|
|
||||||
|
build: # джоба сборки и пуша образа. Выполняется если проверка изменений показала что requirements.txt был изменен
|
||||||
|
needs: need-build
|
||||||
|
if: needs.need-build.outputs.src_changed == 'true'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- name: Login to Gitea Registry
|
||||||
- name: Configure Git Credentials
|
uses: docker/login-action@v3
|
||||||
run: |
|
|
||||||
git config user.name github-actions[bot]
|
|
||||||
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
|
|
||||||
- uses: actions/setup-python@v5
|
|
||||||
with:
|
with:
|
||||||
python-version: 3.x
|
registry: ${{ env.REGISTRY }}
|
||||||
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
|
username: ${{ secrets.REGISTRY_USERNAME }}
|
||||||
- uses: actions/cache@v4
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
||||||
|
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
key: mkdocs-material-${{ env.cache_id }}
|
ref: main
|
||||||
path: .cache
|
|
||||||
restore-keys: |
|
- name: Set up Docker Buildx
|
||||||
mkdocs-material-
|
uses: docker/setup-buildx-action@v3
|
||||||
- run: pip install -r requirements.txt
|
|
||||||
- run: mkdocs gh-deploy --force
|
- name: Build and push multi-arch image
|
||||||
|
uses: docker/build-push-action@v5
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: ./Dockerfile
|
||||||
|
push: true
|
||||||
|
tags: |
|
||||||
|
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
|
||||||
|
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}
|
||||||
|
cache-from: type=gha
|
||||||
|
cache-to: type=gha,mode=max
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: need-deploy
|
||||||
|
if: needs.need-deploy.outputs.src_changed == 'true'
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Deploy over SSH
|
||||||
|
uses: appleboy/ssh-action@v0.1.6
|
||||||
|
with:
|
||||||
|
host: ${{ secrets.HOST }}
|
||||||
|
username: ${{ secrets.USER }}
|
||||||
|
key: ${{ secrets.KEY }}
|
||||||
|
script: |
|
||||||
|
cd /home/ubadmin/mkdocs
|
||||||
|
git pull origin main
|
||||||
|
sudo docker compose down
|
||||||
|
sudo docker compose up -d --build
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
services:
|
||||||
|
mkdocks:
|
||||||
|
image: gitea.trastinfo.ru/sailor/mkdocs:latest
|
||||||
|
restart: always
|
||||||
|
volumes:
|
||||||
|
- ./mkdocs.yml:/mkdocs/mkdocs.yml
|
||||||
|
- ./docs:/mkdocs/docs
|
||||||
|
ports:
|
||||||
|
- "8000:8000"
|
||||||
+2
-3
@@ -1,4 +1,4 @@
|
|||||||
FROM docker.io/library/python:alpine
|
FROM gitea.trastinfo.ru/sailor/pyhton:0.1
|
||||||
WORKDIR /home/ubadmin/mkdocks
|
WORKDIR /home/ubadmin/mkdocks
|
||||||
COPY ./requirements.txt .
|
COPY ./requirements.txt .
|
||||||
RUN apk add --update --no-cache --virtual .build-deps gcc musl-dev &&\
|
RUN apk add --update --no-cache --virtual .build-deps gcc musl-dev &&\
|
||||||
@@ -6,7 +6,7 @@ RUN apk add --update --no-cache --virtual .build-deps gcc musl-dev &&\
|
|||||||
pip install --no-cache-dir --requirement ./requirements.txt &&\
|
pip install --no-cache-dir --requirement ./requirements.txt &&\
|
||||||
apk del .build-deps &&\
|
apk del .build-deps &&\
|
||||||
rm ./requirements.txt
|
rm ./requirements.txt
|
||||||
WORKDIR /d
|
WORKDIR /mkdocs
|
||||||
CMD ["mkdocs", "serve", "-a", "0.0.0.0:8000"]
|
CMD ["mkdocs", "serve", "-a", "0.0.0.0:8000"]
|
||||||
|
|
||||||
|
|
||||||
@@ -16,4 +16,3 @@ CMD ["mkdocs", "serve", "-a", "0.0.0.0:8000"]
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +0,0 @@
|
|||||||
# Планы для Sailor.lab
|
|
||||||
~~1) Развернуть vault~~
|
|
||||||
2) Выбрать систему мониторинга
|
|
||||||
3) Настроить бекапы
|
|
||||||
4) Установить ubuntu на старый комп
|
|
||||||
5) Подумать над переделкой шаблона as a service?
|
|
||||||
6) Добавить диск и маунт диска для логов
|
|
||||||
7) Настроить Vault
|
|
||||||
8) Сделать дашборд для веб панелей
|
|
||||||
9) Развернуть opensearch
|
|
||||||
@@ -1 +1,2 @@
|
|||||||
Стартовая страница
|
Стартовая страница
|
||||||
|
1
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
services:
|
||||||
|
mkdocks:
|
||||||
|
image: gitea.trastinfo.ru/sailor/mkdocs:latest
|
||||||
|
restart: always
|
||||||
|
volumes:
|
||||||
|
- ./mkdocs.yml:/mkdocs/mkdocs.yml
|
||||||
|
- ./docs:/mkdocs/docs
|
||||||
|
ports:
|
||||||
|
- "8000:8000"
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
@startuml
|
||||||
|
!theme bluegray
|
||||||
|
|
||||||
|
title Схема доступа к Vm через Proxy
|
||||||
|
|
||||||
|
node "Proxy" as proxy
|
||||||
|
|
||||||
|
node "Master-1" as m1
|
||||||
|
node "Master-2" as m2
|
||||||
|
node "Master-3" as m3
|
||||||
|
|
||||||
|
node "Worker-1" as w1
|
||||||
|
node "Worker-2" as w2
|
||||||
|
node "Worker-3" as w3
|
||||||
|
|
||||||
|
node "Docker" as d1
|
||||||
|
|
||||||
|
proxy -down-> m1
|
||||||
|
proxy -down-> m2
|
||||||
|
proxy -down-> m3
|
||||||
|
|
||||||
|
proxy -down-> w1
|
||||||
|
proxy -down-> w2
|
||||||
|
proxy -down-> w3
|
||||||
|
|
||||||
|
proxy -down-> d1
|
||||||
|
@enduml
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
@startuml
|
||||||
|
!theme bluegray
|
||||||
|
|
||||||
|
title Схема Кластера Кубера
|
||||||
|
|
||||||
|
node "Proxy" as proxy
|
||||||
|
|
||||||
|
node "Мастер-ноды" {
|
||||||
|
[Master-1]
|
||||||
|
[Master-2]
|
||||||
|
[Master-3]
|
||||||
|
}
|
||||||
|
|
||||||
|
node "Воркер-ноды" {
|
||||||
|
[Worker-1]
|
||||||
|
[Worker-2]
|
||||||
|
[Worker-3]
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
proxy --> [Master-1]
|
||||||
|
proxy --> [Master-2]
|
||||||
|
proxy --> [Master-3]
|
||||||
|
|
||||||
|
[Master-1] --> [Worker-1]
|
||||||
|
[Master-1] --> [Worker-2]
|
||||||
|
[Master-1] --> [Worker-3]
|
||||||
|
[Master-2] --> [Worker-1]
|
||||||
|
[Master-2] --> [Worker-2]
|
||||||
|
[Master-2] --> [Worker-3]
|
||||||
|
[Master-3] --> [Worker-1]
|
||||||
|
[Master-3] --> [Worker-2]
|
||||||
|
[Master-3] --> [Worker-3]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@enduml
|
||||||
@@ -22,8 +22,6 @@ theme:
|
|||||||
- navigation.instant
|
- navigation.instant
|
||||||
- navigation.instant.progress
|
- navigation.instant.progress
|
||||||
- navigation.sections
|
- navigation.sections
|
||||||
# - navigation.tabs
|
|
||||||
# - navigation.tabs.sticky
|
|
||||||
- navigation.path
|
- navigation.path
|
||||||
- navigation.top
|
- navigation.top
|
||||||
- navigation.prune
|
- navigation.prune
|
||||||
|
|||||||
Reference in New Issue
Block a user