Skip to content

Commit

Permalink
NXDRIVE-1232: Split the macOS installer build to support macOS 10.11
Browse files Browse the repository at this point in the history
  • Loading branch information
Mickaël Schoentgen committed Jun 12, 2018
1 parent 3f2c72e commit aee71d7
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 9 deletions.
1 change: 1 addition & 0 deletions docs/changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Release date: `2018-06-xx`
### Packaging / Build
- [NXDRIVE-1226](https://jira.nuxeo.com/browse/NXDRIVE-1226): Deprecate macOS 10.10 (Yosemite)
- [NXDRIVE-1229](https://jira.nuxeo.com/browse/NXDRIVE-1229): Do not install Drive in %APPDATA% but %LOCALAPPDATA% folder on Windows
- [NXDRIVE-1232](https://jira.nuxeo.com/browse/NXDRIVE-1232): Split the macOS installer build to support macOS 10.11


# 3.1.0
Expand Down
1 change: 1 addition & 0 deletions docs/deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Where `$OSI` is one of: `linux`, `osx`.
Possible `ARG`:

--build: freeze the client into self-hosted binary package
--build-ext: build the FinderSync extension (macOS only)
--start: start Nuxeo Drive
--tests: launch the tests suite

Expand Down
16 changes: 15 additions & 1 deletion tools/jenkins/packages.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,20 @@ for (x in slaves) {
}
}

stage(osi + ' Extension') {
// Trigger the Drive extensions job to build extensions and have artifacts
if (osi == 'macOS') {
build job: 'Drive-extensions', parameters: [
[$class: 'StringParameterValue',
name: 'BRANCH_NAME',
value: params.BRANCH_NAME]]

dir('sources') {
step([$class: 'CopyArtifact', filter: 'extension.zip', projectName: 'Drive-extensions'])
}
}
}

stage(osi + ' Build') {
dir('sources') {
dir('build') {
Expand All @@ -100,7 +114,7 @@ for (x in slaves) {
} else if (osi == 'macOS') {
def env_vars = [
'SIGNING_ID=NUXEO CORP',
'LOGIN_KEYCHAIN_PATH=/Users/jenkins/Library/Keychains/login.keychain-db',
"LOGIN_KEYCHAIN_PATH=${env.HOME}/Library/Keychains/login.keychain",
]
withEnv(env_vars) {
withCredentials([string(credentialsId: 'MOBILE_LOGIN_KEYCHAIN_PASSWORD',
Expand Down
29 changes: 22 additions & 7 deletions tools/osx/deploy_jenkins_slave.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,29 @@ prepare_signing() {

echo ">>> [sign] Unlocking the Nuxeo keychain"
security unlock-keychain -p "${LOGIN_KEYCHAIN_PASSWORD}" "${LOGIN_KEYCHAIN_PATH}"
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "${LOGIN_KEYCHAIN_PASSWORD}" "${LOGIN_KEYCHAIN_PATH}"
# set-key-partition-list was added in Sierra (macOS 10.12)
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "${LOGIN_KEYCHAIN_PASSWORD}" "${LOGIN_KEYCHAIN_PATH}" || true
security set-keychain-settings "${LOGIN_KEYCHAIN_PATH}"
}

build_extension() {
# Create the FinderSync extension, if not already done
local extension_path="${WORKSPACE_DRIVE}/tools/osx/drive"

if test -f "${WORKSPACE_DRIVE}/extension.zip"; then
# The extension has been unstashed from a specific job, just decompress it
echo ">>> [package] Decompressing the FinderSync extension"
unzip -o -d "${WORKSPACE_DRIVE}" "${WORKSPACE_DRIVE}/extension.zip"
rm -fv "${WORKSPACE_DRIVE}/extension.zip"
return
fi

echo ">>> [package] Building the FinderSync extension"
xcodebuild -project "${extension_path}/drive.xcodeproj" -target "NuxeoFinderSync" -configuration Release build
mv -fv "${extension_path}/build/Release/NuxeoFinderSync.appex" "${WORKSPACE_DRIVE}/NuxeoFinderSync.appex"
rm -rf "${extension_path}/build"
}

create_package() {
# Create the final DMG
local app_name="Nuxeo Drive"
Expand All @@ -40,13 +59,10 @@ create_package() {
echo ">>> [package] Updating Info.plist"
sed "s/\$version/${app_version}/" "${plist}" > "${pkg_path}/Contents/Info.plist"

echo ">>> [package] Building the FinderSync extension"
xcodebuild -project "${extension_path}/drive.xcodeproj" -target "NuxeoFinderSync" -configuration Release build

build_extension
echo ">>> [package] Adding the extension to the package"
mkdir "${pkg_path}/Contents/PlugIns"
cp -a "${extension_path}/build/Release/NuxeoFinderSync.appex" "${pkg_path}/Contents/PlugIns/."
rm -rf "${extension_path}/build"
mv -fv "${WORKSPACE_DRIVE}/NuxeoFinderSync.appex" "${pkg_path}/Contents/PlugIns/."

echo ">>> [package] Creating the DMG file"
rm -fv ${output_dir}/*.dmg
Expand Down Expand Up @@ -94,7 +110,6 @@ create_package() {
# Clean tmp directories
rm -rf "${src_folder_tmp}" "${dmg_tmp}"


if [ "${SIGNING_ID:=unset}" != "unset" ]; then
codesign -vs "${SIGNING_ID}" "dist/nuxeo-drive-${app_version}.dmg"
fi
Expand Down
14 changes: 13 additions & 1 deletion tools/posix/deploy_jenkins_slave.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#
# Possible ARG:
# --build: build the package
# --build-ext: build the FinderSync extension (macOS only)
# --start: start Nuxeo Drive
# --tests: launch the tests suite
#
Expand Down Expand Up @@ -299,8 +300,19 @@ main() {
# Adjust PATH for Mac
[ "${OSI}" = "osx" ] && export PATH="$PATH:/usr/local/bin"

# Launch operations
check_vars

# The FinderSync extension build does not require extra setup
if [ $# -eq 1 ]; then
case "$1" in
"--build-ext")
build_extension
exit 0
;;
esac
fi

# Launch operations
install_pyenv
install_python "${PYTHON_DRIVE_VERSION}"
verify_python "${PYTHON_DRIVE_VERSION}"
Expand Down

0 comments on commit aee71d7

Please sign in to comment.