Open jathek opened 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
Trying to write a script to check and download scout, and to make it somewhat portable I would like to do this:
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:
As a reference, the way docker/compose publishes releases works pretty well with uname: https://github.com/docker/compose/releases