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 instructions for command line installation on pkg gen #25166

Merged
merged 7 commits into from
Jan 6, 2025
Merged
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
1 change: 1 addition & 0 deletions changes/25004-fleetctl-packge-cli-instructions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Display command line installation instructions when a package is generated
22 changes: 20 additions & 2 deletions cmd/fleetctl/package.go
Original file line number Diff line number Diff line change
Expand Up @@ -377,13 +377,31 @@ func packageCommand() *cli.Command {
}

path, _ = filepath.Abs(path)
pathBase := filepath.Base(path)
var installInstructions = "double-click the installer"
var deviceType string
switch c.String("type") {
case "pkg":
installInstructions += fmt.Sprintf(" or run the command `sudo installer -pkg \"%s\" -target /`", pathBase)
deviceType = "macOS"
case "deb":
installInstructions += fmt.Sprintf(" or run the command `sudo apt install \"%s\"`", pathBase)
deviceType = "Debian-based Linux"
case "rpm":
installInstructions += fmt.Sprintf(" or run the command `sudo dnf install \"%s\"`", pathBase)
deviceType = "RPM-based Linux"
lucasmrod marked this conversation as resolved.
Show resolved Hide resolved
case "msi":
installInstructions += fmt.Sprintf(" or run the command `msiexec /i \"%s\"` as administrator", pathBase)
deviceType = "Windows"
}

fmt.Printf(`
Success! You generated fleetd at %s

To add this device to Fleet, double-click to install fleetd.
To add a new %s device to Fleet, %s.

To add other devices to Fleet, distribute fleetd using Chef, Ansible, Jamf, or Puppet. Learn how: https://fleetdm.com/learn-more-about/enrolling-hosts
`, path)
`, path, deviceType, installInstructions)
if !disableOpenFolder {
open.Start(filepath.Dir(path)) //nolint:errcheck
}
Expand Down
Loading