From 00c7003709120a1c7f0beabd605e296f1a68350e Mon Sep 17 00:00:00 2001 From: Rod Vagg Date: Mon, 14 Oct 2019 12:48:34 +1100 Subject: [PATCH] ansible: macos: /usr/localopt->/usr/local/opt & install ccache Ref: https://github.com/nodejs/build/issues/1955 Ref: https://github.com/nodejs/build/pull/971 Ref: https://github.com/nodejs/build/pull/1347 --- ansible/roles/baselayout/tasks/main.yml | 6 +++--- ansible/roles/baselayout/vars/main.yml | 9 +++------ ansible/roles/jenkins-worker/templates/start.j2 | 2 +- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/ansible/roles/baselayout/tasks/main.yml b/ansible/roles/baselayout/tasks/main.yml index fe531f67c..4a518c901 100644 --- a/ansible/roles/baselayout/tasks/main.yml +++ b/ansible/roles/baselayout/tasks/main.yml @@ -95,9 +95,9 @@ - "{{ packages[os|stripversion]|default('[]') }}" - "{{ common_packages|default('[]') }}" -- name: Check whether /etc/paths contains "/usr/localopt/ccache/libexec" (macos) +- name: Check whether /etc/paths contains "/usr/local/opt/ccache/libexec" (macos) when: os|startswith("macos") - command: grep -Fxq "/usr/localopt/ccache/libexec" /etc/paths + command: grep -Fxq "/usr/local/opt/ccache/libexec" /etc/paths register: ccache_mac check_mode: no ignore_errors: yes @@ -107,7 +107,7 @@ when: os|startswith("macos") and ccache_mac.rc == 1 lineinfile: dest=/etc/paths insertbefore=BOF - line='/usr/localopt/ccache/libexec' + line='/usr/local/opt/ccache/libexec' - name: ubuntu1404 | update package alternatives when: os == "ubuntu1404" diff --git a/ansible/roles/baselayout/vars/main.yml b/ansible/roles/baselayout/vars/main.yml index 04018ecf3..1b772282d 100644 --- a/ansible/roles/baselayout/vars/main.yml +++ b/ansible/roles/baselayout/vars/main.yml @@ -72,18 +72,15 @@ packages: { ], 'macos10.10': [ - 'python@2', - 'python' + 'python@2,python,ccache' ], 'macos10.11': [ - 'python@2', - 'python' + 'python@2,python,ccache' ], 'macos10.12': [ - 'python@2', - 'python' + 'python@2,python,ccache' ], rhel72: [ diff --git a/ansible/roles/jenkins-worker/templates/start.j2 b/ansible/roles/jenkins-worker/templates/start.j2 index 124ed9271..37c4df7bd 100644 --- a/ansible/roles/jenkins-worker/templates/start.j2 +++ b/ansible/roles/jenkins-worker/templates/start.j2 @@ -7,6 +7,6 @@ export OSTYPE=osx export ARCH=x64 export DESTCPU=x64 -PATH="/usr/localopt/ccache/libexec:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin" {{ java_path[os] }} -Xmx{{ server_ram|default('128m') }} \ +PATH="/usr/local/opt/ccache/libexec:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin" {{ java_path[os] }} -Xmx{{ server_ram|default('128m') }} \ -jar {{ home }}/{{ server_user }}/slave.jar -secret {{ secret }} \ -jnlpUrl {{ jenkins_url }}/computer/{{ inventory_hostname }}/slave-agent.jnlp