Skip to content

Commit

Permalink
docker: force uname to show armv7l on aarch64 hosts
Browse files Browse the repository at this point in the history
Signed-off-by: Stewart X Addison <[email protected]>
  • Loading branch information
sxa committed Jun 15, 2021
1 parent 587751e commit d9a82c4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ RUN rm -rf /ansible

RUN groupadd -g 1000 ${user}
RUN useradd -c "Jenkins user" -d /home/${user} -u 1000 -g 1000 -m ${user}
RUN mv /bin/uname /bin/uname.real && echo "/bin/uname.real $@ | sed 's/aarch64/armv7l'" > /bin/uname && chmod 755 /bin/uname

ENV \
JDK7_BOOT_DIR="/usr/lib/jvm/jdk8" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,21 @@
when: ansible_distribution == "RedHat" or ansible_distribution == "CentOS" or ansible_distribution == "openSUSE" or (ansible_architecture == "armv7l" and ((ansible_distribution == "Ubuntu" and ansible_distribution_major_version == "16") or ansible_distribution == "Debian"))
tags: gcc_7

- name: Configure gcc75 tarball extension on non-armv7l
set_fact: gccsuffix=.xz
tags: gcc_7
when: ansible_architecture != "armv7l"

- name: Configure gcc75 tarball extension on armv7l
set_fact: gccsuffix=.gz
tags: gcc_7
when: ansible_architecture == "armv7l"

# 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'
url: https://ci.adoptopenjdk.net/userContent/gcc/gcc750+ccache.{{ ansible_architecture }}.tar{{ gccsuffix }}
dest: '/tmp/ansible-adoptopenjdk-gcc-7.tar{{ gccsuffix }}'
force: no
mode: 0644
when:
Expand All @@ -24,7 +34,7 @@

- name: Extract AdoptOpenJDK gcc-7 binary to /usr/local/gcc
unarchive:
src: /tmp/ansible-adoptopenjdk-gcc-7.tar.xz
src: /tmp/ansible-adoptopenjdk-gcc-7.tar{{ gccsuffix }}
dest: /usr/local/
copy: False
when:
Expand All @@ -34,7 +44,7 @@

- name: Remove downloaded gcc 7 binary tarball
file:
path: '/tmp/ansible-adoptopenjdk-gcc-7.tar.xz'
path: '/tmp/ansible-adoptopenjdk-gcc-7.tar{{ gccsuffix }}'
state: absent
when:
- ansible_distribution == "RedHat" or ansible_distribution == "CentOS" or ansible_distribution == "openSUSE" or (ansible_architecture == "armv7l" and ((ansible_distribution == "Ubuntu" and ansible_distribution_major_version == "16") or ansible_distribution == "Debian"))
Expand Down

0 comments on commit d9a82c4

Please sign in to comment.