feat: act runner updates (#432)
saving artifacts are breaking in some actions as the runner will switch between different git hosts. using haproxy will ensure the same backend is always hit via stick-tables and cookies - ensure runners use haproxy to reach git we now package act_runner now, lets use the rpm - change installation method to rpm instead of curl + untar - add capability to versionlock act_runner - fix paths to act_runner - remove manually installed act_runner Reviewed-on: #432
This commit is contained in:
parent
f8caa71f34
commit
57870658b5
@ -8,9 +8,9 @@ docker::version: latest
|
||||
docker::curl_ensure: false
|
||||
docker::root_dir: /data/docker
|
||||
|
||||
profiles::gitea::runner::instance: https://git.unkin.net
|
||||
profiles::gitea::runner::home: /data/runner
|
||||
profiles::gitea::runner::version: '0.2.10'
|
||||
profiles::gitea::runner::source: "https://gitea.com/gitea/act_runner/releases/download/v%{hiera('profiles::gitea::runner::version')}/act_runner-%{hiera('profiles::gitea::runner::version')}-linux-amd64"
|
||||
profiles::gitea::runner::version: '0.2.12'
|
||||
profiles::gitea::runner::config:
|
||||
log:
|
||||
level: info
|
||||
|
||||
@ -1,13 +1,12 @@
|
||||
# profiles::gitea::init
|
||||
class profiles::gitea::runner (
|
||||
String $registration_token,
|
||||
Stdlib::HTTPSUrl $source,
|
||||
String $user = 'runner',
|
||||
String $group = 'runner',
|
||||
Stdlib::Absolutepath $home = '/data/runner',
|
||||
Hash $config = {},
|
||||
Stdlib::HTTPSUrl $instance = 'https://git.query.consul',
|
||||
String $version = '0.2.10',
|
||||
String $version = 'latest',
|
||||
) {
|
||||
|
||||
group { $group:
|
||||
@ -32,24 +31,27 @@ class profiles::gitea::runner (
|
||||
require => User[$user],
|
||||
}
|
||||
|
||||
archive { '/usr/local/bin/act_runner':
|
||||
ensure => present,
|
||||
extract => false,
|
||||
source => $source,
|
||||
creates => '/usr/local/bin/act_runner',
|
||||
cleanup => true,
|
||||
unless $version in ['latest', 'present'] {
|
||||
# versionlock act
|
||||
yum::versionlock{ 'act_runner':
|
||||
ensure => present,
|
||||
version => $version,
|
||||
before => Package['act_runner'],
|
||||
}
|
||||
}
|
||||
|
||||
# install act
|
||||
package { 'act_runner':
|
||||
ensure => $version,
|
||||
}
|
||||
|
||||
# remove manually installed act_runner
|
||||
file { '/usr/local/bin/act_runner':
|
||||
ensure => 'file',
|
||||
mode => '0755',
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
require => Archive['/usr/local/bin/act_runner'],
|
||||
ensure => absent,
|
||||
}
|
||||
|
||||
exec {'register_act_runner':
|
||||
command => "/usr/local/bin/act_runner register \
|
||||
exec { 'register_act_runner':
|
||||
command => "/usr/bin/act_runner register \
|
||||
--no-interactive \
|
||||
--instance ${instance} \
|
||||
--token ${registration_token} \
|
||||
@ -60,12 +62,12 @@ class profiles::gitea::runner (
|
||||
user => $user,
|
||||
group => $group,
|
||||
require => [
|
||||
File['/usr/local/bin/act_runner'],
|
||||
Package['act_runner'],
|
||||
File["${home}/config.yaml"],
|
||||
],
|
||||
}
|
||||
|
||||
systemd::unit_file {'act_runner.service':
|
||||
systemd::unit_file { 'act_runner.service':
|
||||
enable => true,
|
||||
active => true,
|
||||
content => template('profiles/gitea/act_runner.service.erb'),
|
||||
|
||||
@ -4,7 +4,7 @@ Documentation=https://gitea.com/gitea/act_runner
|
||||
After=docker.service
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/local/bin/act_runner daemon --config <%= @home %>/config.yaml
|
||||
ExecStart=/usr/bin/act_runner daemon --config <%= @home %>/config.yaml
|
||||
ExecReload=/bin/kill -s HUP $MAINPID
|
||||
WorkingDirectory=<%= @home %>
|
||||
TimeoutSec=0
|
||||
|
||||
Loading…
Reference in New Issue
Block a user