Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
P
playbooks
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
playbooks
Commits
962f5680
Commit
962f5680
authored
Sep 04, 2021
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gitlab runner
parent
58c77371
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
0 deletions
+51
-0
gitlab-runner.yml
gitlab-runner.yml
+51
-0
No files found.
gitlab-runner.yml
0 → 100644
View file @
962f5680
---
-
hosts
:
gitlab-runner
remote_user
:
root
vars
:
service_path
:
gitlab-runner
service_name
:
gitlab-runner
tasks
:
-
name
:
directory
file
:
path
:
'
{{
ansible_user_dir
}}/{{
service_path
}}'
state
:
directory
recurse
:
true
-
name
:
docker-compose file
template
:
src
:
'
files/services/{{
service_name
}}/docker-compose.yml.j2'
dest
:
'
{{
ansible_user_dir
}}/{{
service_path
}}/docker-compose.yml'
-
name
:
docker-compose up -d
docker_compose
:
project_src
:
'
{{
ansible_user_dir
}}/{{
service_path
}}'
remove_orphans
:
true
build
:
false
pull
:
'
{{pull}}'
-
name
:
register
shell
:
|
{% for instance in instances %}
docker-compose exec -T runner gitlab-runner register --non-interactive --url '{{ instance.url }}' --registration-token '{{ instance.token }}' --description '{{ instance.desc }} runner on {{ inventory_hostname }}' --executor '{{ instance.type | default("docker") }}' --docker-volumes /cache {% if instance.docker | default(false) %} --tag-list docker --docker-privileged --docker-volumes /var/run/docker.sock --docker-image docker:20-git {% else %} --tag-list linux --docker-image git-registry.mycard.moe/mycard/docker-runner-base:latest {% endif %}
{% endfor %}
args
:
chdir
:
'
{{
ansible_user_dir
}}/{{
service_path
}}'
creates
:
'
{{
ansible_user_dir
}}/{{
service_path
}}/config/config.toml'
notify
:
restart_runner
when
:
instances is defined and instances
-
name
:
fixup cocurrent
become
:
true
lineinfile
:
path
:
'
{{
ansible_user_dir
}}/{{
service_path
}}/config/config.toml'
regexp
:
'
^concurrent
=
1'
line
:
'
concurrent
=
{{ansible_processor_vcpus}}'
backrefs
:
true
notify
:
restart_runner
when
:
ansible_processor_vcpus|int >
1
handlers
:
-
name
:
restart_runner
include_tasks
:
'
handlers/docker.yaml'
vars
:
handler
:
type
:
docker
path
:
'
{{
ansible_user_dir
}}/{{
service_path
}}'
services
:
-
runner
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment