Skip to content

Commit

Permalink
Support COMPOSE_PROJECT_NAME (#1524)
Browse files Browse the repository at this point in the history
  • Loading branch information
bkneis authored Jan 7, 2025
1 parent d20ef1b commit 9477825
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/compose/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"encoding/json"
"fmt"
"io"
"os"
"os/exec"
"regexp"
"strings"
Expand Down Expand Up @@ -190,6 +191,10 @@ func (h *ComposeHelper) FindProjectFiles(ctx context.Context, projectName string
}

func (h *ComposeHelper) GetProjectName(runnerID string) string {
// Check for project name override - https://docs.docker.com/compose/how-tos/project-name/
if projectNameOverride := os.Getenv("COMPOSE_PROJECT_NAME"); projectNameOverride != "" {
return projectNameOverride
}
return h.toProjectName(runnerID)
}

Expand Down

0 comments on commit 9477825

Please sign in to comment.