Skip to content

Commit

Permalink
Fix homebrew and git installation
Browse files Browse the repository at this point in the history
RE #62
  • Loading branch information
cailafinn committed May 15, 2023
1 parent b705c79 commit b77badf
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 41 deletions.
3 changes: 3 additions & 0 deletions jenkins-node/mantid-builder-macos/ansible/requirements.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
collections:
- name: geerlingguy.mac
Original file line number Diff line number Diff line change
@@ -1,48 +1,47 @@
---
# Deploy Jenkins agent on macOS

- name: Deploy Jenkins agent on macOS
tasks:
# Install Requirements
# Install Requirements

- name: Install homebrew
include_role:
name: geerlingguy.mac.homebrew

- name: Make sure homebrew bin is in the path
ansible.builtin.lineinfile:
path: /etc/paths
state: present
line: '/opt/homebrew/bin'
become: true
become_user: root

- name: Install git
community.general.homebrew:
name: git
state: latest

- name: Install Java 11
community.general.homebrew:
name: java11
state: present

# Configure macOS Settings

- name: Disable screensaver
shell: defaults write com.apple.screensaver idleTime 0

- name: Disable saved application states to avoid dialog
shell: defaults write org.python.python NSQuitAlwaysKeepsWindows -bool false
- name: Install homebrew
include_role:
name: geerlingguy.mac.homebrew

- name: Make sure homebrew bin is in the path
ansible.builtin.lineinfile:
path: /etc/paths
state: present
line: '/opt/homebrew/bin'
become: true
become_user: root

- name: Install git
community.general.homebrew:
name: git
state: latest

- name: Install Java 11
community.general.homebrew:
name: java11
state: present

# Configure macOS Settings

- name: Disable screensaver
shell: defaults write com.apple.screensaver idleTime 0

- name: Disable saved application states to avoid dialog
shell: defaults write org.python.python NSQuitAlwaysKeepsWindows -bool false

# TODO: Disable autolock (this seems to change between versions, so might not be possible to script)
# TODO: Disable autolock (this seems to change between versions, so might not be possible to script)

- name: Download jenkins slave script
shell: curl -o ~/jenkins-slave.sh https://raw.githubusercontent.com/mantidproject/mantid/main/buildconfig/Jenkins/jenkins-slave.sh
- name: Start script as chrontab entry
ansible.builtin.cron:
name: "Run slave script"
minute: "*/5"
job: "$HOME/jenkins-slave.sh {{ agent_name }} {{ agent_secret }}"
- name: Download jenkins slave script
shell: curl -o ~/jenkins-slave.sh https://raw.githubusercontent.com/mantidproject/mantid/main/buildconfig/Jenkins/jenkins-slave.sh

- name: Start script as chrontab entry
ansible.builtin.cron:
name: "Run slave script"
minute: "*/5"
job: "$HOME/jenkins-slave.sh {{ agent_name }} {{ agent_secret }}"


0 comments on commit b77badf

Please sign in to comment.