From 2215c8304658a72e4dcf979977a94c554e161fb7 Mon Sep 17 00:00:00 2001 From: eti-codefresh Date: Tue, 8 Nov 2022 14:57:18 +0200 Subject: [PATCH 1/2] cr-15431 --- Makefile | 2 +- cmd/commands/git-source.go | 3 ++- docs/releases/release_notes.md | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index cd54f5d11..da81db5b0 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -VERSION=v0.1.3 +VERSION=v0.1.4 OUT_DIR=dist YEAR?=$(shell date +"%Y") diff --git a/cmd/commands/git-source.go b/cmd/commands/git-source.go index 970a6f273..36581b667 100644 --- a/cmd/commands/git-source.go +++ b/cmd/commands/git-source.go @@ -585,6 +585,7 @@ func RunGitSourceEdit(ctx context.Context, opts *GitSourceEditOptions) error { func createDemoResources(ctx context.Context, opts *GitSourceCreateOptions, gsRepo git.Repository, gsFs fs.FS) error { fi, err := gsFs.ReadDir(".") + rt, err := preInstallationChecks(ctx, opts) if err != nil { return fmt.Errorf("failed to read files in git-source repo. Err: %w", err) } @@ -605,7 +606,7 @@ func createDemoResources(ctx context.Context, opts *GitSourceCreateOptions, gsRe return fmt.Errorf("failed to create calendar example pipeline. Error: %w", err) } - if opts.AccessMode == platmodel.AccessModeIngress { + if opts.AccessMode == platmodel.AccessModeIngress && rt.Spec.Version < 0.0.561 { err = createDemoGitPipeline(&gitSourceGitDemoPipelineOptions{ runtimeName: opts.RuntimeName, gsCloneOpts: opts.GsCloneOpts, diff --git a/docs/releases/release_notes.md b/docs/releases/release_notes.md index b8d48c19e..65f8874f0 100644 --- a/docs/releases/release_notes.md +++ b/docs/releases/release_notes.md @@ -23,7 +23,7 @@ cf version ```bash # download and extract the binary -curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.1.2/cf-linux-amd64.tar.gz | tar zx +curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.1.4/cf-linux-amd64.tar.gz | tar zx # move the binary to your $PATH mv ./cf-linux-amd64 /usr/local/bin/cf @@ -36,7 +36,7 @@ cf version ```bash # download and extract the binary -curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.1.2/cf-darwin-amd64.tar.gz | tar zx +curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.1.4/cf-darwin-amd64.tar.gz | tar zx # move the binary to your $PATH mv ./cf-darwin-amd64 /usr/local/bin/cf From 561be02df78203ddba7ea5ac2cc1e107e587fc9b Mon Sep 17 00:00:00 2001 From: eti-codefresh Date: Tue, 8 Nov 2022 17:29:39 +0200 Subject: [PATCH 2/2] cr-15431 --- cmd/commands/git-source.go | 39 ++++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/cmd/commands/git-source.go b/cmd/commands/git-source.go index 36581b667..cd90f9661 100644 --- a/cmd/commands/git-source.go +++ b/cmd/commands/git-source.go @@ -585,7 +585,6 @@ func RunGitSourceEdit(ctx context.Context, opts *GitSourceEditOptions) error { func createDemoResources(ctx context.Context, opts *GitSourceCreateOptions, gsRepo git.Repository, gsFs fs.FS) error { fi, err := gsFs.ReadDir(".") - rt, err := preInstallationChecks(ctx, opts) if err != nil { return fmt.Errorf("failed to read files in git-source repo. Err: %w", err) } @@ -606,26 +605,24 @@ func createDemoResources(ctx context.Context, opts *GitSourceCreateOptions, gsRe return fmt.Errorf("failed to create calendar example pipeline. Error: %w", err) } - if opts.AccessMode == platmodel.AccessModeIngress && rt.Spec.Version < 0.0.561 { - err = createDemoGitPipeline(&gitSourceGitDemoPipelineOptions{ - runtimeName: opts.RuntimeName, - gsCloneOpts: opts.GsCloneOpts, - gitProvider: opts.GitProvider, - gsFs: gsFs, - hostName: opts.HostName, - skipIngress: opts.SkipIngress, - ingressHost: opts.IngressHost, - ingressClass: opts.IngressClass, - ingressController: opts.IngressController, - accessMode: opts.AccessMode, - gatewayName: opts.GatewayName, - gatewayNamespace: opts.GatewayNamespace, - useGatewayAPI: opts.useGatewayAPI, - }) - if err != nil { - return fmt.Errorf("failed to create github example pipeline. Error: %w", err) - } - } + err = createDemoGitPipeline(&gitSourceGitDemoPipelineOptions{ + runtimeName: opts.RuntimeName, + gsCloneOpts: opts.GsCloneOpts, + gitProvider: opts.GitProvider, + gsFs: gsFs, + hostName: opts.HostName, + skipIngress: opts.SkipIngress, + ingressHost: opts.IngressHost, + ingressClass: opts.IngressClass, + ingressController: opts.IngressController, + accessMode: opts.AccessMode, + gatewayName: opts.GatewayName, + gatewayNamespace: opts.GatewayNamespace, + useGatewayAPI: opts.useGatewayAPI, + }) + if err != nil { + return fmt.Errorf("failed to create github example pipeline. Error: %w", err) + } commitMsg := fmt.Sprintf("Created demo pipelines in %s Directory", opts.GsCloneOpts.Path())