feat(starter): intial starter release

This commit is contained in:
2025-07-12 12:47:57 -05:00
parent e081c8f7c9
commit b370cb17c8
21 changed files with 14578 additions and 12 deletions

15
scripts/dockerBuild.ps1 Normal file
View File

@@ -0,0 +1,15 @@
Write-Host "Building the docker images for front and backend"
docker build -t logistics_support_tool:frontend-latest -f ../frontend/Dockerfile ../frontend
docker build -t logistics_support_tool:backend-latest -f ../backend/Dockerfile ../backend
Write-Host "Tagging the builds with latest this is for testing test basically."
docker tag logistics_support_tool:frontend-latest git.tuffraid.net/cowch/logistics_support_tool:frontend-latest
docker tag logistics_support_tool:backend-latest git.tuffraid.net/cowch/logistics_support_tool:backend-latest
# docker build -t logistics_support_tool:frontend-latest --no-cache .
Write-Host "Push both builds to our gitea server."
docker push git.tuffraid.net/cowch/logistics_support_tool:frontend-latest
docker push git.tuffraid.net/cowch/logistics_support_tool:backend-latest
Write-Host "Pull the new images to our docker system"
docker compose -f ./docker-compose.yml up -d --force-recreate

68
scripts/release.ps1 Normal file
View File

@@ -0,0 +1,68 @@
$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
$versionFile = Join-Path $scriptDir "..\VERSION"
$env:GOOS = "windows"
$env:GOARCH = "amd64"
$keepReleases = 10
if (Test-Path $versionFile) {
$version = Get-Content $versionFile -Raw | ForEach-Object { $_.Trim() }
Write-Host "Project version: $version"
} else {
Write-Host "VERSION file not found at $versionFile"
}
Write-Host "Building release version: $version"
Write-Host "`nBuilding Go backend..."
Push-Location ./backend
go build -ldflags "-X main.version=$version" -o lst_backend.exe ./main.go
Pop-Location
Write-Host "`nBuilding frontend..."
Push-Location ./frontend
npm install
npm run build
Pop-Location
$releaseFolder = Join-Path $scriptDir "releases"
$zipName = "release-$version.zip"
$zipPath = Join-Path $releaseFolder $zipName
if (-not (Test-Path $releaseFolder)) {
New-Item -ItemType Directory -Path $releaseFolder | Out-Null
}
# Remove zip if it already exists
if (Test-Path $zipPath) {
Write-Host "Removing existing zip: $zipPath"
Remove-Item $zipPath -Force
}
# Clean up older release files (keep only newest X)
$existingZips = Get-ChildItem -Path $releaseFolder -Filter "release-*.zip" | Sort-Object LastWriteTime -Descending
if ($existingZips.Count -gt $keepReleases) {
$toRemove = $existingZips | Select-Object -Skip $keepReleases
foreach ($file in $toRemove) {
Write-Host "Deleting old release: $($file.Name)"
Remove-Item $file.FullName -Force
}
}
Write-Host "`nPackaging release: $($zipName)"
$filesToInclude = @(
"backend\lst_backend.exe",
"frontend\.nitro",
"frontend\.tanstack",
"frontend\.output",
"frontend\public",
"VERSION"
)
Compress-Archive -Path $filesToInclude -DestinationPath $zipPath
Write-Host "`nRelease package created at: $($zipPath)"