diff --git a/ansible/MANUAL_STEPS.md b/ansible/MANUAL_STEPS.md index f2fd8ad32..0dfcc3f40 100644 --- a/ansible/MANUAL_STEPS.md +++ b/ansible/MANUAL_STEPS.md @@ -11,6 +11,9 @@ and change: to `%admin ALL = (ALL) NOPASSWD:ALL` +also add this line to allow the jenkins user to change xcode version +`iojs ALL=(ALL) NOPASSWD: /usr/bin/xcode-select` + 2. Allow ssh access ```bash diff --git a/ansible/roles/package-upgrade/files/install-xcode.sh b/ansible/roles/package-upgrade/files/install-xcode.sh index a84a84e05..a6bb4392a 100755 --- a/ansible/roles/package-upgrade/files/install-xcode.sh +++ b/ansible/roles/package-upgrade/files/install-xcode.sh @@ -6,7 +6,28 @@ osx_vers=$(sw_vers -productVersion | awk -F "." '{print $2}') cmd_line_tools_temp_file="/tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress" -# Installing the latest Xcode command line tools on 10.9.x or higher +# Installing xcode for 10.14+ + +if [[ "$osx_vers" -ge 14 ]]; then +wget -P /tmp/ foo.bar/Xcode10.xip #Placeholder URL +xip --expand /tmp/Xcode10.xip +mv /tmp/Xcode.app /Applications/Xcode10.app +fi + +# Installing xcodes for 10.13 + +if [[ "$osx_vers" -ge 13 ]]; then +wget -P /tmp/ foo.bar/Xcode10.xip #Placeholder URL +xip --expand /tmp/Xcode10.xip +mv /tmp/Xcode.app /Applications/Xcode10.app +# Install second xcode +wget -P /tmp/ foo.bar/Xcode8.xip #Placeholder URL +xip --expand /tmp/Xcode8.xip +mv /tmp/Xcode.app /Applications/Xcode8.app +fi + + +# Installing the latest Xcode command line tools on 10.9.x - 10.12.x if [[ "$osx_vers" -ge 9 ]]; then touch "$cmd_line_tools_temp_file"; diff --git a/jenkins/scripts/select-compiler.sh b/jenkins/scripts/select-compiler.sh old mode 100644 new mode 100755 index 71114ab6d..7c9018ab6 --- a/jenkins/scripts/select-compiler.sh +++ b/jenkins/scripts/select-compiler.sh @@ -22,6 +22,7 @@ if [ "$DONTSELECT_COMPILER" != "DONT" ]; then *aix* ) SELECT_ARCH=AIXPPC ;; *x64* ) SELECT_ARCH=X64 ;; *arm64* ) SELECT_ARCH=ARM64 ;; + *macos* ) SELECT_ARCH=MACOS ;; esac fi @@ -154,4 +155,22 @@ elif [ "$SELECT_ARCH" = "ARM64" ]; then ;; esac + elif [ "$SELECT_ARCH" = "MACOS" ]; then + + echo "Setting compiler for Node version $NODEJS_MAJOR_VERSION on macos" + + if [ "$NODEJS_MAJOR_VERSION" -ge "13" ]; then + # set xcode version to latest + sudo xcode-select -s /Applications/Xcode.app/Contents/Developer + echo "set xcode to latest - At least version 10" + elif [ "$NODEJS_MAJOR_VERSION" -ge "12" ]; then + sudo xcode-select -s /Applications/Xcode8.3.3.app/Contents/Developer + echo "set xcode to version 8" + elif [ "$NODEJS_MAJOR_VERSION" -ge "10" ]; then + sudo xcode-select -s /Applications/Xcode8.3.3.app/Contents/Developer + echo "set xcode to version 8" + elif [ "$NODEJS_MAJOR_VERSION" -ge "8" ]; then + sudo xcode-select -s /Applications/Xcode8.3.3.app/Contents/Developer + echo "set xcode to version 8" + fi fi