docker-scripts/linux/advanced/vscode-server/devops/docker-compose-update

40 lines
2.1 KiB
Plaintext
Raw Normal View History

2021-11-20 00:13:05 +03:00
#!/bin/bash
export DOCKER_COMPOSE_REMOTE_VERSION=`curl --silent https://api.github.com/repos/docker/compose/releases/latest | jq .name -r`
export DOCKER_COMPOSE_LOCAL_VERSION=`docker-compose -v`
2021-11-20 00:42:23 +03:00
export DOCKER_COMPOSE_BIN=/usr/local/bin/docker-compose
if [ -f $DOCKER_COMPOSE_BIN ]; then
echo "========================================================================================"
echo "The file '$DOCKER_COMPOSE_BIN' exists."
echo "========================================================================================"
echo "Local Docker Compose version is: ${DOCKER_COMPOSE_LOCAL_VERSION}"
echo "========================================================================================"
else
echo "========================================================================================"
echo "The file '$DOCKER_COMPOSE_BIN' in not found. Installing..."
echo "========================================================================================"
fi
2021-11-20 00:13:05 +03:00
echo "========================================================================================"
echo "Latest Docker Compose version is: ${DOCKER_COMPOSE_REMOTE_VERSION}"
echo "========================================================================================"
echo "========================================================================================"
echo "Installing remote version:"
echo "========================================================================================"
2021-11-20 00:42:23 +03:00
curl -SL https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_REMOTE_VERSION}/docker-compose-Linux-x86_64 -o $DOCKER_COMPOSE_BIN
2021-11-20 00:13:05 +03:00
echo "========================================================================================"
echo "Setting up permissions..."
echo "========================================================================================"
2021-11-20 00:42:23 +03:00
chmod +x $DOCKER_COMPOSE_BIN
2021-11-20 00:13:05 +03:00
echo "========================================================================================"
echo "Updated Docker Compose version is: ${DOCKER_COMPOSE_LOCAL_VERSION}"
echo "========================================================================================"