This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -24,4 +24,5 @@ hint.py
|
||||
*.env
|
||||
#db
|
||||
*.db
|
||||
versions/
|
||||
versions/
|
||||
data/
|
||||
23
ansible/deploy.yml
Normal file
23
ansible/deploy.yml
Normal file
@@ -0,0 +1,23 @@
|
||||
- hosts: servers
|
||||
become: yes
|
||||
tasks:
|
||||
- name: Install Docker
|
||||
shell: curl -fsSL https://get.docker.com | sh
|
||||
args:
|
||||
creates: /usr/bin/docker
|
||||
|
||||
- name: Install git
|
||||
apt:
|
||||
name: git
|
||||
state: present
|
||||
update_cache: yes
|
||||
|
||||
- name: Clone repo
|
||||
git:
|
||||
repo: ${GITEA_INSTANCE_URL} //как то передавать переменные
|
||||
dest: /opt/infra
|
||||
|
||||
- name: Start docker compose
|
||||
shell: docker compose up -d
|
||||
args:
|
||||
chdir: /opt/infra
|
||||
3
ansible/env_example
Normal file
3
ansible/env_example
Normal file
@@ -0,0 +1,3 @@
|
||||
ansible-playbook -i inventory.ini deploy.yml -e "target_host=$HOST"
|
||||
GITEA_INSTANCE_URL="..."
|
||||
HOST="..."
|
||||
2
ansible/inventory.ini
Normal file
2
ansible/inventory.ini
Normal file
@@ -0,0 +1,2 @@
|
||||
[servers]
|
||||
myserver ansible_user=root
|
||||
9
docker/gitea_runner_image/dockerfile.ansible
Normal file
9
docker/gitea_runner_image/dockerfile.ansible
Normal file
@@ -0,0 +1,9 @@
|
||||
# Dockerfile.runner
|
||||
FROM node:20-bullseye
|
||||
# Устанавливаем зависимости
|
||||
RUN apt-get update && apt-get install -y \
|
||||
curl \
|
||||
ansible \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
# Проверка версий
|
||||
RUN node -v && npm -v && ansible --version
|
||||
12
docker/gitea_runners/docker-compose.yaml
Normal file
12
docker/gitea_runners/docker-compose.yaml
Normal file
@@ -0,0 +1,12 @@
|
||||
services:
|
||||
runner:
|
||||
image: gitea/act_runner:latest
|
||||
restart: always
|
||||
volumes:
|
||||
- ./data/act_runner:/data
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
environment:
|
||||
- GITEA_INSTANCE_URL=${GITEA_INSTANCE_URL}
|
||||
- GITEA_RUNNER_REGISTRATION_TOKEN=${TOKEN}
|
||||
- GITEA_RUNNER_NAME=docker-runner
|
||||
- GITEA_RUNNER_LABELS=node-docker:docker://homyakspace/wedding:${TAG}, node-ansible:docker://homyakspace/wedding-ansible:${TAG}
|
||||
3
docker/gitea_runners/env_example
Normal file
3
docker/gitea_runners/env_example
Normal file
@@ -0,0 +1,3 @@
|
||||
TOKEN="..."
|
||||
GITEA_INSTANCE_URL="..."
|
||||
TAG="amd64" # amd64 / latest [arm64]
|
||||
Reference in New Issue
Block a user