Skip to content

Commit

Permalink
fix helm push conflict, see chartmuseum/helm-push#116
Browse files Browse the repository at this point in the history
Signed-off-by: 铭毅 <[email protected]>
  • Loading branch information
铭毅 committed Dec 2, 2021
1 parent dccbb7c commit fc7aa69
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 24 deletions.
4 changes: 2 additions & 2 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ before:
hooks:
- go mod download
builds:
- main: ./cmd/helmpush
binary: ./bin/helmpush
- main: ./cmd/helm-cm-push
binary: ./bin/helm-cm-push
env:
- CGO_ENABLED=0
goos:
Expand Down
16 changes: 8 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PLUGIN_NAME := push
PLUGIN_NAME := cm-push

HAS_PIP := $(shell command -v pip;)
HAS_VENV := $(shell command -v virtualenv;)
Expand All @@ -11,33 +11,33 @@ build_windows: export GO111MODULE=on
build_windows: export GOPROXY=https://gocenter.io
build_windows:
@GOOS=windows go build -v --ldflags="-w -X main.Version=$(VERSION) -X main.Revision=$(REVISION)" \
-o bin/windows/amd64/helmpush cmd/helmpush/main.go # windows
-o bin/windows/amd64/helm-cm-push cmd/helm-cm-push/main.go # windows

link_windows:
@cp bin/windows/amd64/helmpush ./bin/helmpush
@cp bin/windows/amd64/helm-cm-push ./bin/helm-cm-push

build_linux: export GOARCH=amd64
build_linux: export CGO_ENABLED=0
build_linux: export GO111MODULE=on
build_linux: export GOPROXY=https://gocenter.io
build_linux:
@GOOS=linux go build -v --ldflags="-w -X main.Version=$(VERSION) -X main.Revision=$(REVISION)" \
-o bin/linux/amd64/helmpush cmd/helmpush/main.go # linux
-o bin/linux/amd64/helm-cm-push cmd/helm-cm-push/main.go # linux

link_linux:
@cp bin/linux/amd64/helmpush ./bin/helmpush
@cp bin/linux/amd64/helm-cm-push ./bin/helm-cm-push

build_mac: export GOARCH=amd64
build_mac: export CGO_ENABLED=0
build_mac: export GO111MODULE=on
build_mac: export GOPROXY=https://gocenter.io
build_mac:
@GOOS=darwin go build -v --ldflags="-w -X main.Version=$(VERSION) -X main.Revision=$(REVISION)" \
-o bin/darwin/amd64/helmpush cmd/helmpush/main.go # mac osx
@cp bin/darwin/amd64/helmpush ./bin/helmpush # For use w make install
-o bin/darwin/amd64/helm-cm-push cmd/helm-cm-push/main.go # mac osx
@cp bin/darwin/amd64/helm-cm-push ./bin/helm-cm-push # For use w make install

link_mac:
@cp bin/darwin/amd64/helmpush ./bin/helmpush
@cp bin/darwin/amd64/helm-cm-push ./bin/helm-cm-push

.PHONY: clean
clean:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ helm repo add demo acr://hello-acr-helm.cn-hangzhou.cr.aliyuncs.com/foo/bar --us
helm create hello-acr

# push the chart
helm push hello-acr demo
helm cm-push hello-acr demo

# delete local chart
rm -r hello-acr
Expand Down
6 changes: 3 additions & 3 deletions acceptance_tests/lib/Helm.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ def install_helm_plugin(self):
self.run_command('%s plugin install %s' % (common.HELM_EXE, self.rootdir))

def check_helm_plugin(self):
self.run_command('%s plugin list | grep ^push' % common.HELM_EXE)
self.run_command('%s plugin list | grep ^cm-push' % common.HELM_EXE)

def run_helm_plugin(self):
self.run_command('%s push --help' % common.HELM_EXE)
self.run_command('%s cm-push --help' % common.HELM_EXE)

def remove_helm_plugin(self):
self.run_command('%s plugin remove push' % common.HELM_EXE)
self.run_command('%s plugin remove cm-push' % common.HELM_EXE)
10 changes: 5 additions & 5 deletions acceptance_tests/lib/HelmPush.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,30 +13,30 @@ def _testchart_path(self):
return '%s/helm2/mychart' % common.TESTCHARTS_DIR

def helm_major_version_detected_by_plugin_is(self, version):
cmd = '%s push --check-helm-version' % common.HELM_EXE
cmd = '%s cm-push --check-helm-version' % common.HELM_EXE
self.run_command(cmd)
self.output_contains(version)

def push_chart_directory(self, version=''):
cmd = '%s push %s %s' % (common.HELM_EXE, self._testchart_path(), common.HELM_REPO_NAME)
cmd = '%s cm-push %s %s' % (common.HELM_EXE, self._testchart_path(), common.HELM_REPO_NAME)
if version:
cmd += " --version=\"%s\"" % version
self.run_command(cmd)

def push_chart_directory_to_url(self, version=''):
cmd = '%s push %s %s' % (common.HELM_EXE, self._testchart_path(), common.HELM_REPO_URL)
cmd = '%s cm-push %s %s' % (common.HELM_EXE, self._testchart_path(), common.HELM_REPO_URL)
if version:
cmd += " --version=\"%s\"" % version
self.run_command(cmd)

def push_chart_package(self, version=''):
cmd = '%s push %s/*.tgz %s' % (common.HELM_EXE, self._testchart_path(), common.HELM_REPO_NAME)
cmd = '%s cm-push %s/*.tgz %s' % (common.HELM_EXE, self._testchart_path(), common.HELM_REPO_NAME)
if version:
cmd += " --version=\"%s\"" % version
self.run_command(cmd)

def push_chart_package_to_url(self, version=''):
cmd = '%s push %s %s' % (common.HELM_EXE, self._testchart_path(), common.HELM_REPO_URL)
cmd = '%s cm-push %s %s' % (common.HELM_EXE, self._testchart_path(), common.HELM_REPO_URL)
if version:
cmd += " --version=\"%s\"" % version
self.run_command(cmd)
6 changes: 3 additions & 3 deletions plugin.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: "push"
name: "cm-push"
version: "0.8.1"
usage: "Please see https://github.com/AliyunContainerService/helm-acr for usage"
description: "Push chart package to Alibaba Container Registry"
command: "$HELM_PLUGIN_DIR/bin/helmpush"
command: "$HELM_PLUGIN_DIR/bin/helm-cm-push"
downloaders:
- command: "bin/helmpush"
- command: "bin/helm-cm-push"
protocols:
- "acr"
useTunnel: false
Expand Down
4 changes: 2 additions & 2 deletions scripts/install_plugin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ else
wget -q "${url}" -O "releases/v${version}.tar.gz"
fi
tar xzf "releases/v${version}.tar.gz" -C "releases/v${version}"
mv "releases/v${version}/bin/helmpush" "bin/helmpush" || \
mv "releases/v${version}/bin/helmpush.exe" "bin/helmpush"
mv "releases/v${version}/bin/helm-cm-push" "bin/helm-cm-push" || \
mv "releases/v${version}/bin/helm-cm-push.exe" "bin/helm-cm-push"

0 comments on commit fc7aa69

Please sign in to comment.