Skip to content

Commit 2ae3ab2

Browse files
Added reporting for each installation/uninstallation step (#220)
* Added reporting for each installation/uninstallation step * Added CliStepData struct * fixes * added test * Closing segment reporter client before exit * codegen * Passing codefresh user to report.Init()
1 parent 6addc69 commit 2ae3ab2

File tree

14 files changed

+322
-43
lines changed

14 files changed

+322
-43
lines changed

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ COPY . .
4040
ENV GOPATH /go
4141
ENV GOBIN /go/bin
4242

43-
RUN make local DEV_MODE=false
43+
ARG SEGMENT_WRITE_KEY
44+
RUN make local DEV_MODE=false SEGMENT_WRITE_KEY=${SEGMENT_WRITE_KEY}
4445

4546
### Run
4647
FROM alpine:3.13 as codefresh

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION=v0.0.201
1+
VERSION=v0.0.202
22

33
OUT_DIR=dist
44
YEAR?=$(shell date +"%Y")
@@ -19,6 +19,7 @@ GIT_COMMIT=$(shell git rev-parse HEAD)
1919
BUILD_DATE=$(shell date -u +'%Y-%m-%dT%H:%M:%SZ')
2020

2121
DEV_MODE?=true
22+
SEGMENT_WRITE_KEY?=""
2223

2324
ifeq (${DEV_MODE},true)
2425
RUNTIME_DEF_URL=${DEV_RUNTIME_DEF_URL}
@@ -96,6 +97,7 @@ $(OUT_DIR)/$(CLI_NAME)-%: $(CLI_SRCS)
9697
GIT_COMMIT=$(GIT_COMMIT) \
9798
OUT_FILE=$(OUT_DIR)/$(CLI_NAME)-$* \
9899
RUNTIME_DEF_URL=$(RUNTIME_DEF_URL) \
100+
SEGMENT_WRITE_KEY=$(SEGMENT_WRITE_KEY) \
99101
MAIN=./cmd \
100102
./hack/build.sh
101103

cmd/commands/runtime.go

Lines changed: 54 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import (
2626
"time"
2727

2828
"github.com/codefresh-io/cli-v2/pkg/log"
29+
"github.com/codefresh-io/cli-v2/pkg/reporter"
2930
"github.com/codefresh-io/cli-v2/pkg/runtime"
3031
"github.com/codefresh-io/cli-v2/pkg/store"
3132
"github.com/codefresh-io/cli-v2/pkg/util"
@@ -174,6 +175,8 @@ func NewRuntimeInstallCommand() *cobra.Command {
174175
installationOpts.RuntimeName = args[0]
175176
}
176177

178+
createAnalyticsReporter(cmd.Context())
179+
177180
if err := runtimeInstallCommandPreRunHandler(cmd, &installationOpts); err != nil {
178181
return fmt.Errorf("Pre installation error: %w", err)
179182
}
@@ -348,15 +351,16 @@ func createRuntimeOnPlatform(ctx context.Context, opts *model.RuntimeInstallatio
348351

349352
func RunRuntimeInstall(ctx context.Context, opts *RuntimeInstallOptions) error {
350353
var err error
354+
r := reporter.G()
351355

352356
err = preInstallationChecks(ctx, opts)
353-
appendLogToSummary("Pre installation checks", err)
357+
handleCliStep(reporter.InstallStepPreChecks, "Pre installation checks", err)
354358
if err != nil {
355359
return fmt.Errorf("pre installation checks failed: %w", err)
356360
}
357361

358362
rt, err := runtime.Download(opts.Version, opts.RuntimeName)
359-
appendLogToSummary("Downloading runtime definition", err)
363+
handleCliStep(reporter.InstallStepDownloadRuntimeDefinitions, "Downloading runtime definition", err)
360364
if err != nil {
361365
return fmt.Errorf("failed to download runtime definition: %w", err)
362366
}
@@ -367,14 +371,14 @@ func RunRuntimeInstall(ctx context.Context, opts *RuntimeInstallOptions) error {
367371
}
368372

369373
server, err := util.CurrentServer()
370-
appendLogToSummary("Getting current server address", err)
374+
handleCliStep(reporter.InstallStepGetServerAddress, "Getting current server address", err)
371375
if err != nil {
372376
return fmt.Errorf("failed to get current server address: %w", err)
373377
}
374378

375379
componentNames := getComponents(rt, opts)
376380

377-
defer postInstallationHandler(ctx, opts, &err)
381+
defer postInstallationHandler(ctx, opts, &err, r)
378382

379383
token, iv, err := createRuntimeOnPlatform(ctx, &model.RuntimeInstallationArgs{
380384
RuntimeName: opts.RuntimeName,
@@ -384,7 +388,7 @@ func RunRuntimeInstall(ctx context.Context, opts *RuntimeInstallOptions) error {
384388
ComponentNames: componentNames,
385389
Repo: &opts.InsCloneOpts.Repo,
386390
})
387-
appendLogToSummary("Creating runtime on platform", err)
391+
handleCliStep(reporter.InstallStepCreateRuntimeOnPlatform, "Creating runtime on platform", err)
388392
if err != nil {
389393
return util.DecorateErrorWithDocsLink(fmt.Errorf("failed to create a new runtime: %w", err))
390394
}
@@ -407,7 +411,7 @@ func RunRuntimeInstall(ctx context.Context, opts *RuntimeInstallOptions) error {
407411
store.Get().LabelKeyCFType: store.Get().CFComponentType,
408412
},
409413
})
410-
appendLogToSummary("Bootstrapping repository", err)
414+
handleCliStep(reporter.InstallStepBootstrapRepo, "Bootstrapping repository", err)
411415
if err != nil {
412416
return util.DecorateErrorWithDocsLink(fmt.Errorf("failed to bootstrap repository: %w", err))
413417
}
@@ -419,15 +423,15 @@ func RunRuntimeInstall(ctx context.Context, opts *RuntimeInstallOptions) error {
419423
store.Get().LabelKeyCFType: fmt.Sprintf("{{ labels.%s }}", util.EscapeAppsetFieldName(store.Get().LabelKeyCFType)),
420424
},
421425
})
422-
appendLogToSummary("Creating Project", err)
426+
handleCliStep(reporter.InstallStepCreateProject, "Creating Project", err)
423427
if err != nil {
424428
return util.DecorateErrorWithDocsLink(fmt.Errorf("failed to create project: %w", err))
425429
}
426430

427431
// persists codefresh-cm, this must be created before events-reporter eventsource
428432
// otherwise it will not start and no events will get to the platform.
429433
err = persistRuntime(ctx, opts.InsCloneOpts, rt, opts.CommonConfig)
430-
appendLogToSummary("Creating codefresh-cm", err)
434+
handleCliStep(reporter.InstallStepCreateConfigMap, "Creating codefresh-cm", err)
431435
if err != nil {
432436
return util.DecorateErrorWithDocsLink(fmt.Errorf("failed to create codefresh-cm: %w", err))
433437
}
@@ -436,14 +440,14 @@ func RunRuntimeInstall(ctx context.Context, opts *RuntimeInstallOptions) error {
436440
infoStr := fmt.Sprintf("Creating component '%s'", component.Name)
437441
log.G(ctx).Infof(infoStr)
438442
err = component.CreateApp(ctx, opts.KubeFactory, opts.InsCloneOpts, opts.RuntimeName, store.Get().CFComponentType, "", "")
439-
appendLogToSummary(infoStr, err)
443+
handleCliStep(reporter.InstallStepCreateComponent, infoStr, err)
440444
if err != nil {
441445
return util.DecorateErrorWithDocsLink(fmt.Errorf("failed to create '%s' application: %w", component.Name, err))
442446
}
443447
}
444448

445449
err = installComponents(ctx, opts, rt)
446-
appendLogToSummary("Installing components", err)
450+
handleCliStep(reporter.InstallStepInstallComponenets, "Installing components", err)
447451
if err != nil {
448452
return util.DecorateErrorWithDocsLink(fmt.Errorf("failed to install components: %s", err))
449453
}
@@ -457,7 +461,7 @@ func RunRuntimeInstall(ctx context.Context, opts *RuntimeInstallOptions) error {
457461
CreateDemoResources: opts.InstallDemoResources,
458462
IngressHost: opts.IngressHost,
459463
})
460-
appendLogToSummary(gitSrcMessage, err)
464+
handleCliStep(reporter.InstallStepCreateGitsource, gitSrcMessage, err)
461465
if err != nil {
462466
return util.DecorateErrorWithDocsLink(fmt.Errorf("failed to create `%s`: %w", store.Get().GitSourceName, err))
463467
}
@@ -478,19 +482,19 @@ func RunRuntimeInstall(ctx context.Context, opts *RuntimeInstallOptions) error {
478482
Exclude: "**/images/**/*",
479483
Include: "workflows/**/*.yaml",
480484
})
481-
appendLogToSummary(createGitSrcMessgae, err)
485+
handleCliStep(reporter.InstallStepCreateMarketplaceGitsource, createGitSrcMessgae, err)
482486
if err != nil {
483487
return util.DecorateErrorWithDocsLink(fmt.Errorf("failed to create `%s`: %w", store.Get().MarketplaceGitSourceName, err))
484488
}
485489

