2021-06-25 10:56:22 +02:00
|
|
|
package common
|
|
|
|
|
|
|
|
type image string
|
|
|
|
|
|
|
|
func (i image) String() string { return string(i) }
|
|
|
|
|
|
|
|
type dockerhubImage image
|
|
|
|
|
|
|
|
type zitadelImage image
|
|
|
|
|
|
|
|
const (
|
2021-12-13 11:14:15 +01:00
|
|
|
CockroachImage dockerhubImage = "cockroachdb/cockroach:v21.2.2"
|
2021-06-25 10:56:22 +02:00
|
|
|
PostgresImage dockerhubImage = "postgres:9.6.17"
|
2021-10-29 11:30:51 +02:00
|
|
|
FlywayImage dockerhubImage = "flyway/flyway:8.0.2"
|
2021-06-25 10:56:22 +02:00
|
|
|
AlpineImage dockerhubImage = "alpine:3.11"
|
|
|
|
ZITADELImage zitadelImage = "caos/zitadel"
|
|
|
|
BackupImage zitadelImage = "caos/zitadel-crbackup"
|
|
|
|
ZITADELOperatorImage zitadelImage = "caos/zitadel-operator"
|
|
|
|
)
|
|
|
|
|
|
|
|
func (z zitadelImage) Reference(customImageRegistry, version string) string {
|
|
|
|
|
|
|
|
reg := "ghcr.io"
|
|
|
|
if customImageRegistry != "" {
|
|
|
|
reg = customImageRegistry
|
|
|
|
}
|
|
|
|
|
|
|
|
return concat(image(z), reg, version)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (d dockerhubImage) Reference(customImageRegistry string) string {
|
|
|
|
return concat(image(d), customImageRegistry, "")
|
|
|
|
}
|
|
|
|
|
|
|
|
func concat(img image, customImageRegistry, version string) string {
|
|
|
|
str := img.String()
|
|
|
|
|
|
|
|
if customImageRegistry != "" {
|
|
|
|
str = customImageRegistry + "/" + str
|
|
|
|
}
|
|
|
|
|
|
|
|
if version != "" {
|
|
|
|
str = str + ":" + version
|
|
|
|
}
|
|
|
|
return str
|
|
|
|
}
|