Skip to content

Commit e88dc4e

Browse files
authored
CR-16910 fix repo sub path + windows (#669)
* use full install repo for *-reporter base * fix windows path building * fixed building windows .exe file * bump github.com/argoproj/argo-cd/v2 to 2.5.9 * bump github.com/argoproj-labs/argocd-autopilot to 0.4.11 * bumped version to 0.1.29
1 parent 33a6670 commit e88dc4e

File tree

5 files changed

+21
-22
lines changed

5 files changed

+21
-22
lines changed

Makefile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION=v0.1.28
1+
VERSION=v0.1.29
22

33
OUT_DIR=dist
44
YEAR?=$(shell date +"%Y")
@@ -84,11 +84,15 @@ cli-package: $(OUT_DIR)/$(CLI_NAME)-$(shell go env GOOS)-$(shell go env GOARCH)
8484
$(OUT_DIR)/$(CLI_NAME)-linux-amd64: GO_FLAGS='GOOS=linux GOARCH=amd64 CGO_ENABLED=0'
8585
$(OUT_DIR)/$(CLI_NAME)-darwin-amd64: GO_FLAGS='GOOS=darwin GOARCH=amd64 CGO_ENABLED=0'
8686
$(OUT_DIR)/$(CLI_NAME)-darwin-arm64: GO_FLAGS='GOOS=darwin GOARCH=arm64 CGO_ENABLED=0'
87-
$(OUT_DIR)/$(CLI_NAME)-windows-amd64: GO_FLAGS='GOOS=windows GOARCH=amd64 CGO_ENABLED=0'
87+
$(OUT_DIR)/$(CLI_NAME)-windows-amd64.exe: GO_FLAGS='GOOS=windows GOARCH=amd64 CGO_ENABLED=0'
8888
$(OUT_DIR)/$(CLI_NAME)-linux-arm64: GO_FLAGS='GOOS=linux GOARCH=arm64 CGO_ENABLED=0'
8989
$(OUT_DIR)/$(CLI_NAME)-linux-ppc64le: GO_FLAGS='GOOS=linux GOARCH=ppc64le CGO_ENABLED=0'
9090
$(OUT_DIR)/$(CLI_NAME)-linux-s390x: GO_FLAGS='GOOS=linux GOARCH=s390x CGO_ENABLED=0'
9191

92+
$(OUT_DIR)/$(CLI_NAME)-windows-amd64.tar.gz:
93+
@make $(OUT_DIR)/$(CLI_NAME)-windows-amd64.exe
94+
cd $(OUT_DIR) && tar -czvf $(CLI_NAME)-windows-amd64.tar.gz $(CLI_NAME)-windows-amd64.exe && cd ..
95+
9296
$(OUT_DIR)/$(CLI_NAME)-%.tar.gz:
9397
@make $(OUT_DIR)/$(CLI_NAME)-$*
9498
cd $(OUT_DIR) && tar -czvf $(CLI_NAME)-$*.tar.gz $(CLI_NAME)-$* && cd ..

cmd/commands/runtime_install.go

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import (
2424
"net"
2525
"net/url"
2626
"os"
27+
"path"
2728
"strconv"
2829
"strings"
2930
"sync"
@@ -1631,16 +1632,13 @@ func applySecretsToCluster(ctx context.Context, opts *RuntimeInstallOptions) err
16311632
}
16321633

16331634
func createEventsReporter(ctx context.Context, cloneOpts *apgit.CloneOptions, opts *RuntimeInstallOptions) error {
1634-
resPath := cloneOpts.FS.Join(apstore.Default.AppsDir, store.Get().EventsReporterName, opts.RuntimeName, "resources")
1635-
u, err := url.Parse(cloneOpts.URL())
1635+
u, err := url.Parse(cloneOpts.Repo)
16361636
if err != nil {
16371637
return fmt.Errorf("failed to parse url: %w", err)
16381638
}
1639-
u.Path += "/" + resPath
1640-
q := u.Query()
1641-
q.Add("ref", cloneOpts.Revision())
1642-
u.RawQuery = q.Encode()
16431639

1640+
resPath := path.Join(apstore.Default.AppsDir, store.Get().EventsReporterName, opts.RuntimeName, "resources")
1641+
u = u.JoinPath(resPath)
16441642
appDef := &runtime.AppDef{
16451643
Name: store.Get().EventsReporterName,
16461644
Type: application.AppTypeDirectory,
@@ -1676,16 +1674,13 @@ func createEventsReporter(ctx context.Context, cloneOpts *apgit.CloneOptions, op
16761674
}
16771675

16781676
func createReporter(ctx context.Context, cloneOpts *apgit.CloneOptions, opts *RuntimeInstallOptions, reporterCreateOpts reporterCreateOptions) error {
1679-
resPath := cloneOpts.FS.Join(apstore.Default.AppsDir, reporterCreateOpts.reporterName, opts.RuntimeName, "resources")
1680-
u, err := url.Parse(cloneOpts.URL())
1677+
u, err := url.Parse(cloneOpts.Repo)
16811678
if err != nil {
16821679
return fmt.Errorf("failed to parse url: %w", err)
16831680
}
1684-
u.Path += "/" + resPath
1685-
q := u.Query()
1686-
q.Add("ref", cloneOpts.Revision())
1687-
u.RawQuery = q.Encode()
16881681

1682+
resPath := path.Join(apstore.Default.AppsDir, reporterCreateOpts.reporterName, opts.RuntimeName, "resources")
1683+
u = u.JoinPath(resPath)
16891684
appDef := &runtime.AppDef{
16901685
Name: reporterCreateOpts.reporterName,
16911686
Type: application.AppTypeDirectory,

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.1.28/cf-linux-amd64.tar.gz | tar zx
26+
curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.1.29/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.1.28/cf-darwin-amd64.tar.gz | tar zx
39+
curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.1.29/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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ go 1.19
44

55
require (
66
github.com/Masterminds/semver/v3 v3.1.1
7-
github.com/argoproj-labs/argocd-autopilot v0.4.10
8-
github.com/argoproj/argo-cd/v2 v2.5.2
7+
github.com/argoproj-labs/argocd-autopilot v0.4.11
8+
github.com/argoproj/argo-cd/v2 v2.5.9
99
github.com/argoproj/argo-events v0.17.1-0.20220327045437-70eaafe9afec
1010
github.com/argoproj/argo-workflows/v3 v3.3.1
1111
github.com/briandowns/spinner v1.18.1

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,10 +179,10 @@ github.com/antonmedv/expr v1.9.0/go.mod h1:5qsM3oLGDND7sDmQGDXHkYfkjYMUX14qsgqmH
179179
github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ=
180180
github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ=
181181
github.com/appscode/go v0.0.0-20190808133642-1d4ef1f1c1e0/go.mod h1:iy07dV61Z7QQdCKJCIvUoDL21u6AIceRhZzyleh2ymc=
182-
github.com/argoproj-labs/argocd-autopilot v0.4.10 h1:0I0U28wvwoZkh2/ECKEgMDFw71Dzh6WCSAU4TkWuxY8=
183-
github.com/argoproj-labs/argocd-autopilot v0.4.10/go.mod h1:iR9JosRv7UBOQBSDR64Rrg1qs1DURhR+kx8zK2GEap4=
184-
github.com/argoproj/argo-cd/v2 v2.5.2 h1:hyPi8NFXW3tG2yURslIMI20GfCdTN1/BDnt4+v5lpoA=
185-
github.com/argoproj/argo-cd/v2 v2.5.2/go.mod h1:3ToENm286PFVlZKNMutBzOwNyhevz4fw9dcgyiq3FIY=
182+
github.com/argoproj-labs/argocd-autopilot v0.4.11 h1:sUtW14AdjOlROWkM96jzldaEWCZj285vGi+uFmkcmvk=
183+
github.com/argoproj-labs/argocd-autopilot v0.4.11/go.mod h1:9bemL7fdzO7u/zaOEmII1UCfBPODKa8hDxZG2X6hH58=
184+
github.com/argoproj/argo-cd/v2 v2.5.9 h1:uupjZzBcZCrbRZM/0/nIwJLtCG9wbrFsiP6/cIR8xmM=
185+
github.com/argoproj/argo-cd/v2 v2.5.9/go.mod h1:dajeo9UYYdiC+Wjp9S+YPl2PPB5a0AUy2nYtT94qtpA=
186186
github.com/argoproj/argo-events v0.17.1-0.20220327045437-70eaafe9afec h1:95S2LPUUdPO2jYxuR5z1uk1GL2m/u+ud2iFAr5gK6VI=
187187
github.com/argoproj/argo-events v0.17.1-0.20220327045437-70eaafe9afec/go.mod h1:dF9hehH+HaEqz+OvQb0iXG8ynj4sQlISIQoettdl05Y=
188188
github.com/argoproj/argo-workflows/v3 v3.3.1 h1:cNhY6JRlMvwu0qhfCWtS/XmQ8nm2OjR7CBZ3K6zbcKI=

0 commit comments

Comments
 (0)