-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Vic Iglesias
committed
Oct 25, 2017
1 parent
6bd4d36
commit 562ae19
Showing
5 changed files
with
44 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/bash -e | ||
COMMAND=$1 | ||
|
||
case $COMMAND in | ||
init) | ||
BUCKET=$2 | ||
if [[ -z "$2" ]];then | ||
echo "Please provide a bucket URL in the format gs://BUCKET" | ||
exit 1 | ||
else | ||
gsutil cp -n $HELM_PLUGIN_DIR/etc/index.yaml $BUCKET | ||
echo "Repository initialized..." | ||
exit 0 | ||
fi | ||
;; | ||
push) | ||
CHART_PATH=$2 | ||
BUCKET=$3 | ||
TMP_DIR=$(mktemp -d) | ||
TMP_REPO=$TMP_DIR/repo | ||
OLD_INDEX=$TMP_DIR/old-index.yaml | ||
|
||
gsutil cat $BUCKET/index.yaml > $OLD_INDEX | ||
mkdir $TMP_REPO | ||
cp $CHART_PATH $TMP_REPO | ||
helm repo index --merge $OLD_INDEX --url $BUCKET $TMP_REPO | ||
gsutil cp $TMP_REPO/index.yaml $BUCKET | ||
gsutil cp $TMP_REPO/$(basename $CHART_PATH) $BUCKET | ||
echo "Repository initialized..." | ||
;; | ||
*) | ||
# TODO turn this into usage() | ||
echo "Please provide a command." | ||
;; | ||
esac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
REPO=$4 | ||
gsutil cat $REPO | ||
exit 0 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
apiVersion: v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
name: "gcs" | ||
version: "0.1.0" | ||
usage: "The plugin allows to use gcs protocol to upload, fetch charts and to work with repositories." | ||
usage: "This plugin allows to use gcs protocol to upload, fetch charts and to work with repositories." | ||
description: |- | ||
Provides Google Cloud Storage protocol support. | ||
https://github.com/viglesiasce/helm-gcs | ||
command: "$HELM_PLUGIN_DIR/bin/gcs.sh" | ||
command: "$HELM_PLUGIN_DIR/bin/gcs-helper.sh" | ||
downloaders: | ||
- command: "bin/gcs.sh" | ||
- command: "bin/gcs-repo.sh" | ||
protocols: | ||
- "gcs" | ||
- "gs" |