Skip to content

Commit 4f80a99

Browse files
committed
feat: rename bundle to product in all instances
1 parent b43c81e commit 4f80a99

File tree

4 files changed

+24
-25
lines changed

4 files changed

+24
-25
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
[![Go Report Card](https://goreportcard.com/badge/github.com/relizaio/rearm-cli)](https://goreportcard.com/report/github.com/relizaio/rearm-cli)
33
# Rearm CLI
44

5-
This tool allows for command-line interactions with [ReARM at relizahub.com](https://relizahub.com) (currently in public preview mode). Particularly, Rearm CLI can stream metadata about instances, releases, artifacts, resolve bundles based on ReARM data. Available as either a Docker image or binary.
5+
This tool allows for command-line interactions with [ReARM at relizahub.com](https://relizahub.com) (currently in public preview mode). Particularly, Rearm CLI can stream metadata about instances, releases, artifacts, resolve products based on ReARM data. Available as either a Docker image or binary.
66

77
Video tutorial about key functionality of ReARM is available on [YouTube](https://www.youtube.com/watch?v=yDlf5fMBGuI).
88

@@ -42,7 +42,7 @@ It is possible to set authentication data via explicit flags, login command (see
4242
1. [Get Version Assignment From ReARM](#1-use-case-get-version-assignment-from-rearm-hub)
4343
2. [Send Release Metadata to ReARM](#2-use-case-send-release-metadata-to-rearm-hub)
4444
3. [Check If Artifact Hash Already Present In Some Release](#3-use-case-check-if-artifact-hash-already-present-in-some-release)
45-
4. [Request Latest Release Per Component Or Bundle](#6-use-case-request-latest-release-per-component-or-bundle)
45+
4. Request Latest Release Per Component Or Product
4646
6. [Persist ReARM Credentials in a Config File](#10-use-case-persist-rearm-hub-credentials-in-a-config-file)
4747
8. [Create New Component in ReARM](#12-use-case-create-new-component-in-rearm-hub)
4848
9. [Add new artifacts to release in ReARM](#14-use-case-add-new-artifacts-to-release-in-rearm-hub)
@@ -207,9 +207,9 @@ Flags stand for:
207207
- **--hash** - flag to denote actual hash (required). By convention, hash must include hashing algorithm as its first part, i.e. sha256: or sha512:
208208
- **--component** - flag to denote UUID of specific Component, UUID must be obtained from ReARM (optional, required if org-wide or user api key is used).
209209

210-
## 6. Use Case: Request Latest Release Per Component Or Bundle
210+
## 6. Use Case: Request Latest Release Per Component Or Product
211211

212-
This use case is when ReARM is queried either by CI or CD environment or by integration instance to check latest release version available per specific Component or Bundle.
212+
This use case is when ReARM is queried either by CI or CD environment or by integration instance to check latest release version available per specific Component or Product.
213213

214214
Sample command:
215215

@@ -225,12 +225,12 @@ docker run --rm relizaio/rearm-cli \
225225

226226
Flags stand for:
227227

228-
- **getlatestrelease** - command that denotes we are requesting latest release data for Component or Bundle from ReARM
228+
- **getlatestrelease** - command that denotes we are requesting latest release data for Component or Product from ReARM
229229
- **-i** - flag for api id which can be either api id for this component or organization-wide read API (required).
230230
- **-k** - flag for api key which can be either api key for this component or organization-wide read API (required).
231-
- **--component** - flag to denote UUID of specific Component or Bundle, UUID must be obtained from [ReARM](https://relizahub.com) (optional if component api key is used, otherwise required).
232-
- **--bundle** - flag to denote UUID of Bundle which packages Component or Bundle for which we inquiry about its version via --component flag, UUID must be obtained from [ReARM](https://relizahub.com) (optional).
233-
- **--branch** - flag to denote required branch of chosen Component or Bundle (optional, if not supplied settings from ReARM UI are used).
231+
- **--component** - flag to denote UUID of specific Component or Product, UUID must be obtained from [ReARM](https://relizahub.com) (optional if component api key is used, otherwise required).
232+
- **--product** - flag to denote UUID of Product which packages Component or Product for which we inquiry about its version via --component flag, UUID must be obtained from [ReARM](https://relizahub.com) (optional).
233+
- **--branch** - flag to denote required branch of chosen Component or Product (optional, if not supplied settings from ReARM UI are used).
234234
- **--env** - flag to denote environment to which release approvals should match. Environment can be one of: DEV, BUILD, TEST, SIT, UAT, PAT, STAGING, PRODUCTION. If not supplied, latest release will be returned regardless of approvals (optional).
235235
- **--tagkey** - flag to denote tag key to use as a selector for artifact (optional, if provided tagval flag must also be supplied). Note that currently only single tag is supported.
236236
- **--tagval** - flag to denote tag value to use as a selector for artifact (optional, if provided tagkey flag must also be supplied).
@@ -300,7 +300,7 @@ Flags stand for:
300300
- **-i** - flag for org api id (required).
301301
- **-k** - flag for org api key (required).
302302
- **name** - flag to denote component name (required).
303-
- **type** - flag to denote component type (required). Supported values: component, bundle.
303+
- **type** - flag to denote component type (required). Supported values: component, product.
304304
- **defaultbranch** - flag to denote default branch name (optional, if not set "main" will be used). Available names are either main or master.
305305
- **versionschema** - flag to denote version schema (optional, if not set "semver" will be used). [Available version schemas](https://github.com/relizaio/versioning).
306306
- **featurebranchversioning** - flag to denote feature branch version schema (optional, if not set "Branch.Micro will be used).

cmd/getLatestRelease.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,16 @@ type ConditionGroupOnReleaseInput struct {
4747

4848
var getLatestReleaseCmd = &cobra.Command{
4949
Use: "getlatestrelease",
50-
Short: "Obtains latest release for Component or Bundle",
50+
Short: "Obtains latest release for Component or Product",
5151
Long: `This CLI command would connect to ReARM and would obtain latest release for specified Component and Branch
52-
or specified Bundle and Feature Set.`,
52+
or specified Product and Feature Set.`,
5353
Run: func(cmd *cobra.Command, args []string) {
54-
getLatestReleaseFunc(debug, rearmUri, component, bundle, branch, tagKey, tagVal, apiKeyId, apiKey, lifecycle)
54+
getLatestReleaseFunc(debug, rearmUri, component, product, branch, tagKey, tagVal, apiKeyId, apiKey, lifecycle)
5555
},
5656
}
5757

5858

59-
func getLatestReleaseFunc(debug string, rearmUri string, component string, bundle string, branch string,
59+
func getLatestReleaseFunc(debug string, rearmUri string, component string, product string, branch string,
6060
tagKey string, tagVal string, apiKeyId string, apiKey string, lifecycle string) []byte {
6161
if debug == "true" {
6262
fmt.Println("Using ReARM at", rearmUri)

cmd/root.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ var odelPackage []string
7070

7171
// var odelName []string
7272
var branch string
73-
var bundle string
7473
var product string
7574
var cfgFile string
7675
var closedDate string
@@ -1072,8 +1071,8 @@ var createComponentCmd = &cobra.Command{
10721071
body := map[string]interface{}{"name": componentName}
10731072
if len(componentType) > 0 {
10741073
body["type"] = strings.ToUpper(componentType)
1075-
if strings.ToUpper(componentType) == "BUNDLE" {
1076-
body["type"] = "BUNDLE"
1074+
if strings.ToUpper(componentType) == "PRODUCT" {
1075+
body["type"] = "PRODUCT"
10771076
}
10781077
}
10791078
if len(defaultBranch) > 0 {
@@ -1432,14 +1431,14 @@ func init() {
14321431
// flags for is approval needed check command
14331432
downloadableArtifactCmd.PersistentFlags().StringVar(&releaseId, "releaseid", "", "UUID of release (either releaseid or releaseversion and component must be set)")
14341433
downloadableArtifactCmd.PersistentFlags().StringVar(&releaseVersion, "releaseversion", "", "Version of release (either releaseid or releaseversion and component must be set)")
1435-
downloadableArtifactCmd.PersistentFlags().StringVar(&component, "component", "", "UUID of component or bundle for release (either instance and component or releaseid or releaseversion and component must be set)")
1434+
downloadableArtifactCmd.PersistentFlags().StringVar(&component, "component", "", "UUID of component or product for release (either instance and component or releaseid or releaseversion and component must be set)")
14361435
downloadableArtifactCmd.PersistentFlags().StringVarP(&filePath, "file", "f", "", "Path to the artifact")
14371436
// downloadableArtifactCmd.PersistentFlags().StringVar(&odelType, "odelType", "GENERIC", "Type of artifact - can be (TEST_REPORT, SECURITY_SCAN, DOCUMENTATION, GENERIC) or some user defined value")
14381437

14391438
// flags for createcomponent command
14401439
createComponentCmd.PersistentFlags().StringVar(&componentName, "name", "", "Name of component to create")
14411440
createComponentCmd.MarkPersistentFlagRequired("name")
1442-
createComponentCmd.PersistentFlags().StringVar(&componentType, "type", "", "Specify to create either a component or bundle")
1441+
createComponentCmd.PersistentFlags().StringVar(&componentType, "type", "", "Specify to create either a component or product")
14431442
createComponentCmd.MarkPersistentFlagRequired("type")
14441443
createComponentCmd.PersistentFlags().StringVar(&defaultBranch, "defaultbranch", "main", "Default branch name of component, default set to main. Available names are either main or master.")
14451444
createComponentCmd.PersistentFlags().StringVar(&versionSchema, "versionschema", "semver", "Version schema of component, default set to semver. Available version schemas: https://github.com/relizaio/versioning")

cmd/templating.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,23 @@ import (
99
"github.com/machinebox/graphql"
1010
)
1111

12-
func getBundleVersionCycloneDxExportV1(apiKeyId string, apiKey string, bundle string,
12+
func getProductVersionCycloneDxExportV1(apiKeyId string, apiKey string, product string,
1313
environment string, version string) []byte {
1414

15-
if len(bundle) <= 0 && (len(version) <= 0 || len(environment) <= 0) {
15+
if len(product) <= 0 && (len(version) <= 0 || len(environment) <= 0) {
1616
//throw error and exit
17-
fmt.Println("Error: Bundle name and either version or environment must be provided!")
17+
fmt.Println("Error: Product name and either version or environment must be provided!")
1818
os.Exit(1)
1919
}
2020

2121
client := graphql.NewClient(rearmUri + "/graphql")
2222
req := graphql.NewRequest(`
23-
query ($bundleName: String!, $bundleVersion: String, $environment: String) {
24-
exportAsBomProg(bundleName: $bundleName, bundleVersion: $bundleVersion, environment: $environment)
23+
query ($productName: String!, $productVersion: String, $environment: String) {
24+
exportAsBomProg(productName: $productName, productVersion: $productVersion, environment: $environment)
2525
}
2626
`)
27-
req.Var("bundleName", bundle)
28-
req.Var("bundleVersion", version)
27+
req.Var("productName", product)
28+
req.Var("productVersion", version)
2929
req.Var("environment", environment)
3030
req.Header.Set("Content-Type", "application/json")
3131
req.Header.Set("User-Agent", "Reliza Go Client")

0 commit comments

Comments
 (0)