Tag built images with the commit's short hash (closes #239)
Check / check (pull_request) Skipped
Check / check (pull_request) Skipped
Builds are tagged upaas-<app>:<short hash>, git's own short form of the commit checked out, instead of the deployment number. A redeploy of a commit gives the tag to the new image. The cleanup after a deploy now also finds the app's untagged images among those its deployments recorded, and removes them by ID once the app neither runs them nor would roll back to them. It keeps every image any app uses, since apps that build the same commit can share one. The clone reads the commits from git's output after removing Docker's log headers, which had hidden the COMMIT: line; commit_sha is now saved on update so manual deploys keep the commit they recorded. Model: opus-5-5
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
"strings"
|
||||
|
||||
"sneak.berlin/go/upaas/internal/config"
|
||||
"sneak.berlin/go/upaas/internal/database"
|
||||
"sneak.berlin/go/upaas/internal/docker"
|
||||
"sneak.berlin/go/upaas/internal/models"
|
||||
)
|
||||
@@ -44,15 +45,18 @@ func (svc *Service) UnlockApp(appID string) {
|
||||
svc.unlockApp(appID)
|
||||
}
|
||||
|
||||
// NewTestServiceWithConfig creates a Service with config and docker client for testing.
|
||||
// NewTestServiceWithConfig creates a Service with config, database and
|
||||
// docker client for testing.
|
||||
func NewTestServiceWithConfig(
|
||||
log *slog.Logger,
|
||||
cfg *config.Config,
|
||||
db *database.Database,
|
||||
dockerClient *docker.Client,
|
||||
) *Service {
|
||||
return &Service{
|
||||
log: log,
|
||||
config: cfg,
|
||||
db: db,
|
||||
docker: dockerClient,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user