-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor installation into different files
RE #62
- Loading branch information
Showing
4 changed files
with
81 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Set up Java 11 Installation. | ||
|
||
- name: Install Java 11. | ||
community.general.homebrew: | ||
name: java11 | ||
state: present | ||
|
||
- name: Symlink Java 11. | ||
shell: ln -sfn /opt/homebrew/opt/openjdk@11/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk-11.jdk | ||
become: true | ||
become_user: root | ||
|
||
- name: Ensure that the java install has been added to the path. | ||
ansible.builtin.lineinfile: | ||
path: ~/.zshrc | ||
line: export PATH="/opt/homebrew/opt/openjdk@11/bin:$PATH" | ||
create: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Download and set up the Mac OSX SDK ready for Conda to use. | ||
|
||
- name: Install gnu-tar. | ||
community.general.homebrew: | ||
name: gnu-tar | ||
state: present | ||
|
||
- name: Ensure that gnu-tar has been added to the path | ||
ansible.builtin.lineinfile: | ||
path: ~/.zshenv | ||
line: export PATH="/opt/homebrew/opt/gnu-tar/libexec/gnubin:$PATH" | ||
create: true | ||
|
||
- name: Download the Mac SDK. | ||
ansible.builtin.get_url: | ||
url: https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX10.10.sdk.tar.xz | ||
dest: ~/ | ||
mode: '777' | ||
force: true | ||
|
||
- name: Unarchive the Mac SDK. | ||
ansible.builtin.unarchive: | ||
src: ~/MacOSX10.10.sdk.tar.xz | ||
dest: ~/ | ||
remote_src: yes | ||
|
||
- name: Move the Mac SDK into opt | ||
shell: mv /Users/mantidbuilder/MacOSX10.10.sdk /opt | ||
become: true | ||
|
||
- name: Remove the downloaded Mac SDK Tarball. | ||
ansible.builtin.file: | ||
path: ~/MacOSX10.10.sdk.tar.xz | ||
state: absent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
macOS/jenkins-node/ansible/roles/agent/tasks/start-jenkins-agent.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Test and start the agent. Note: Connection will only begin consistently every 5th minute if changes are made. | ||
|
||
- name: Download jenkins slave script. | ||
shell: curl -o $HOME/jenkins-slave.sh https://raw.githubusercontent.com/mantidproject/mantid/main/buildconfig/Jenkins/jenkins-slave.sh | ||
|
||
- name: Make the slave script executable. | ||
shell: chmod 777 $HOME/jenkins-slave.sh | ||
|
||
- name: Check the Jenkins agent connection script. | ||
script: ./check-connection.sh {{ agent_name }} {{ agent_secret }} | ||
|
||
- name: Setup a chrontab entry to run the agent script every 5th minute. | ||
ansible.builtin.cron: | ||
name: "Run slave script" | ||
minute: "*/5" | ||
job: "$HOME/jenkins-slave.sh {{ agent_name }} {{ agent_secret }}" |