SpecialistOff.NET / Вопросы / Статьи / Фрагменты кода / Резюме / Метки / Помощь / Файлы
НазадМетки: gitea git руководство
Создаём нужные группы и нужных пользователей
groupadd gitea useradd -m -d /home/gitea -s /bin/bash -g gitea -m gitea
Загрузка пакетов
export VERSION=1.21.10
wget -O /usr/local/bin/gitea https://dl.gitea.io/gitea/${VERSION}/gitea-${VERSION}-linux-amd64 chmod +x /usr/local/bin/gitea
Создание структуры директорий
mkdir -p /data/gitea/{custom,data,log}
chown -R gitea:gitea /data/gitea/
chmod -R 750 /data/gitea/
mkdir /etc/gitea
chown root:gitea /etc/gitea
chmod 770 /etc/gitea
actions
export VERSION=0.2.10
wget -O /usr/local/bin/gitea_runner https://gitea.com/gitea/act_runner/releases/download/v${VERSION}/act_runner-${VERSION}-linux-amd64
chmod +x /usr/local/bin/gitea_runner
mkdir /etc/gitea-runner
/usr/local/bin/gitea_runner generate-config > /etc/gitea-runner/config.yaml
/usr/local/bin/gitea_runner --config /etc/gitea-runner/config.yaml
Вручную вносим правки в файл /etc/gitea-runner/config.yaml
runner:
file: /etc/gitea-runner/.runner
/usr/local/bin/gitea_runner register \
--no-interactive --instance <instance_url> \
--token <registration_token> \
--name <runner_name> \
--labels <runner_labels> \
--config /etc/gitea-runner/config.yaml
/etc/systemd/system/gitea_runner.service
[Unit]
Description=Gitea Actions runner
Documentation=https://gitea.com/gitea/act_runner
After=docker.service
[Service]
ExecStart=/usr/local/bin/gitea_runner daemon --config /etc/gitea-runner/config.yaml
ExecReload=/bin/kill -s HUP $MAINPID
WorkingDirectory=/var/lib/gitea-runner
TimeoutSec=0
RestartSec=10
Restart=always
#User=gitea_runner
[Install]
WantedBy=multi-user.target
systemctl daemon-reload
systemctl enable gitea_runner
systemctl start gitea_runner