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()
|
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
|
// Create log writer that flushes build output to deployment logs every second
|
||||||
logWriter := newDeploymentLogWriter(ctx, deployment)
|
logWriter := newDeploymentLogWriter(ctx, deployment)
|
||||||
@ -721,9 +721,9 @@ func (svc *Service) createAndStartContainer(
|
|||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
app *models.App,
|
app *models.App,
|
||||||
deployment *models.Deployment,
|
deployment *models.Deployment,
|
||||||
imageID string,
|
_ string,
|
||||||
) (string, error) {
|
) (string, error) {
|
||||||
containerOpts, err := svc.buildContainerOptions(ctx, app, imageID)
|
containerOpts, err := svc.buildContainerOptions(ctx, app, deployment.ID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
svc.failDeployment(ctx, app, deployment, err)
|
svc.failDeployment(ctx, app, deployment, err)
|
||||||
|
|
||||||
@ -767,7 +767,7 @@ func (svc *Service) createAndStartContainer(
|
|||||||
func (svc *Service) buildContainerOptions(
|
func (svc *Service) buildContainerOptions(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
app *models.App,
|
app *models.App,
|
||||||
_ string,
|
deploymentID int64,
|
||||||
) (docker.CreateContainerOptions, error) {
|
) (docker.CreateContainerOptions, error) {
|
||||||
envVars, err := app.GetEnvVars(ctx)
|
envVars, err := app.GetEnvVars(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -801,7 +801,7 @@ func (svc *Service) buildContainerOptions(
|
|||||||
|
|
||||||
return docker.CreateContainerOptions{
|
return docker.CreateContainerOptions{
|
||||||
Name: "upaas-" + app.Name,
|
Name: "upaas-" + app.Name,
|
||||||
Image: "upaas/" + app.Name + ":latest",
|
Image: fmt.Sprintf("upaas-%s:%d", app.Name, deploymentID),
|
||||||
Env: envMap,
|
Env: envMap,
|
||||||
Labels: buildLabelMap(app, labels),
|
Labels: buildLabelMap(app, labels),
|
||||||
Volumes: buildVolumeMounts(volumes),
|
Volumes: buildVolumeMounts(volumes),
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user