builds docker image

This commit is contained in:
David Zhao
2021-01-19 22:09:11 -08:00
parent f2e31ebdac
commit 18264e7a8b
4 changed files with 45 additions and 2 deletions
+14 -2
View File
@@ -7,15 +7,16 @@ import (
"fmt"
"go/build"
"io/ioutil"
"log"
"os"
"os/exec"
"path/filepath"
"sort"
"strings"
"github.com/livekit/livekit-server/version"
"github.com/magefile/mage/mg"
"github.com/magefile/mage/target"
log "github.com/pion/ion-log"
)
const (
@@ -134,6 +135,17 @@ func Build() error {
return nil
}
// builds docker image for LiveKit server
func BuildDocker() error {
mg.Deps(Proto, generateWire)
cmd := exec.Command("docker", "build", ".", "-t", "livekit/livekit:v"+version.Version)
connectStd(cmd)
if err := cmd.Run(); err != nil {
return err
}
return nil
}
// run unit tests, skipping integration
func Test() error {
mg.Deps(Proto)
@@ -296,7 +308,7 @@ func NewChecksummer(dir string, checksumfile string, exts ...string) *Checksumme
func (c *Checksummer) IsChanged() bool {
// default changed
if err := c.computeChecksum(); err != nil {
log.Errorf("could not compute checksum: %v", err)
log.Println("could not compute checksum", err)
return true
}
// read