486490
timeoutErr := intervalCheckIsRuntimePersisted(ctx, opts.RuntimeName)
487-
appendLogToSummary("Completing runtime installation", timeoutErr)
491+
handleCliStep(reporter.InstallStepCompleteRuntimeInstallation, "Completing runtime installation", timeoutErr)
488492
if timeoutErr != nil {
489493
return util.DecorateErrorWithDocsLink(fmt.Errorf("failed to complete installation: %w", timeoutErr))
490494
}
491495

492496
gitIntgErr := addDefaultGitIntegration(ctx, opts.RuntimeName, opts.GitIntegrationOpts)
493-
appendLogToSummary("Creating a default git integration", gitIntgErr)
497+
handleCliStep(reporter.InstallStepCreateDefaultGitIntegration, "Creating a default git integration", gitIntgErr)
494498
if gitIntgErr != nil {
495499
return util.DecorateErrorWithDocsLink(fmt.Errorf("failed to create default git integration: %w", gitIntgErr))
496500
}
@@ -789,9 +793,12 @@ func NewRuntimeUninstallCommand() *cobra.Command {
789793
<BIN> runtime uninstall runtime-name --repo gitops_repo
790794
`),
791795
PreRunE: func(cmd *cobra.Command, args []string) error {
796+
var err error
792797
ctx := cmd.Context()
793798

794-
err := getKubeContextNameFromUserSelect(cmd, &kubeContextName)
799+
createAnalyticsReporter(ctx)
800+
801+
err = getKubeContextNameFromUserSelect(cmd, &kubeContextName)
795802
if err != nil {
796803
return fmt.Errorf("%w", err)
797804
}
@@ -827,7 +834,6 @@ func NewRuntimeUninstallCommand() *cobra.Command {
827834
},
828835
RunE: func(cmd *cobra.Command, args []string) error {
829836
ctx := cmd.Context()
830-
831837
return RunRuntimeUninstall(ctx, &RuntimeUninstallOptions{
832838
RuntimeName: runtimeName,
833839
Timeout: store.Get().WaitTimeout,
@@ -857,7 +863,7 @@ func RunRuntimeUninstall(ctx context.Context, opts *RuntimeUninstallOptions) err
857863
// check whether the runtime exists
858864
if !opts.SkipChecks {
859865
_, err := cfConfig.NewClient().V2().Runtime().Get(ctx, opts.RuntimeName)
860-
appendLogToSummary("Checking if runtime exists", err)
866+
handleCliStep(reporter.UninstallStepCheckRuntimeExists, "Checking if runtime exists", err)
861867
if err != nil {
862868
summaryArr = append(summaryArr, summaryLog{"you can attempt to uninstall again with the \"--skip-checks\" flag", Info})
863869
return err
@@ -874,7 +880,7 @@ func RunRuntimeUninstall(ctx context.Context, opts *RuntimeUninstallOptions) err
874880
Force: opts.Force,
875881
FastExit: opts.FastExit,
876882
})
877-
appendLogToSummary("Uninstalling repo", err)
883+
handleCliStep(reporter.UninstallStepUninstallRepo, "Uninstalling repo", err)
878884
if err != nil {
879885
if !opts.Force {
880886
summaryArr = append(summaryArr, summaryLog{"you can attempt to uninstall again with the \"--force\" flag", Info})
@@ -883,7 +889,7 @@ func RunRuntimeUninstall(ctx context.Context, opts *RuntimeUninstallOptions) err
883889
}
884890

885891
err = deleteRuntimeFromPlatform(ctx, opts)
886-
appendLogToSummary("Deleting runtime from platform", err)
892+
handleCliStep(reporter.UninstallStepDeleteRuntimeFromPlatform, "Deleting runtime from platform", err)
887893
if err != nil {
888894
return fmt.Errorf("failed to delete runtime from the platform: %w", err)
889895
}
@@ -893,7 +899,7 @@ func RunRuntimeUninstall(ctx context.Context, opts *RuntimeUninstallOptions) err
893899
}
894900

895901
uninstallDoneStr := fmt.Sprintf("Done uninstalling runtime '%s'", opts.RuntimeName)
896-
appendLogToSummary(uninstallDoneStr, nil)
902+
handleCliStep(reporter.UninstallStepCompleteRuntimeUninstallation, uninstallDoneStr, nil)
897903

898904
return nil
899905
}
@@ -1533,7 +1539,7 @@ func inferAPIURLForGitProvider(provider apmodel.GitProviders) (string, error) {
15331539
return "", fmt.Errorf("cannot infer api-url for git provider %s, %s", provider, suggest)
15341540
}
15351541

1536-
func postInstallationHandler(ctx context.Context, opts *RuntimeInstallOptions, err *error) {
1542+
func postInstallationHandler(ctx context.Context, opts *RuntimeInstallOptions, err *error, r reporter.AnalyticsReporter) {
15371543
if *err != nil {
15381544
summaryArr = append(summaryArr, summaryLog{"----------Uninstalling runtime----------", Info})
15391545
log.G(ctx).Warn("installation failed, performing installation rollback")
@@ -1554,6 +1560,23 @@ func postInstallationHandler(ctx context.Context, opts *RuntimeInstallOptions, e
15541560
printSummaryToUser()
15551561
}
15561562

1563+
func handleCliStep(event reporter.CliEventType, message string, err error) {
1564+
r := reporter.G()
1565+
status := reporter.SUCCESS
1566+
if err != nil {
1567+
status = reporter.FAILURE
1568+
}
1569+
1570+
r.ReportStep(reporter.CliStepData{
1571+
Event: event,
1572+
Status: status,
1573+
Description: message,
1574+
Err: err,
1575+
})
1576+
1577+
appendLogToSummary(message, err)
1578+
}
1579+
15571580
func appendLogToSummary(message string, err error) {
15581581
if err != nil {
15591582
summaryArr = append(summaryArr, summaryLog{message, Failed})
@@ -1575,3 +1598,13 @@ func printSummaryToUser() {
15751598
//clear array to avoid double printing
15761599
summaryArr = []summaryLog{}
15771600
}
1601+
1602+
func createAnalyticsReporter(ctx context.Context) {
1603+
user, err := cfConfig.GetCurrentContext().GetUser(ctx)
1604+
// If error, it will default to noop reporter
1605+
if err != nil {
1606+
log.G().Debug("Failed to get user from context")
1607+
return
1608+
}
1609+
reporter.Init(user)
1610+
}

cmd/main.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import (
2020

2121
"github.com/codefresh-io/cli-v2/cmd/commands"
2222
"github.com/codefresh-io/cli-v2/pkg/log"
23+
"github.com/codefresh-io/cli-v2/pkg/reporter"
2324
"github.com/codefresh-io/cli-v2/pkg/util"
2425
apu "github.com/codefresh-io/cli-v2/pkg/util/aputil"
2526

@@ -42,6 +43,7 @@ func main() {
4243
apu.ConfigureLoggerOrDie(c)
4344

4445
if err := c.ExecuteContext(ctx); err != nil {
46+
reporter.G().Close()
4547
log.G(ctx).Fatal(err)
4648
}
4749
}

docs/releases/release_notes.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ cf version
2323

2424
```bash
2525
# download and extract the binary
26-
curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.0.201/cf-linux-amd64.tar.gz | tar zx
26+
curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.0.202/cf-linux-amd64.tar.gz | tar zx
2727

2828
# move the binary to your $PATH
2929
mv ./cf-linux-amd64 /usr/local/bin/cf
@@ -36,7 +36,7 @@ cf version
3636

3737
```bash
3838
# download and extract the binary
39-
curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.0.201/cf-darwin-amd64.tar.gz | tar zx
39+
curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.0.202/cf-darwin-amd64.tar.gz | tar zx
4040

4141
# move the binary to your $PATH
4242
mv ./cf-darwin-amd64 /usr/local/bin/cf

go.mod

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,27 @@ require (
99
github.com/argoproj/argo-cd/v2 v2.1.2
1010
github.com/argoproj/argo-events v1.4.0
1111
github.com/argoproj/argo-workflows/v3 v3.1.6
12+
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 // indirect
1213
github.com/briandowns/spinner v1.16.0
13-
github.com/codefresh-io/go-sdk v0.37.5
14+
github.com/codefresh-io/go-sdk v0.37.6
1415
github.com/fatih/color v1.12.0
1516
github.com/ghodss/yaml v1.0.1-0.20190212211648-25d852aebe32
1617
github.com/go-git/go-billy/v5 v5.3.1
1718
github.com/go-git/go-git/v5 v5.4.1
1819
github.com/gobuffalo/packr v1.30.1
20+
github.com/google/uuid v1.1.2
1921
github.com/juju/ansiterm v0.0.0-20180109212912-720a0952cc2a
2022
github.com/lunixbochs/vtclean v1.0.0 // indirect
2123
github.com/manifoldco/promptui v0.8.0
24+
github.com/segmentio/backo-go v1.0.0 // indirect
2225
github.com/sirupsen/logrus v1.8.1
2326
github.com/spf13/cobra v1.1.3
2427
github.com/spf13/pflag v1.0.5
2528
github.com/spf13/viper v1.7.1
2629
github.com/stretchr/testify v1.7.0
30+
github.com/xtgo/uuid v0.0.0-20140804021211-a0b114877d4c // indirect
2731
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 // indirect
32+
gopkg.in/segmentio/analytics-go.v3 v3.1.0
2833
k8s.io/api v0.21.3
2934
k8s.io/apimachinery v0.21.1
3035
k8s.io/client-go v11.0.1-0.20190816222228-6d55c1b1f1ca+incompatible

go.sum

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,8 @@ github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdn
222222
github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
223223
github.com/blushft/go-diagrams v0.0.0-20201006005127-c78c821223d9/go.mod h1:nDeXEIaeDV+mAK1gBD3/RJH67DYPC0GdaznWN7sB07s=
224224
github.com/bmatcuk/doublestar v1.1.1/go.mod h1:UD6OnuiIn0yFxxA2le/rnRU1G4RaI4UvFv1sNto9p6w=
225+
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 h1:DDGfHa7BWjL4YnC6+E63dPcxHo2sUxDIu8g3QgEJdRY=
226+
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4=
225227
github.com/bmizerany/perks v0.0.0-20141205001514-d9a9656a3a4b/go.mod h1:ac9efd0D1fsDb3EJvhqgXRbFx7bs2wqZ10HQPeU8U/Q=
226228
github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps=
227229
github.com/bombsimon/logrusr v1.0.0 h1:CTCkURYAt5nhCCnKH9eLShYayj2/8Kn/4Qg3QfiU+Ro=
@@ -265,8 +267,8 @@ github.com/clusterhq/flocker-go v0.0.0-20160920122132-2b8b7259d313/go.mod h1:P1w
265267
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
266268
github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8=
267269
github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI=
268-
github.com/codefresh-io/go-sdk v0.37.5 h1:1BTUm+gvseUMt2jLKa/wXRp7oG3DyRaIwNtXRhJMpd4=
269-
github.com/codefresh-io/go-sdk v0.37.5/go.mod h1:CcoVmTFWHGkbrSW8LyOGB/vJe5Vzr3iC/pNE2QIBTyg=
270+
github.com/codefresh-io/go-sdk v0.37.6 h1:sc0oPcTcQkP7R98fzqNhaTlC4TviZhx1AQZaQcq92Vg=
271+
github.com/codefresh-io/go-sdk v0.37.6/go.mod h1:CcoVmTFWHGkbrSW8LyOGB/vJe5Vzr3iC/pNE2QIBTyg=
270272
github.com/colinmarc/hdfs v1.1.4-0.20180802165501-48eb8d6c34a9/go.mod h1:0DumPviB681UcSuJErAbDIOx6SIaJWj463TymfZG02I=
271273
github.com/colinmarc/hdfs v1.1.4-0.20180805212432-9746310a4d31/go.mod h1:vSBumefK4HA5uiRSwNP+3ofgrEoScpCS2MMWcWXEuQ4=
272274
github.com/container-storage-interface/spec v1.3.0/go.mod h1:6URME8mwIBbpVyZV93Ce5St17xBiQJQY67NDsuohiy4=
@@ -1156,6 +1158,8 @@ github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdh
11561158
github.com/savsgio/gotils v0.0.0-20200117113501-90175b0fbe3f/go.mod h1:lHhJedqxCoHN+zMtwGNTXWmF0u9Jt363FYRhV6g0CdY=
11571159
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
11581160
github.com/seccomp/libseccomp-golang v0.9.1/go.mod h1:GbW5+tmTXfcxTToHLXlScSlAvWlF4P2Ca7zGrPiEpWo=
1161+
github.com/segmentio/backo-go v1.0.0 h1:kbOAtGJY2DqOR0jfRkYEorx/b18RgtepGtY3+Cpe6qA=
1162+
github.com/segmentio/backo-go v1.0.0/go.mod h1:kJ9mm9YmoWSkk+oQ+5Cj8DEoRCX2JT6As4kEtIIOp1M=
11591163
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
11601164
github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
11611165
github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
@@ -1303,6 +1307,8 @@ github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q
13031307
github.com/xlab/treeprint v0.0.0-20181112141820-a009c3971eca h1:1CFlNzQhALwjS9mBAUkycX616GzgsuYUOCHA5+HSlXI=
13041308
github.com/xlab/treeprint v0.0.0-20181112141820-a009c3971eca/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg=
13051309
github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q=
1310+
github.com/xtgo/uuid v0.0.0-20140804021211-a0b114877d4c h1:3lbZUMbMiGUW/LMkfsEABsc5zNT9+b1CvsJx47JzJ8g=
1311+
github.com/xtgo/uuid v0.0.0-20140804021211-a0b114877d4c/go.mod h1:UrdRz5enIKZ63MEE3IF9l2/ebyx59GyGgPi+tICQdmM=
13061312
github.com/yahoo/athenz v1.8.55/go.mod h1:G7LLFUH7Z/r4QAB7FfudfuA7Am/eCzO1GlzBhDL6Kv0=
13071313
github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0/go.mod h1:/LWChgwKmvncFJFHJ7Gvn9wZArjbV5/FppcK2fKk/tI=
13081314
github.com/yudai/gojsondiff v1.0.0/go.mod h1:AY32+k2cwILAkW1fbgxQ5mUmMiZFgLIV+FBNExI05xg=
@@ -1847,6 +1853,8 @@ gopkg.in/mcuadros/go-syslog.v2 v2.2.1/go.mod h1:l5LPIyOOyIdQquNg+oU6Z3524YwrcqEm
18471853
gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA=
18481854
gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k=
18491855
gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo=
1856+
gopkg.in/segmentio/analytics-go.v3 v3.1.0 h1:UzxH1uaGZRpMKDhJyBz0pexz6yUoBU3x8bJsRk/HV6U=
1857+
gopkg.in/segmentio/analytics-go.v3 v3.1.0/go.mod h1:4QqqlTlSSpVlWA9/9nDcPw+FkM2yv1NQoYjUbL9/JAw=
18501858
gopkg.in/square/go-jose.v2 v2.2.2/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI=
18511859
gopkg.in/square/go-jose.v2 v2.4.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI=
18521860
gopkg.in/square/go-jose.v2 v2.5.1 h1:7odma5RETjNHWJnR32wx8t+Io4djHE1PqxCFx3iiZ2w=

hack/build.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@ go build -ldflags=" \
1313
-X 'github.com/codefresh-io/cli-v2/pkg/store.version=${VERSION}' \
1414
-X 'github.com/codefresh-io/cli-v2/pkg/store.buildDate=${BUILD_DATE}' \
1515
-X 'github.com/codefresh-io/cli-v2/pkg/store.gitCommit=${GIT_COMMIT}' \
16-
-X 'github.com/codefresh-io/cli-v2/pkg/store.RuntimeDefURL=${RUNTIME_DEF_URL}'" \
16+
-X 'github.com/codefresh-io/cli-v2/pkg/store.RuntimeDefURL=${RUNTIME_DEF_URL}' \
17+
-X 'github.com/codefresh-io/cli-v2/pkg/store.segmentWriteKey=${SEGMENT_WRITE_KEY}'" \
1718
-v -o ${OUT_FILE} ${MAIN}

0 commit comments

Comments
 (0)