Skip to content

Commit

Permalink
ansible,jenkins: install gcc-7 on ubuntu1604 machines, use on node>12
Browse files Browse the repository at this point in the history
Ref: #1970
  • Loading branch information
rvagg committed Oct 21, 2019
1 parent f060da4 commit 7d65da2
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 1 deletion.
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
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++-7,gcc-7,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"; then
if [ "$NODEJS_MAJOR_VERSION" -gt "12" ]; then
export CC="gcc-7"
export CXX="g++-7"
export LINK="g++-7"
echo "Compiler set to GCC 7 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

0 comments on commit 7d65da2

Please sign in to comment.