1
0

Добавил Gitea для хранения кода

This commit is contained in:
2023-06-19 11:54:05 +03:00
parent 20739ccc24
commit c9c58a6c43
6 changed files with 76 additions and 0 deletions

3
app/gitea/.env Normal file
View File

@ -0,0 +1,3 @@
WEB_SERVER_PORT=9494
USER_UID=1000
USER_GID=1000

1
app/gitea/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
data/

View File

@ -0,0 +1,16 @@
version: "3"
services:
server:
image: gitea/gitea:1.19.3
environment:
- "USER_UID=${USER_UID}"
- "USER_GID=${USER_GID}"
restart: unless-stopped
volumes:
- ./data:/data
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
ports:
- "${WEB_SERVER_PORT}:3000"

20
app/gitea/tasks.py Normal file
View File

@ -0,0 +1,20 @@
from fabric import Connection
from invoke import task
import shlex
APP_NAME = "gitea"
SSH_HOST = f"{APP_NAME}@51.250.85.23"
DOCKER_REGISTRY = "cr.yandex/crplfk0168i4o8kd7ade"
@task
def deploy(c):
print("Ready to setup remote host")
with Connection(SSH_HOST) as c:
c.put(
local="docker-compose.yml",
remote=f"/home/{APP_NAME}/docker-compose.yml",
)
c.run("cp .env .env.prod")
c.run("mkdir -p data")
c.run(f"docker-compose --project-name {shlex.quote(APP_NAME)} --env-file=.env.prod up --detach --remove-orphans")