Last active
May 16, 2021 06:07
-
-
Save Benoss/336aa5c3357da1bb33649869bfd1bf17 to your computer and use it in GitHub Desktop.
install_docker_compose.sh Install/update docker compose with the latest released tag from github
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# -e exit on non 0 return | |
set -e | |
# -u exit on undefined variables | |
set -u | |
# -x print command before running | |
set -x | |
# bubble up the non 0 on pipes | |
set -o pipefail | |
REPO="docker/compose" | |
BIN_NAME="docker-compose" | |
LAST_GITHUB_V=$(curl -s https://api.github.com/repos/${REPO}/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")') | |
DOWNLOAD_LINK="https://github.com/${REPO}/releases/download/${LAST_GITHUB_V}/${BIN_NAME}-$(uname -s)-$(uname -m)" | |
sudo sh -c "curl -L $DOWNLOAD_LINK > /usr/local/bin/${BIN_NAME}" | |
sudo chmod +x /usr/local/bin/${BIN_NAME} | |
docker-compose --version | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# -e exit on non 0 return | |
set -e | |
# -u exit on undefined variables | |
set -u | |
# -x print command before running | |
set -x | |
# bubble up the non 0 on pipes | |
set -o pipefail | |
REPO="gohugoio/hugo" | |
FLAVOR="hugo" | |
LAST_GITHUB_V=$(curl -s https://api.github.com/repos/${REPO}/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")') | |
DOWNLOAD_LINK="https://github.com/${REPO}/releases/download/${LAST_GITHUB_V}/${FLAVOR}_${LAST_GITHUB_V:1}_Linux-64bit.deb" | |
curl -L -o /tmp/hugo_install.deb $DOWNLOAD_LINK | |
sudo dpkg -i /tmp/hugo_install.deb | |
rm -rf /tmp/hugo_install.deb | |
hugo version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install geekbench | |
# -u exit on undefined variables | |
set -u | |
# -x print command before running | |
set -x | |
# bubble up the non 0 on pipes | |
set -o pipefail | |
VERSION="5.4.1" | |
curl -s https://cdn.geekbench.com/Geekbench-${VERSION}-Linux.tar.gz | tar -xvz | |
mv Geekbench-${VERSION}-Linux/ geekbench | |
geekbench/geekbench5 | |
rm -rf geekbench |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment