diff --git a/.goreleaser.yml b/.goreleaser.yml index 5864ab6..9672bef 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -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: diff --git a/Makefile b/Makefile index 462a85b..9fecc9d 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -PLUGIN_NAME := push +PLUGIN_NAME := cm-push HAS_PIP := $(shell command -v pip;) HAS_VENV := $(shell command -v virtualenv;) @@ -11,10 +11,10 @@ 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 @@ -22,10 +22,10 @@ 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 @@ -33,11 +33,11 @@ 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: diff --git a/README.md b/README.md index 198fe69..76dcd64 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/acceptance_tests/lib/Helm.py b/acceptance_tests/lib/Helm.py index 90d93b9..a7a8882 100644 --- a/acceptance_tests/lib/Helm.py +++ b/acceptance_tests/lib/Helm.py @@ -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) diff --git a/acceptance_tests/lib/HelmPush.py b/acceptance_tests/lib/HelmPush.py index 58697fe..cc6db1d 100644 --- a/acceptance_tests/lib/HelmPush.py +++ b/acceptance_tests/lib/HelmPush.py @@ -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) diff --git a/plugin.yaml b/plugin.yaml index 0f61431..9f019f5 100644 --- a/plugin.yaml +++ b/plugin.yaml @@ -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 diff --git a/scripts/install_plugin.sh b/scripts/install_plugin.sh index 44ff5f9..5e0c756 100755 --- a/scripts/install_plugin.sh +++ b/scripts/install_plugin.sh @@ -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"