Skip to content

Commit

Permalink
feat(images): Official image tags in the env file are now supported (…
Browse files Browse the repository at this point in the history
…for mysql, mariadb and pgsql)

Refs: CU-8694wmpza
  • Loading branch information
varrcan committed Jul 7, 2024
1 parent 95bb5be commit 98cab5b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion command/up.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func upCommand() *cobra.Command {
Short: "Up project",
Long: `Start project containers. On completion, displays the local links to the project.
Analogue of the "docker-compose up -d" command.`,
Run: func(cmd *cobra.Command, args []string) {
Run: func(_ *cobra.Command, _ []string) {
upRun()
// check for new version
utils.CheckUpdates()
Expand Down
10 changes: 5 additions & 5 deletions project/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func setDefaultEnv() {
Env.SetDefault("REDIS_PASSWORD", "pass")
Env.SetDefault("MEMCACHED", false)

host := getLocalIp()
host := getLocalIP()

Env.SetDefault("LOCAL_IP", host)
Env.SetDefault("NIP_DOMAIN", fmt.Sprintf("%s.%s.nip.io", projectName, host))
Expand Down Expand Up @@ -129,13 +129,13 @@ func setComposeFiles() {
}
}

if Env.GetFloat64("MYSQL_VERSION") > 0 {
if len(Env.GetString("MYSQL_VERSION")) > 0 {
files = append(files, images["mysql"])
}
if Env.GetFloat64("MARIADB_VERSION") > 0 {
if len(Env.GetString("MARIADB_VERSION")) > 0 {
files = append(files, images["mariadb"])
}
if Env.GetFloat64("POSTGRES_VERSION") > 0 {
if len(Env.GetString("POSTGRES_VERSION")) > 0 {
files = append(files, images["pgsql"])
}
if Env.GetBool("REDIS") {
Expand Down Expand Up @@ -210,7 +210,7 @@ func IsEnvExampleFileExists() bool {
return err == nil
}

func getLocalIp() string {
func getLocalIP() string {
addrs, err := net.InterfaceAddrs()
if err != nil {
return "127.0.0.1"
Expand Down

0 comments on commit 98cab5b

Please sign in to comment.