Skip to content

Commit

Permalink
feat: install compose on non-official debians
Browse files Browse the repository at this point in the history
  • Loading branch information
ferrarimarco committed Jun 26, 2024
1 parent f6df61e commit 80f9939
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 26 deletions.
2 changes: 0 additions & 2 deletions setup-windows.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ function Install-Chocolatey-Package {
'7zip',
'conemu',
'googlechrome',
'keepass',
'qbittorrent',
'vlc',
'vscode'

Expand Down
50 changes: 26 additions & 24 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -189,14 +189,12 @@ setup_debian() {

docker_distribution=

if is_debian || is_ubuntu; then
if is_official_debian || is_ubuntu; then

docker_distribution="debian"

if is_official_debian || is_ubuntu; then
echo "Enabling main repository"
sudo add-apt-repository --yes main
fi
echo "Enabling main repository"
sudo add-apt-repository --yes main

if is_ubuntu; then
echo "Enabling universe, multiverse, and restricted repositories"
Expand All @@ -206,27 +204,27 @@ setup_debian() {
docker_distribution="ubuntu"
fi

if is_official_debian || is_ubuntu; then
docker_apt_repository_url="https://download.docker.com/linux/${docker_distribution}"
if ! is_apt_repo_available "${docker_apt_repository_url}"; then
add_apt_repo \
"${docker_apt_repository_url}/gpg" \
"docker.gpg" \
"${docker_apt_repository_url}" \
"docker.list"
fi
docker_apt_repository_url="https://download.docker.com/linux/${docker_distribution}"
if ! is_apt_repo_available "${docker_apt_repository_url}"; then
add_apt_repo \
"${docker_apt_repository_url}/gpg" \
"docker.gpg" \
"${docker_apt_repository_url}" \
"docker.list"
fi

vs_code_apt_repository_url="https://packages.microsoft.com/repos/code"
if ! is_apt_repo_available "${vs_code_apt_repository_url}"; then
add_apt_repo \
"https://packages.microsoft.com/keys/microsoft.asc" \
"packages.microsoft.gpg" \
"${vs_code_apt_repository_url}" \
"vscode.list" \
"stable main"
fi
unset vs_code_apt_repository_url
vs_code_apt_repository_url="https://packages.microsoft.com/repos/code"
if ! is_apt_repo_available "${vs_code_apt_repository_url}"; then
add_apt_repo \
"https://packages.microsoft.com/keys/microsoft.asc" \
"packages.microsoft.gpg" \
"${vs_code_apt_repository_url}" \
"vscode.list" \
"stable main"
fi
unset vs_code_apt_repository_url
elif is_debian && ! is_official_debian; then
echo "This is a non-official Debian distribution."
else
echo "WARNING: distribution ${DISTRIBUTION} is not supported. Skipping distribution-specific configuration..."
fi
Expand Down Expand Up @@ -292,6 +290,10 @@ setup_debian() {
else
echo "Setting Docker Buildx as the default builder using the legacy installation method..."
sudo docker buildx install

echo "Install Docker Compose using the legacy installation method"
sudo DEBIAN_FRONTEND=noninteractive apt-get -qqy install \
docker-compose
fi

DOCKER_GROUP_NAME="docker"
Expand Down

0 comments on commit 80f9939

Please sign in to comment.