Skip to content

Commit

Permalink
Adding builtin yq (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
rtpro authored Aug 5, 2022
1 parent 4eadd22 commit c24796a
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 10 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/update-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Upgrade Version
on:
release:
types: [published]

jobs:
upgrade-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: pocket-apps/action-update-version@v1
with:
files: 'plugin.yaml'
version-regexp: '\d+.\d+.\d+'
repo-token: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
yq
4 changes: 2 additions & 2 deletions lib/api/helm-ops.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ function pull_chart_from_release() {

mkdir -p $CHART_DIR

echo $RELEASE_CONTENT | jq -r '.chart.metadata' | yq e -P - > $CHART_DIR/Chart.yaml
echo $RELEASE_CONTENT | jq -r '.chart.values' | yq e -P - > $CHART_DIR/values.yaml
echo $RELEASE_CONTENT | jq -r '.chart.metadata' | $HELM_PLUGIN_DIR/lib/yq e -P - > $CHART_DIR/Chart.yaml
echo $RELEASE_CONTENT | jq -r '.chart.values' | $HELM_PLUGIN_DIR/lib/yq e -P - > $CHART_DIR/values.yaml

# Create Chart Templates
for row in $(echo $RELEASE_CONTENT | jq -r '.chart.templates[] | @base64'); do
Expand Down
6 changes: 0 additions & 6 deletions lib/utility.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@ function test_deps() {
echo "jq could not be found - please install command `jq` (https://stedolan.github.io/jq/download/)"
exit
fi
if ! command -v yq &> /dev/null
then
echo "yq could not be found - please install command `yq` (https://github.com/mikefarah/yq/#install)"
exit
fi

}

function str_split() {
Expand Down
8 changes: 6 additions & 2 deletions plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@
# limitations under the License.

Name: "release"
version: "0.2.0"
version: "0.3.0"
usage: "pull or update Helm Releases"
description: |-
Update values of a releases, pull charts from releases
command: "$HELM_PLUGIN_DIR/release.sh"
command: "$HELM_PLUGIN_DIR/release.sh"
hooks:
install: |
wget https://github.com/mikefarah/yq/releases/download/v4.25.3/yq_linux_amd64 -O $HELM_PLUGIN_DIR/lib/yq;
chmod +x $HELM_PLUGIN_DIR/lib/yq;

0 comments on commit c24796a

Please sign in to comment.