Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions compose/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,31 @@ For detailed instructions on how to use the script manager, refer to [manager do

## Version update procedure

### Standard update procedure (recommended)

1. Navigate to `team-edition-deploy/compose/cbte`
2. Stop the cluster: `docker-compose down` or `docker compose down`
3. Update your deployment files:
- Fetch latest changes: `git fetch`
- Switch to new release version: `git checkout <version-tag>` (e.g., `git checkout 25.2.0`)
- Change value of `CLOUDBEAVER_VERSION_TAG` in `.env` with a preferred version (skip if tag `latest` is set)
4. Pull new docker images: `docker-compose pull` or `docker compose pull`
5. Start the cluster: `docker-compose up -d` or `docker compose up -d`

### Alternative update procedure (for simple updates)

If you are not updating across major version boundaries and don't need configuration changes:

1. Navigate to `team-edition-deploy/compose/cbte`
2. Change value of `CLOUDBEAVER_VERSION_TAG` in `.env` with a preferred version. Go to next step if tag `latest` is set.
3. Pull new docker images: `docker-compose pull` or `docker compose pull`
4. Restart cluster: `docker-compose up -d` or `docker compose up -d`

**Note:** The standard procedure using `docker-compose down` is recommended because it ensures clean container replacement, especially when service names or configurations change between versions.

### Version update to 25.1.0 or later

Starting from version 25.1.0, the proxy container name has changed from `nginx` to `web-proxy`. When updating to version 25.1.0 or later, you **must** use the [standard update procedure](#standard-update-procedure-recommended) with `docker-compose down` to ensure the old container is properly removed.

### Version update from 24.0.0 or earlier

Expand Down
21 changes: 21 additions & 0 deletions compose/cbte/windows/bootstrap.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
if (-not (Get-Command git -ErrorAction Ignore)) {
Write-Host "Git is not installed."
if (Get-Command winget -ErrorAction Ignore) {
Write-Host "Attempting to install Git using winget..."
winget install --id Git.Git -e --source winget
} else {
Write-Host "winget is not available. Downloading Git for Windows installer..."
$gitInstaller = "$env:TEMP\Git-Installer.exe"
Invoke-WebRequest -Uri "https://github.com/git-for-windows/git/releases/download/v2.51.0.windows.2/Git-2.51.0.2-64-bit.exe" -OutFile $gitInstaller
Write-Host "Running Git installer silently..."
# https://gitforwindows.org/silent-or-unattended-installation.html
Start-Process -FilePath $gitInstaller -ArgumentList "/VERYSILENT", "/NORESTART", "/NOCANCEL", "/SP-" -Wait
Write-Host "Git installation completed. Please restart your terminal if Git is still not recognized."
}
} else {
Write-Host "Git is installed."
}

$repoName = "team-edition-deploy"
$installPath = Join-Path $env:AppData "DBeaverData" | Join-Path -ChildPath "github" | Join-Path -ChildPath "dbeaver" | Join-Path -ChildPath $repoName
git clone https://github.com/dbeaver/$repoName.git --depth 1 $installPath
6 changes: 6 additions & 0 deletions compose/cbte/windows/common.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
$cbteDir = Split-Path $PSScriptRoot -Parent
$composeFile = Join-Path $cbteDir "podman-compose.yml"
$podmanMachineName = "dbeaver-team-edition"

$env:PODMAN_COMPOSE_PROVIDER = "podman-compose"
$env:CONTAINER_CONNECTION = "$podmanMachineName-root"
59 changes: 59 additions & 0 deletions compose/cbte/windows/install_dependencies.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
Write-Host "Checking WSL2 status..."
& wsl.exe --status > $null 2>&1
if ($LASTEXITCODE -eq 0) {
Write-Output "WSL 2 is configured fine."
} else {
Write-Error "You can install Windows Subsystem for Linux by running 'wsl.exe --install'." +
" For more information please visit https://aka.ms/wslinstall"
exit 1
}

$dependenciesInstallPath = Join-Path $env:AppData "DBeaverData" | Join-Path -ChildPath ".te-dependencies"

function Test-WingetAvailable {
return [bool](Get-Command winget -ErrorAction Ignore)
}

if (-not (Get-Command podman -ErrorAction Ignore)) {
Write-Host "Podman is not installed."
if (Test-WingetAvailable) {
Write-Host "Attempting to install Podman using winget..."
winget install --id RedHat.Podman -e --source winget
} else {
Write-Host "winget is not available. Downloading and installing Podman..."
$zipFile = "$env:TEMP\podman.zip"
$podmanVersion = "5.6.1"
Invoke-WebRequest -Uri "https://github.com/containers/podman/releases/download/v$podmanVersion/podman-remote-release-windows_amd64.zip" -OutFile $zipFile
Expand-Archive -Path $zipFile -DestinationPath $dependenciesInstallPath -Force
$pathToAdd = Join-Path $dependenciesInstallPath "podman-$podmanVersion" | Join-Path -ChildPath "usr" | Join-Path -ChildPath "bin"
$env:Path = "$pathToAdd;$env:Path"
[Environment]::SetEnvironmentVariable("Path", $env:Path, [EnvironmentVariableTarget]::User)
Write-Host "Added Podman to user PATH: $pathToAdd"
}
} else {
Write-Host "Podman is installed."
}

& py.exe --version > $null 2>&1
if ($LASTEXITCODE -ne 0) {
Write-Host "Python 3 is not installed."
$pythonVersionToDownload = "3.13"
if (Test-WingetAvailable) {
Write-Host "Attempting to install Python 3 using winget..."
winget install --id "Python.Python.$pythonVersionToDownload" -e --source winget
} else {
Write-Host "winget is not available. Downloading and installing Python 3..."
$installerFile = "$env:TEMP\python3-installer.exe"
$pythonFullVersionToDownload = "$pythonVersionToDownload.7"
Invoke-WebRequest -Uri "https://www.python.org/ftp/python/$pythonFullVersionToDownload/python-$pythonFullVersionToDownload-amd64.exe" -OutFile $installerFile
Start-Process -FilePath $installerFile -ArgumentList "/quiet", "PrependPath=1" -Wait
}
} else {
Write-Host "Python 3 is installed."
}

& py.exe -m "pip" install pipx
& py.exe -m "pipx" ensurepath
& py.exe -m "pipx" install podman-compose

Write-Host "All dependencies are satisfied. Please restart your terminal if some of them are still not recognized."
20 changes: 20 additions & 0 deletions compose/cbte/windows/start.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
. "$PSScriptRoot\common.ps1"
$envFile = Join-Path $cbteDir ".env"
if (-not (Test-Path $envFile)) {
Write-Error "File '$envFile' does not exist. Create and first, then try again."
exit 1
}

# Ensure Podman machine is up and running
# FIXME: the following commands print errors if vm already exists or running. It's ok for now, but it would be good to manage it gracefully
& podman machine init --rootful $podmanMachineName
& podman machine start $podmanMachineName

# TODO: Configure networking
Write-Host ""
Write-Host "The following the the eth0 interface info of a WSL machine that will run the product:"
Write-Host ""
wsl.exe -d "podman-$podmanMachineName" "--exec" "/bin/sh" "-c" "ip addr show eth0"
Write-Host ""

& podman compose -f $composeFile up -d
3 changes: 3 additions & 0 deletions compose/cbte/windows/stop.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
. "$PSScriptRoot\common.ps1"

& podman compose -f $composeFile down
Loading