diff options
-rw-r--r-- | .expeditor/config.yml | 4 | ||||
-rw-r--r-- | .expeditor/macos_universal_package.pipeline.yml | 18 | ||||
-rwxr-xr-x | .expeditor/scripts/create_mac_universal_pkg.sh | 37 |
3 files changed, 59 insertions, 0 deletions
diff --git a/.expeditor/config.yml b/.expeditor/config.yml index d249264afa..fbbd1393c9 100644 --- a/.expeditor/config.yml +++ b/.expeditor/config.yml @@ -54,6 +54,9 @@ pipelines: definition: .expeditor/adhoc-canary.omnibus.yml env: - ADHOC: true + - macos_universal_package: + description: Builds universal macos package using arch specific packages + definition: .expeditor/macos_universal_package.pipeline.yml github: # This deletes the GitHub PR branch after successfully merged into the release branch @@ -86,6 +89,7 @@ subscriptions: - workload: artifact_published:unstable:chef:{{version_constraint}} actions: - trigger_pipeline:docker/build + - trigger_pipelie:macos_universal_package - workload: artifact_published:current:chef:{{version_constraint}} actions: - bash:.expeditor/promote-docker-images.sh diff --git a/.expeditor/macos_universal_package.pipeline.yml b/.expeditor/macos_universal_package.pipeline.yml new file mode 100644 index 0000000000..8617d418c1 --- /dev/null +++ b/.expeditor/macos_universal_package.pipeline.yml @@ -0,0 +1,18 @@ +--- +expeditor: + defaults: + buildkite: + timeout_in_minutes: 60 + retry: + automatic: + limit: 1 + +steps: + +- label: ":mac: Create universal macos package" + commands: + - ./.expeditor/scripts/create_mac_universal_pkg.sh + expeditor: + executor: + macos: + os-version: "11" diff --git a/.expeditor/scripts/create_mac_universal_pkg.sh b/.expeditor/scripts/create_mac_universal_pkg.sh new file mode 100755 index 0000000000..3b9b846470 --- /dev/null +++ b/.expeditor/scripts/create_mac_universal_pkg.sh @@ -0,0 +1,37 @@ +#!/bin/sh + +mkdir -p ./stage/pkg/tmp/chef-pkgs +mkdir -p ./stage/script + +pushd ./stage/pkg/tmp/chef-pkgs + +curl -O https://packages.chef.io/files/current/chef/18.0.92/mac_os_x/11/chef-18.0.92-1.x86_64.dmg +hdiutil attach chef-18.0.92-1.x86_64.dmg +cp /Volumes/Chef\ Infra\ Client/chef-18.0.92-1.x86_64.pkg ./ +hdiutil detach /Volumes/Chef\ Infra\ Client +rm chef-18.0.92-1.x86_64.dmg + +curl -O https://packages.chef.io/files/current/chef/18.0.92/mac_os_x/11/chef-18.0.92-1.arm64.dmg +hdiutil attach chef-18.0.92-1.arm64.dmg +cp /Volumes/Chef\ Infra\ Client/chef-18.0.92-1.arm64.pkg ./ +hdiutil detach /Volumes/Chef\ Infra\ Client +rm chef-18.0.92-1.arm64.dmg + +popd + +cat << EOF > ./stage/script/postinstall +#!/bin/sh + +if [ `uname -m` == 'x86_64' ] +then + installer -pkg /tmp/chef-pkgs/chef-18.0.92-1.x86_64.pkg -target LocalSystem -verbose +elif [ `uname -m` == 'arm64' ] +then + installer -pkg /tmp/chef-pkgs/chef-18.0.92-1.arm64.pkg -target LocalSystem -verbose +fi +EOF + +chmod +x ./stage/script/postinstall + +pkgbuild --root stage/pkg --scripts stage/script --identifier "io.chef.infra-client.wrapper" \ + --version "18.0.92" --install-location / --min-os-version 10.15 stage/pkg/chef-18.0.92-1.universal.pkg |