Dan Anglin
beb3826190
Also update magefiles to always enable logging to os.Stdout when verifying downloaded files.
41 lines
702 B
Go
41 lines
702 B
Go
//go:build mage
|
|
|
|
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
|
|
"github.com/magefile/mage/mg"
|
|
"github.com/magefile/mage/sh"
|
|
)
|
|
|
|
// Deploy deploys the services to the Flow Platform.
|
|
func Deploy(environment, name string) error {
|
|
mg.Deps(
|
|
mg.F(Prepare, environment, name),
|
|
)
|
|
|
|
cfg, err := newConfig(environment)
|
|
if err != nil {
|
|
return fmt.Errorf("unable to load the configuration; %w", err)
|
|
}
|
|
|
|
os.Setenv("DOCKER_HOST", cfg.Docker.Host)
|
|
|
|
command := []string{
|
|
"docker",
|
|
"compose",
|
|
"--project-directory",
|
|
fmt.Sprintf("%s/%s/compose", rootBuildDir, environment),
|
|
"up",
|
|
"-d",
|
|
"--build",
|
|
}
|
|
|
|
if name != "all" {
|
|
command = append(command, name)
|
|
}
|
|
|
|
return sh.RunV(command[0], command[1:]...)
|
|
}
|