Skip to content

Commit

Permalink
HXOR-1507 Update Rancher CLI to 2.8.4 and setup Updatecli (#662)
Browse files Browse the repository at this point in the history
  • Loading branch information
mteodori authored Jun 25, 2024
1 parent bd8cf15 commit 5bd2305
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 9 deletions.
18 changes: 10 additions & 8 deletions .github/actions/setup-rancher-cli/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ inputs:
version:
description: 'Version of Rancher CLI'
required: false
default: 2.6.0
access-key:
description: 'Rancher API access key'
required: false
Expand All @@ -22,8 +21,9 @@ inputs:
runs:
using: "composite"
steps:
- run: |
TOOL_VERSION=${{ inputs.version }}
- shell: bash
run: |
TOOL_VERSION=${{ inputs.version != '' && inputs.version || env.DEFAULT_RANCHER_CLI_VERSION }}
TOOL_NAME=rancher
TOOL_REPO=rancher/cli
TOOL_OS=$(uname | tr '[:upper:]' '[:lower:]')
Expand All @@ -32,23 +32,25 @@ runs:
| tar xz --strip=2 ./$TOOL_NAME-v$TOOL_VERSION/$TOOL_NAME
sudo mv $TOOL_NAME /usr/local/bin/
echo $($TOOL_NAME --version)
shell: bash
- run: |
env:
DEFAULT_RANCHER_CLI_VERSION: 2.8.4

- shell: bash
run: |
RANCHER2_BEARER_TOKEN=${{ inputs.access-key }}:${{ inputs.secret-key }}
RANCHER2_URL=${{ inputs.url }}
if [[ -n "$RANCHER2_BEARER_TOKEN" ]]
then
RANCHER_SYSTEM_CONTEXT_INDEX=$(echo 1 | rancher login $RANCHER2_URL -t $RANCHER2_BEARER_TOKEN | grep "$KUBECONTEXT" | grep System | cut -d ' ' -f1)
echo $RANCHER_SYSTEM_CONTEXT_INDEX | rancher login $RANCHER2_URL -t $RANCHER2_BEARER_TOKEN > /dev/null
fi
shell: bash
env:
KUBECONTEXT: ${{ inputs.context }}

- run: |
- shell: bash
run: |
KUBECONTEXT="${{ inputs.context }}"
if [[ -n "$KUBECONTEXT" ]]
then
mkdir -p $HOME/.kube && rancher cluster kubeconfig ${{ inputs.context }} > $HOME/.kube/config
fi
shell: bash
12 changes: 12 additions & 0 deletions .updatecli/values/github_releases/rancher_cli.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
github:
prefix: 'build(deps)'
message: 'bump rancher-cli to {{ source "lastRelease" }}'

github_release:
owner: 'rancher'
repo: 'cli'

target:
file: '.github/actions/setup-rancher-cli/action.yml'
key: '$.runs.steps[0].env.DEFAULT_RANCHER_CLI_VERSION'
trimprefix: 'v'
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v5.29.3
v5.29.4

0 comments on commit 5bd2305

Please sign in to comment.