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

[WIP] ansible: Edit select-compiler.sh to select different versions of xcode #1967

Closed
wants to merge 5 commits into from
Closed
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
3 changes: 3 additions & 0 deletions ansible/MANUAL_STEPS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
23 changes: 22 additions & 1 deletion ansible/roles/package-upgrade/files/install-xcode.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
19 changes: 19 additions & 0 deletions jenkins/scripts/select-compiler.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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