Skip to content

Commit

Permalink
Match Fleet server version with fleetctl version (#45)
Browse files Browse the repository at this point in the history
* Perform Fleet server version lookup just-in-time

* Add --fail flag to curl command

* Conditionally install latest / specific version of fleetctl
  • Loading branch information
ninxsoft authored Aug 13, 2024
1 parent df3827a commit 698bce2
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion .github/gitops-action/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,15 @@ runs:
- name: Install fleetctl
shell: bash
working-directory: ${{ inputs.working-directory }}
run: npm install -g fleetctl
run: |
FLEET_VERSION="$(curl "$FLEET_URL/api/v1/fleet/version" --header "Authorization: Bearer $FLEET_API_TOKEN" --fail --silent | jq --raw-output '.version')"
if [[ -n "$FLEET_VERSION" ]] ; then
npm install -g "fleetctl@$FLEET_VERSION"
else
echo "Failed to get Fleet version from $FLEET_URL, installing latest version of fleetctl"
npm install -g fleetctl
fi
- name: Configure fleetctl
shell: bash
Expand Down

0 comments on commit 698bce2

Please sign in to comment.