-
-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Stewart X Addison <[email protected]>
- Loading branch information
Showing
2 changed files
with
69 additions
and
7 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
62 changes: 62 additions & 0 deletions
62
ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/gcc_7/tasks/main.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,62 @@ | ||
--- | ||
######### | ||
# gcc_7 # | ||
######### | ||
|
||
- name: Check if gcc 7.5 is installed on RHEL/CentOS | ||
shell: /usr/local/gcc/bin/gcc-7.5 --version 2>&1 > /dev/null | ||
ignore_errors: yes | ||
register: gcc7_installed | ||
when: ansible_distribution == "RedHat" or ansible_distribution == "CentOS" or ansible_distribution == "openSUSE" or (ansible_distribution == "Ubuntu" and ansible_distribution_major_version == "16") or (ansible_distribution == "Debian" and ansible_architecture == "armv7l") | ||
tags: gcc_7 | ||
|
||
# Unable to check the checksum of the binary as it'll be different for each architecture's tar.xz file | ||
- name: Download AdoptOpenJDK gcc-7.5.0 binary | ||
get_url: | ||
url: https://ci.adoptopenjdk.net/userContent/gcc/gcc750+ccache.{{ ansible_architecture }}.tar.xz | ||
dest: '/tmp/ansible-adoptopenjdk-gcc-7.tar.xz' | ||
force: no | ||
mode: 0644 | ||
when: | ||
- ansible_distribution == "RedHat" or ansible_distribution == "CentOS" or ansible_distribution == "openSUSE" or (ansible_distribution == "Ubuntu" and ansible_distribution_major_version == "16") or (ansible_distribution == "Debian" and ansible_architecture == "armv7l") | ||
- gcc7_installed.rc != 0 | ||
tags: gcc_7 | ||
|
||
- name: Extract AdoptOpenJDK gcc-7 binary to /usr/local/gcc | ||
unarchive: | ||
src: /tmp/ansible-adoptopenjdk-gcc-7.tar.xz | ||
dest: /usr/local/ | ||
copy: False | ||
when: | ||
- ansible_distribution == "RedHat" or ansible_distribution == "CentOS" or ansible_distribution == "openSUSE" or (ansible_distribution == "Ubuntu" and ansible_distribution_major_version == "16") or (ansible_distribution == "Debian" and ansible_architecture == "armv7l") | ||
- gcc7_installed.rc != 0 | ||
tags: gcc_7 | ||
|
||
- name: Remove downloaded gcc 7 binary tarball | ||
file: | ||
path: '/tmp/ansible-adoptopenjdk-gcc-7.tar.xz' | ||
state: absent | ||
when: | ||
- ansible_distribution == "RedHat" or ansible_distribution == "CentOS" or ansible_distribution == "openSUSE" or (ansible_distribution == "Ubuntu" and ansible_distribution_major_version == "16") or (ansible_distribution == "Debian" and ansible_architecture == "armv7l") | ||
- gcc7_installed.rc != 0 | ||
tags: gcc_7 | ||
|
||
# Stops buildng ccache from source when unnecessary | ||
# See: https://github.com/AdoptOpenJDK/openjdk-infrastructure/issues/1472 | ||
- name: Check if ccache is at /usr/local/bin/ccache | ||
stat: | ||
path: /usr/local/bin/ccache | ||
register: ccache_symlink | ||
when: | ||
- ansible_distribution == "RedHat" or ansible_distribution == "CentOS" or ansible_distribution == "openSUSE" or (ansible_distribution == "Ubuntu" and ansible_distribution_major_version == "16") or (ansible_distribution == "Debian" and ansible_architecture == "armv7l") | ||
tags: gcc_7 | ||
|
||
- name: Create symlink for ccache | ||
file: | ||
src: /usr/local/gcc/bin/ccache | ||
dest: /usr/local/bin/ccache | ||
state: link | ||
when: | ||
- ansible_distribution == "RedHat" or ansible_distribution == "CentOS" or ansible_distribution == "openSUSE" or (ansible_distribution == "Ubuntu" and ansible_distribution_major_version == "16") or (ansible_distribution == "Debian" and ansible_architecture == "armv7l") | ||
- not ccache_symlink.stat.exists | ||
tags: gcc_7 |