Skip to content

Commit

Permalink
Legacy Naming for Mondoo Cask (#23)
Browse files Browse the repository at this point in the history
Changing the name will leave existing customers in a lurch, this
duplicates the package so people can transition to the new shorter cask
name.

---------

Signed-off-by: Ben Rockwood <[email protected]>
  • Loading branch information
benr authored Oct 5, 2023
1 parent ffd8396 commit 6e88afd
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 38 deletions.
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,6 @@ jobs:
git add Formula/cnquery.rb
git add Formula/cnspec.rb
git add Casks/mondoo-cli.rb
git add Casks/mondoo.rb
git commit -m '${{ steps.version.outputs.version }}'
git push origin master
33 changes: 0 additions & 33 deletions Casks/mondoo-cli.rb

This file was deleted.

3 changes: 2 additions & 1 deletion Casks/mondoo.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@

# Copyright (c) Mondoo, Inc.
# SPDX-License-Identifier: BUSL-1.1

cask "mondoo" do
cask mondoo do
name "Mondoo"
desc "Mondoo Enterprise Package for cnquery and cnspec"
version "9.0.0"
Expand Down
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
update:
cd generator && go run . formula cnquery > ../Formula/cnquery.rb
cd generator && go run . formula cnspec > ../Formula/cnspec.rb
cd generator && go run . cask mondoo> ../Casks/mondoo-cli.rb
cd generator && go run . formula cnspec > ../Formula/cnspec.rb
cd generator && go run . cask mondoo-cli > ../Casks/mondoo-cli.rb # Backwards compatibility
cd generator && go run . cask mondoo > ../Casks/mondoo.rb

# Copywrite Check Tool: https://github.com/hashicorp/copywrite
license: license/headers/check
Expand Down
3 changes: 2 additions & 1 deletion generator/cask.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
)

type Cask struct {
Pkg string `json:"pkg"`
Desc string `json:"desc"`
Homepage string `json:"homepage"`
Version string `json:"version"`
Expand All @@ -20,7 +21,7 @@ var caskTemplate = `
# Copyright (c) Mondoo, Inc.
# SPDX-License-Identifier: BUSL-1.1
cask "mondoo" do
cask {{ .Pkg }} do
name "Mondoo"
desc "{{ .Desc }}"
version "{{ .Version }}"
Expand Down
13 changes: 12 additions & 1 deletion generator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,25 @@ type product struct {
homepage string
binary string
class string
pkg string
}

var products = map[string]product{
"mondoo": {
latestUrl: "https://releases.mondoo.com/mondoo/latest.json?ignoreCache=1",
desc: "Mondoo Client CLI for the Mondoo Policy as Code Platform",
desc: "Mondoo Enterprise Package for cnquery and cnspec",
homepage: "https://mondoo.com",
binary: "mondoo",
class: "Mondoo",
pkg: "mondoo",
},
"mondoo-cli": {
latestUrl: "https://releases.mondoo.com/mondoo/latest.json?ignoreCache=1",
desc: "Mondoo Enterprise Package for cnquery and cnspec",
homepage: "https://mondoo.com",
binary: "mondoo",
class: "Mondoo",
pkg: "mondoo-cli",
},
"cnquery": {
latestUrl: "https://releases.mondoo.com/cnquery/latest.json?ignoreCache=1",
Expand Down Expand Up @@ -90,6 +100,7 @@ func main() {
formula.Render(buf)
case "cask":
cask := &Cask{
Pkg: product.pkg,
Desc: product.desc,
Homepage: product.homepage,
Binary: product.binary,
Expand Down

0 comments on commit 6e88afd

Please sign in to comment.