docker / scout-cli

Docker Scout CLI
https://docker.com/products/docker-scout
Other
250 stars 60 forks source link

Change release names so that they can be matched with uname #87

Open jathek opened 5 months ago

jathek commented 5 months ago

Trying to write a script to check and download scout, and to make it somewhat portable I would like to do this:

SCOUT_REPO_VERSION=$(curl -s https://api.github.com/repos/docker/scout-cli/releases/latest | grep 'tag_name' | cut -d '"' -f4)
curl -L "https://github.com/docker/scout-cli/releases/download/${SCOUT_REPO_VERSION}/docker-scout_${SCOUT_REPO_VERSION}_$(uname -s)_$(uname -m).tar.gz" --create-dirs -o "/tmp/docker-scout/docker-scout.tar.gz"

But the releases aren't named in a way where uname works, so instead I have to do the below, and hardcode the kernel name and the machine hardware name:

SCOUT_REPO_VERSION=$(curl -s https://api.github.com/repos/docker/scout-cli/releases/latest | grep 'tag_name' | cut -d '"' -f4)
curl -L "https://github.com/docker/scout-cli/releases/download/${SCOUT_REPO_VERSION}/docker-scout_${SCOUT_REPO_VERSION/v/}_linux_amd64.tar.gz" --create-dirs -o "/tmp/docker-scout/docker-scout.tar.gz"

As a reference, the way docker/compose publishes releases works pretty well with uname: https://github.com/docker/compose/releases

### Tasks