Skip to content

Commit

Permalink
simplify release
Browse files Browse the repository at this point in the history
  • Loading branch information
Mehdi BEN ABDALLAH committed Mar 5, 2018
1 parent f9c4281 commit 1dff1b6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 38 deletions.
11 changes: 0 additions & 11 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,9 @@ builds:
goos:
- linux
- darwin
- windows

goarch:
- amd64
- 386

ignore:
- goos: windows
goarch: 386
- goos: darwin
goarch: 386

# Archive customization
archive:
Expand All @@ -32,9 +24,6 @@ archive:
- ./docs/**

format: tar.gz
format_overrides:
- goos: windows
format: zip

env_files:
github_token: ~/.github/helm-local-chart-version.token
31 changes: 4 additions & 27 deletions install-binary.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,41 +29,17 @@ PROJECT_GH="mbenabda/${PROJECT_NAME}"

: ${HELM_PLUGIN_PATH:="$(helm home)/plugins/${PROJECT_NAME}"}

# Convert the HELM_PLUGIN_PATH to unix if cygpath is
# available. This is the case when using MSYS2 or Cygwin
# on Windows where helm returns a Windows path but we
# need a Unix path

if type cygpath > /dev/null 2>&1; then
HELM_PLUGIN_PATH=$(cygpath -u $HELM_PLUGIN_PATH)
fi

if [[ $SKIP_BIN_INSTALL == "1" ]]; then
echo "Skipping binary install"
exit
fi

# Discover the architecture for this system.
initArch() {
ARCH=$(uname -m)
case $ARCH in
x86) ARCH="386";;
x86_64) ARCH="amd64";;
i686) ARCH="386";;
i386) ARCH="386";;
esac
}

# Discover the operating system for this system.
initOS() {
OS=$(echo `uname`|tr '[:upper:]' '[:lower:]')

case "$OS" in
# Msys support
msys*) OS='windows';;
# Minimalist GNU for Windows
mingw*) OS='windows';;
esac
}

# Figure out the download url for the latest available version.
Expand All @@ -78,7 +54,7 @@ getDownloadURL() {
if [ -n "$version" ]; then
url="https://api.github.com/repos/${PROJECT_GH}/releases/tags/${version}"
fi

# Use the GitHub API to find the download url for this project.
if type "curl" > /dev/null; then
DOWNLOAD_URL=$(curl -v -s $url | grep "${OS}-${ARCH}" | awk '/\"browser_download_url\":/{gsub( /[,\"]/,"", $2); print $2}')
Expand All @@ -94,7 +70,7 @@ getDownloadURL() {

# Download the plugin package.
downloadFile() {
PLUGIN_TMP_FILE="/tmp/${PROJECT_NAME}.tgz"
PLUGIN_TMP_FILE="/tmp/${PROJECT_NAME}.tar.gz"
echo "Downloading $DOWNLOAD_URL"
if type "curl" > /dev/null; then
curl -L "$DOWNLOAD_URL" -o "$PLUGIN_TMP_FILE"
Expand All @@ -106,7 +82,8 @@ downloadFile() {
# Unpack and install the helm plugin
installFile() {
echo "Preparing to install into ${HELM_PLUGIN_PATH}"
tar xf "$PLUGIN_TMP_FILE" -C "$HELM_PLUGIN_PATH"
mkdir -p ${HELM_PLUGIN_PATH} \
&& tar -xvzf "$PLUGIN_TMP_FILE" -C "$HELM_PLUGIN_PATH"
}

# Executed if an error occurs.
Expand Down

0 comments on commit 1dff1b6

Please sign in to comment.