scout-cli icon indicating copy to clipboard operation
scout-cli copied to clipboard

Change release names so that they can be matched with uname

Open jathek opened this issue 1 year ago • 0 comments
trafficstars

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

jathek avatar Jan 18 '24 21:01 jathek