Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ansible,jenkins: install gcc-7 on ubuntu1604 machines, use on node>12 #1975

Merged
merged 1 commit into from
Oct 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions ansible/roles/baselayout/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,15 @@
- gcc
- g++

- name: ubuntu1604 | update package alternatives
when: os == "ubuntu1604"
alternatives: link=/usr/bin/{{ gcc }} name={{ gcc }} path=/usr/bin/{{ gcc }}-5
loop_control:
loop_var: gcc
with_items:
- gcc
- g++

- name: smartos17 | update gcc symlinks
when: os == "smartos17"
file:
Expand Down
12 changes: 12 additions & 0 deletions ansible/roles/baselayout/tasks/partials/repo/ubuntu1604.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---

#
# add PPA for gcc updates
#

- name: "repo : add Ubuntu Toolchain PPA"
apt_repository:
repo: 'ppa:ubuntu-toolchain-r/test'
state: present
update_cache: yes
register: has_updated_package_repo
2 changes: 1 addition & 1 deletion ansible/roles/baselayout/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ packages: {
],

ubuntu: [
'ccache,g++,gcc,git,libfontconfig1,sudo',
'ccache,g++,gcc,g++-6,gcc-6,git,libfontconfig1,sudo',
],

ubuntu1404: [
Expand Down
31 changes: 31 additions & 0 deletions jenkins/scripts/select-compiler.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ if [ "$DONTSELECT_COMPILER" != "DONT" ]; then
*ppc64*le* ) SELECT_ARCH=PPC64LE ;;
*s390x* ) SELECT_ARCH=S390X ;;
*aix* ) SELECT_ARCH=AIXPPC ;;
*x64* ) SELECT_ARCH=X64 ;;
*arm64* ) SELECT_ARCH=ARM64 ;;
esac
fi

Expand Down Expand Up @@ -112,4 +114,33 @@ elif [ "$SELECT_ARCH" = "AIXPPC" ]; then
# front of PATH
echo "Compiler set to default at 4.8.5"
fi

elif [ "$SELECT_ARCH" = "X64" ]; then
echo "Setting compiler for Node version $NODEJS_MAJOR_VERSION on x64"


if test $nodes = "centos6-64-gcc48"; then
. /opt/rh/devtoolset-2/enable
echo "Compiler set to devtoolset-2"
elif [[ "$nodes" =~ centos[67]-64-gcc6 ]]; then
. /opt/rh/devtoolset-6/enable
echo "Compiler set to devtoolset-6"
elif test $nodes = "ubuntu1604-64"; then
if [ "$NODEJS_MAJOR_VERSION" -gt "12" ]; then
export CC="gcc-6"
export CXX="g++-6"
export LINK="g++-6"
echo "Compiler set to GCC 6 for $NODEJS_MAJOR_VERSION"
fi
fi

elif [ "$SELECT_ARCH" = "ARM64" ]; then
echo "Setting compiler for Node version $NODEJS_MAJOR_VERSION on arm64"


if [[ "$nodes" =~ centos[67]-arm64-gcc6 ]]; then
. /opt/rh/devtoolset-6/enable
echo "Compiler set to devtoolset-6"
fi

fi