Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ var imageSetCmd = &cobra.Command{
}

func init() {
imageSetCmd.Flags().String("buildkit-tag", "", "Buildkit runtime tag to use as the template base image, such as php83 or php84.")
imageSetCmd.Flags().String("buildkit-tag", "", "Buildkit runtime tag to use as the template base image, such as nginx-1.30.2-php84.")
imageSetCmd.Flags().String("buildkit-repository", "libops", "Container repository for --buildkit-tag image refs.")
imageSetCmd.Flags().StringArray("image-ref", []string{}, "Override a Compose service image as SERVICE=IMAGE; may be passed more than once.")
imageSetCmd.Flags().StringArray("build-arg", []string{}, "Override a Compose service build arg as SERVICE.ARG=VALUE; may be passed more than once.")
Expand Down
14 changes: 8 additions & 6 deletions pkg/plugin/compose_image_overrides.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,16 +148,18 @@ func buildkitBaseImageTarget(pluginName string) (service, image string, ok bool)
switch strings.ToLower(strings.TrimSpace(pluginName)) {
case "archivesspace":
return "archivesspace", "archivesspace", true
case "drupal", "isle", "islandora":
return "drupal", "nginx", true
case "drupal":
return "drupal", "drupal", true
case "isle", "islandora":
return "drupal", "islandora", true
case "ojs":
return "ojs", "nginx", true
return "ojs", "ojs", true
case "omeka-classic":
return "omeka-classic", "nginx", true
return "omeka-classic", "omeka-classic", true
case "omeka-s":
return "omeka-s", "nginx", true
return "omeka-s", "omeka-s", true
case "wp", "wordpress":
return "wp", "nginx", true
return "wp", "wp", true
default:
return "", "", false
}
Expand Down
32 changes: 32 additions & 0 deletions pkg/plugin/compose_image_overrides_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package plugin

import "testing"

func TestResolveComposeImageOverridesBuildkitTagUsesApplicationBaseImages(t *testing.T) {
cases := []struct {
plugin string
service string
image string
}{
{plugin: "drupal", service: "drupal", image: "libops/drupal:nginx-1.30.2-php84"},
{plugin: "isle", service: "drupal", image: "libops/islandora:nginx-1.30.2-php84"},
{plugin: "islandora", service: "drupal", image: "libops/islandora:nginx-1.30.2-php84"},
{plugin: "ojs", service: "ojs", image: "libops/ojs:nginx-1.30.2-php84"},
{plugin: "omeka-classic", service: "omeka-classic", image: "libops/omeka-classic:nginx-1.30.2-php84"},
{plugin: "omeka-s", service: "omeka-s", image: "libops/omeka-s:nginx-1.30.2-php84"},
{plugin: "wp", service: "wp", image: "libops/wp:nginx-1.30.2-php84"},
}

for _, tt := range cases {
t.Run(tt.plugin, func(t *testing.T) {
overrides, err := ResolveComposeImageOverrides(tt.plugin, "libops", "nginx-1.30.2-php84", nil, nil)
if err != nil {
t.Fatalf("ResolveComposeImageOverrides() error = %v", err)
}
args := overrides.BuildArgs[tt.service]
if args["BASE_IMAGE"] != tt.image {
t.Fatalf("BASE_IMAGE for %s = %q, want %q", tt.service, args["BASE_IMAGE"], tt.image)
}
})
}
}
2 changes: 1 addition & 1 deletion pkg/plugin/creates.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ func (s *SDK) BindComposeCreateFlags(cmd *cobra.Command, spec CreateSpec, drupal
cmd.Flags().String("template-branch", normalizeCreateSpec(spec).DockerComposeBranch, "Branch or ref to clone from the template repository.")
cmd.Flags().Bool("default-context", false, "Set the new context as the default sitectl context.")
cmd.Flags().Bool("setup-only", false, "Clone and configure the checkout but do not start the stack.")
cmd.Flags().String("buildkit-tag", "", "Buildkit runtime tag to use as the template base image, such as php83 or php84.")
cmd.Flags().String("buildkit-tag", "", "Buildkit runtime tag to use as the template base image, such as nginx-1.30.2-php84.")
cmd.Flags().String("buildkit-repository", "libops", "Container repository for --buildkit-tag image refs.")
cmd.Flags().StringArray("image-ref", []string{}, "Override a Compose service image as SERVICE=IMAGE; may be passed more than once.")
cmd.Flags().StringArray("build-arg", []string{}, "Override a Compose service build arg as SERVICE.ARG=VALUE; may be passed more than once.")
Expand Down