Change Docker image naming to upaas-appname:deploymentID
- Use upaas-appname format instead of upaas/appname - Tag with deployment number instead of 'latest' - Example: upaas-myapp:42
This commit is contained in:
parent
ba4893a98a
commit
ee34f3b70c
@ -529,7 +529,7 @@ func (svc *Service) buildImage(
|
||||
|
||||
defer cleanup()
|
||||
|
||||
imageTag := "upaas/" + app.Name + ":latest"
|
||||
imageTag := fmt.Sprintf("upaas-%s:%d", app.Name, deployment.ID)
|
||||
|
||||
// Create log writer that flushes build output to deployment logs every second
|
||||
logWriter := newDeploymentLogWriter(ctx, deployment)
|
||||
@ -721,9 +721,9 @@ func (svc *Service) createAndStartContainer(
|
||||
ctx context.Context,
|
||||
app *models.App,
|
||||
deployment *models.Deployment,
|
||||
imageID string,
|
||||
_ string,
|
||||
) (string, error) {
|
||||
containerOpts, err := svc.buildContainerOptions(ctx, app, imageID)
|
||||
containerOpts, err := svc.buildContainerOptions(ctx, app, deployment.ID)
|
||||
if err != nil {
|
||||
svc.failDeployment(ctx, app, deployment, err)
|
||||
|
||||
@ -767,7 +767,7 @@ func (svc *Service) createAndStartContainer(
|
||||
func (svc *Service) buildContainerOptions(
|
||||
ctx context.Context,
|
||||
app *models.App,
|
||||
_ string,
|
||||
deploymentID int64,
|
||||
) (docker.CreateContainerOptions, error) {
|
||||
envVars, err := app.GetEnvVars(ctx)
|
||||
if err != nil {
|
||||
@ -801,7 +801,7 @@ func (svc *Service) buildContainerOptions(
|
||||
|
||||
return docker.CreateContainerOptions{
|
||||
Name: "upaas-" + app.Name,
|
||||
Image: "upaas/" + app.Name + ":latest",
|
||||
Image: fmt.Sprintf("upaas-%s:%d", app.Name, deploymentID),
|
||||
Env: envMap,
|
||||
Labels: buildLabelMap(app, labels),
|
||||
Volumes: buildVolumeMounts(volumes),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user