Skip to content

Commit

Permalink
Merge pull request #349 from jadar/master
Browse files Browse the repository at this point in the history
Add ability to change runner working directory on mac and windows
  • Loading branch information
guenhter authored Oct 16, 2024
2 parents 4a4b7a5 + a62e8a1 commit 66c93f3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tasks/install-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@
mode: +x

- name: (MacOS) Install GitLab Runner
ansible.builtin.command: "{{ gitlab_runner_executable }} install"
ansible.builtin.command: |
"{{ gitlab_runner_executable }}" install
{% if gitlab_runner_working_directory | default(false) %}
--working-directory "{{ gitlab_runner_working_directory }}"
{% endif %}
- name: (MacOS) Start GitLab Runner
ansible.builtin.command: "{{ gitlab_runner_executable }} start"
Expand Down
6 changes: 6 additions & 0 deletions vars/Darwin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@

gitlab_runner_arch: "{{ (ansible_machine == 'arm64') | ternary('arm64', 'amd64') }}"

# it is not recommended to use system mode on macos
gitlab_runner_system_mode: false

gitlab_runner_download_url:
"https://gitlab-runner-downloads.s3.amazonaws.com/{{ gitlab_runner_wanted_tag }}/binaries/gitlab-runner-darwin-{{ gitlab_runner_arch }}"

gitlab_runner_directory: /usr/local/bin
gitlab_runner_executable: "{{ gitlab_runner_directory }}/{{ gitlab_runner_package_name }}"

# working directory for gitlab runner. defaults to current directory
gitlab_runner_working_directory: ""
3 changes: 3 additions & 0 deletions vars/Windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

gitlab_runner_download_url: https://gitlab-runner-downloads.s3.amazonaws.com/{{ gitlab_runner_wanted_tag }}/binaries/gitlab-runner-windows-amd64.exe

# working directory for gitlab runner. defaults to config file directory
gitlab_runner_working_directory: ""

gitlab_runner_install_directory: c:/gitlab-runner/
gitlab_runner_config_file_location: "{{ gitlab_runner_install_directory }}"
gitlab_runner_config_file: "{{ gitlab_runner_config_file_location }}/config.toml" # on Windows
Expand Down

0 comments on commit 66c93f3

Please sign in to comment.