[ci-workers] Add support for MacOSX
This commit is contained in:
parent
62ac481806
commit
9d1c37f793
|
@ -0,0 +1,10 @@
|
||||||
|
---
|
||||||
|
- name: Check if brew is installed
|
||||||
|
stat:
|
||||||
|
path: /usr/local/bin/brew
|
||||||
|
register: brew_check
|
||||||
|
|
||||||
|
- name: Fail if brew is unavailable
|
||||||
|
fail:
|
||||||
|
msg: 'brew is not installed! Please install Homebrew: https://docs.brew.sh/Installation.html'
|
||||||
|
when: not brew_check.stat.exists
|
|
@ -0,0 +1,23 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>Label</key>
|
||||||
|
<string>net.buildbot.worker</string>
|
||||||
|
<key>ProgramArguments</key>
|
||||||
|
<array>
|
||||||
|
<string>{{ buildbot_worker_dir }}/venv/bin/buildbot-worker</string>
|
||||||
|
<string>start</string>
|
||||||
|
<string>{{ buildbot_worker_name }}</string>
|
||||||
|
</array>
|
||||||
|
<key>WorkingDirectory</key>
|
||||||
|
<string>{{ buildbot_worker_dir }}</string>
|
||||||
|
<key>UserName</key>
|
||||||
|
<string>{{ buildbot_worker_user }}</string>
|
||||||
|
<key>KeepAlive</key>
|
||||||
|
<dict>
|
||||||
|
<key>NetworkState</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
|
@ -72,6 +72,10 @@
|
||||||
package_deps: "{{ buildbot_deps + fetch_deps + conf_deps + build_deps + link_deps + dist_deps }}"
|
package_deps: "{{ buildbot_deps + fetch_deps + conf_deps + build_deps + link_deps + dist_deps }}"
|
||||||
python_modules: "{{ buildbot_modules + rpc_test_modules }}"
|
python_modules: "{{ buildbot_modules + rpc_test_modules }}"
|
||||||
|
|
||||||
|
- name: Install Homebrew [MacOSX]
|
||||||
|
include: tasks/install-brew.yml
|
||||||
|
when: ansible_distribution == 'MacOSX'
|
||||||
|
|
||||||
- name: Update rolling release [Arch Linux]
|
- name: Update rolling release [Arch Linux]
|
||||||
pacman:
|
pacman:
|
||||||
update_cache: yes
|
update_cache: yes
|
||||||
|
@ -83,15 +87,17 @@
|
||||||
name: "{{ item }}"
|
name: "{{ item }}"
|
||||||
state: present
|
state: present
|
||||||
with_items: "{{ package_deps }}"
|
with_items: "{{ package_deps }}"
|
||||||
|
become_user: "{{ ansible_ssh_user if ansible_distribution == 'MacOSX' else 'root' }}"
|
||||||
|
|
||||||
- name: Install pip [CentOS]
|
- name: Install pip [CentOS, MacOSX]
|
||||||
include: tasks/install-pip.yml
|
include: tasks/install-pip.yml
|
||||||
when: ansible_distribution == 'CentOS'
|
when: ansible_distribution in ['CentOS', 'MacOSX']
|
||||||
|
|
||||||
- name: Install required Python system modules
|
- name: Install required Python system modules
|
||||||
pip:
|
pip:
|
||||||
name: "{{ item }}"
|
name: "{{ item }}"
|
||||||
state: latest
|
state: latest
|
||||||
|
executable: "{{ '/usr/local/bin/pip' if ansible_distribution == 'MacOSX' else omit }}"
|
||||||
with_items: "{{ system_modules }}"
|
with_items: "{{ system_modules }}"
|
||||||
|
|
||||||
- name: Set up the Buildbot worker user
|
- name: Set up the Buildbot worker user
|
||||||
|
@ -115,6 +121,7 @@
|
||||||
name: "{{ item }}"
|
name: "{{ item }}"
|
||||||
state: latest
|
state: latest
|
||||||
virtualenv: "~{{ buildbot_worker_user }}/venv"
|
virtualenv: "~{{ buildbot_worker_user }}/venv"
|
||||||
|
virtualenv_command: "{{ '/usr/local/bin/virtualenv' if ansible_distribution == 'MacOSX' else omit }}"
|
||||||
with_items: "{{ python_modules }}"
|
with_items: "{{ python_modules }}"
|
||||||
become_user: "{{ buildbot_worker_user }}"
|
become_user: "{{ buildbot_worker_user }}"
|
||||||
notify: restart buildbot-worker
|
notify: restart buildbot-worker
|
||||||
|
@ -133,7 +140,7 @@
|
||||||
content: "{{ buildbot_worker_admin }}"
|
content: "{{ buildbot_worker_admin }}"
|
||||||
dest: "~{{ buildbot_worker_user }}/{{ buildbot_worker_name }}/info/admin"
|
dest: "~{{ buildbot_worker_user }}/{{ buildbot_worker_name }}/info/admin"
|
||||||
owner: "{{ buildbot_worker_user }}"
|
owner: "{{ buildbot_worker_user }}"
|
||||||
group: "{{ buildbot_worker_user }}"
|
group: "{{ omit if ansible_distribution == 'MacOSX' else buildbot_worker_user }}"
|
||||||
mode: "0644"
|
mode: "0644"
|
||||||
|
|
||||||
- name: Set host details for Buildbot worker
|
- name: Set host details for Buildbot worker
|
||||||
|
@ -141,7 +148,7 @@
|
||||||
src: "{{ buildbot_worker_host_template }}"
|
src: "{{ buildbot_worker_host_template }}"
|
||||||
dest: "~{{ buildbot_worker_user }}/{{ buildbot_worker_name }}/info/host"
|
dest: "~{{ buildbot_worker_user }}/{{ buildbot_worker_name }}/info/host"
|
||||||
owner: "{{ buildbot_worker_user }}"
|
owner: "{{ buildbot_worker_user }}"
|
||||||
group: "{{ buildbot_worker_user }}"
|
group: "{{ omit if ansible_distribution == 'MacOSX' else buildbot_worker_user }}"
|
||||||
mode: "0644"
|
mode: "0644"
|
||||||
|
|
||||||
- name: Install custom bashrc for virtualenv
|
- name: Install custom bashrc for virtualenv
|
||||||
|
@ -149,7 +156,7 @@
|
||||||
src: bashrc
|
src: bashrc
|
||||||
dest: "~{{ buildbot_worker_user }}/.bashrc"
|
dest: "~{{ buildbot_worker_user }}/.bashrc"
|
||||||
owner: "{{ buildbot_worker_user }}"
|
owner: "{{ buildbot_worker_user }}"
|
||||||
group: "{{ buildbot_worker_user }}"
|
group: "{{ omit if ansible_distribution == 'MacOSX' else buildbot_worker_user }}"
|
||||||
mode: "0644"
|
mode: "0644"
|
||||||
|
|
||||||
- name: Copy Buildbot worker systemd service unit
|
- name: Copy Buildbot worker systemd service unit
|
||||||
|
@ -159,13 +166,32 @@
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
mode: "0644"
|
mode: "0644"
|
||||||
|
when: ansible_distribution != 'MacOSX'
|
||||||
notify: reload systemd
|
notify: reload systemd
|
||||||
|
|
||||||
- name: Start Buildbot worker.
|
- name: Copy Buildbot worker launchd service unit
|
||||||
|
template:
|
||||||
|
src: templates/buildbot-worker.plist.j2
|
||||||
|
dest: "/Library/LaunchDaemons/net.buildbot.worker.plist"
|
||||||
|
owner: root
|
||||||
|
group: wheel
|
||||||
|
mode: "0644"
|
||||||
|
when: ansible_distribution == 'MacOSX'
|
||||||
|
|
||||||
|
- name: Start Buildbot worker
|
||||||
service:
|
service:
|
||||||
name: buildbot-worker
|
name: buildbot-worker
|
||||||
state: started
|
state: started
|
||||||
enabled: yes
|
enabled: yes
|
||||||
|
when: ansible_distribution != 'MacOSX'
|
||||||
|
|
||||||
|
- name: Load Buildbot worker service [MacOSX]
|
||||||
|
command: launchctl load /Library/LaunchDaemons/net.buildbot.worker.plist
|
||||||
|
when: ansible_distribution == 'MacOSX'
|
||||||
|
|
||||||
|
- name: Start Buildbot worker [MacOSX]
|
||||||
|
command: launchctl start net.buildbot.worker
|
||||||
|
when: ansible_distribution == 'MacOSX'
|
||||||
|
|
||||||
handlers:
|
handlers:
|
||||||
- name: restart buildbot-worker
|
- name: restart buildbot-worker
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
buildbot_deps:
|
||||||
|
- coreutils # For gnproc etc.
|
||||||
|
# Already installed
|
||||||
|
build_deps: []
|
Loading…
Reference in New Issue