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

Add MacOS installer to packaging #7481

Merged
merged 2 commits into from
Jul 3, 2018

Conversation

andrewkroh
Copy link
Member

@andrewkroh andrewkroh commented Jun 30, 2018

This adds the creation of a .dmg files when building packages on MacOS (the
build host must be darwin with XCode installed). The .dmg file contains an
installer (.pkg) and a rudimentary Uninstall.app. When code signing is enabled
every part of the .dmg is signed. This is the structure of the package.

  • beat.dmg
    • beat.pkg
      • internal-beat.pkg
      • BeatPrefPane.pkg
    • Uninstall.app

The following environment variables control the code signing behavior.

  • APPLE_SIGNING_ENABLED - Must be set to true to enable signing. Defaults to
    false.
  • APPLE_SIGNING_IDENTITY_INSTALLER - filter for selecting the signing identity
    for installers. It's effectively used as
    security find-identity -v | grep $APPLE_SIGNING_IDENTITY_INSTALLER to
    select a single certificate.
  • APPLE_SIGNING_IDENTITY_APP - filter for selecting the signing identity
    for apps.

Co-authored-by: Adrian Serrano @adriansr

Screenshots of the installed package: #6053 (comment)

@andrewkroh andrewkroh added in progress Pull request is currently in progress. Packaging labels Jun 30, 2018
@@ -762,3 +803,16 @@ func addFileToTar(ar *tar.Writer, baseDir string, pkgFile PackageFile) error {
return file.Close()
})
}

func PackageDMG(spec PackageSpec) error {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exported function PackageDMG should have comment or be unexported

@@ -762,3 +803,16 @@ func addFileToTar(ar *tar.Writer, baseDir string, pkgFile PackageFile) error {
return file.Close()
})
}

func PackageDMG(spec PackageSpec) error {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exported function PackageDMG should have comment or be unexported

@andrewkroh
Copy link
Member Author

I kicked off a build at https://beats-ci.elastic.co/job/elastic+beats+pull-request+package/38/console.

This is with APPLE_SIGNING_ENABLED=false (default). I'll do another test later with that enabled.

@andrewkroh andrewkroh force-pushed the feature/osx-pkg-dmg branch 2 times, most recently from 3b5dd90 to 0be8d48 Compare June 30, 2018 06:10
@andrewkroh
Copy link
Member Author

andrewkroh commented Jul 1, 2018

@andrewkroh andrewkroh force-pushed the feature/osx-pkg-dmg branch 2 times, most recently from a50795a to 7818449 Compare July 1, 2018 21:44
@andrewkroh andrewkroh added review and removed in progress Pull request is currently in progress. labels Jul 1, 2018
@adriansr adriansr self-requested a review July 3, 2018 12:12
Copy link
Contributor

@adriansr adriansr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work @andrewkroh

andrewkroh and others added 2 commits July 3, 2018 09:37
This adds the creation of a .dmg files when building packages on MacOS (the
build host must be darwin with XCode installed). The .dmg file contains an
installer (.pkg) and a rudimentary Uninstall.app.  When code signing is enabled
every part of the .dmg is signed. This is the structure of the package.

- beat.dmg
  - beat.pkg
    - internal-beat.pkg
    - BeatPrefPane.pkg
  - Uninstall.app

The following environment variables control the code signing behavior.

- APPLE_SIGNING_ENABLED - Must be set to true to enable signing. Defaults to
  false.
- APPLE_SIGNING_IDENTITY_INSTALLER - filter for selecting the signing identity
  for installers. It's effectively used as
  `security find-identity -v | grep $APPLE_SIGNING_IDENTITY_INSTALLER` to
  select a single certificate.
- APPLE_SIGNING_IDENTITY_APP - filter for selecting the signing identity
  for apps.

Co-authored-by:  Adrian Serrano <adrisr83@gmail.com>
@andrewkroh
Copy link
Member Author

Rebased to resolve conflicts with the Filebeat modules fix. This should be good to go after the packaging job completes.

Build: https://beats-ci.elastic.co/job/elastic+beats+pull-request+package/46/console

@adriansr adriansr merged commit e80307a into elastic:master Jul 3, 2018
@andrewkroh andrewkroh deleted the feature/osx-pkg-dmg branch July 3, 2018 23:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants