Skip to content
This repository has been archived by the owner on Oct 27, 2023. It is now read-only.

Commit

Permalink
Fixed install plugin and removed windows stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Miguel Santiago committed Oct 23, 2018
1 parent 111747f commit 2bcaedb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ TESTFLAGS :=
HAS_DEP := $(shell command -v dep;)
HAS_GOX := $(shell command -v gox;)

TARGETS ?= darwin/amd64 linux/amd64 windows/amd64
TARGETS ?= darwin/amd64 linux/amd64
BIN_NAME := helm-push-artifactory
DIST_DIRS = find * -type d -maxdepth 0 -exec

Expand Down Expand Up @@ -58,7 +58,7 @@ dist:
.PHONY: build-cross
build-cross: LDFLAGS += -extldflags "-static"
build-cross:
CGO_ENABLED=0 gox -parallel=3 -output="_dist/{{.OS}}-{{.Arch}}/${BIN_NAME}/" -osarch='$(TARGETS)' -ldflags '$(LDFLAGS)' github.com/belitre/helm-push-artifactory-plugin/cmd/push
CGO_ENABLED=0 gox -parallel=2 -output="_dist/{{.OS}}-{{.Arch}}/${BIN_NAME}" -osarch='$(TARGETS)' -ldflags '$(LDFLAGS)' github.com/belitre/helm-push-artifactory-plugin/cmd/push

.PHONY: clean
clean:
Expand Down
14 changes: 9 additions & 5 deletions scripts/install_plugin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,19 @@ version="$(cat plugin.yaml | grep "version" | cut -d '"' -f 2)"
echo "Downloading and installing helm-push-artifactory v${version} ..."

url=""
osname=""

if [ "$(uname)" = "Darwin" ]; then
url="https://github.com/belitre/helm-push-artifactory-plugin/releases/download/v${version}/helm-push-artifactory-v${version}-darwin-amd64.tar.gz"
osname="darwin-amd64"
elif [ "$(uname)" = "Linux" ] ; then
url="https://github.com/chartmuseum/helm-push/releases/download/v${version}/helm-push-artifactory-v${version}-linux-amd64.tar.gz"
osname="linux-amd64"
else
url="https://github.com/chartmuseum/helm-push/releases/download/v${version}/helm-push-artifactory-v${version}-windows-amd64.tar.gz"
echo "Windows not supported..."
exit 0
fi

url="https://github.com/belitre/helm-push-artifactory-plugin/releases/download/v${version}/helm-push-artifactory-v${version}-${osname}.tar.gz"

echo $url

mkdir -p "bin"
Expand All @@ -31,6 +36,5 @@ 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}/helm-push-artifactory" "bin/helm-push-artifactory" || \
mv "releases/v${version}/helm-push-artifactory.exe" "bin/helm-push-artifactory"
mv "releases/v${version}/${osname}/helm-push-artifactory" "bin/helm-push-artifactory"

0 comments on commit 2bcaedb

Please sign in to comment.