Support offline builds
This commit is contained in:
parent
27c77e1ab9
commit
d5803da1be
3 changed files with 2 additions and 8 deletions
|
@ -12,7 +12,7 @@ install:
|
||||||
- go get github.com/magefile/mage
|
- go get github.com/magefile/mage
|
||||||
|
|
||||||
build_script:
|
build_script:
|
||||||
- mage hugoRace
|
- mage vendor hugoRace
|
||||||
- mage -v check
|
- mage -v check
|
||||||
- hugo -s docs/
|
- hugo -s docs/
|
||||||
- hugo --renderToMemory -s docs/
|
- hugo --renderToMemory -s docs/
|
||||||
|
|
|
@ -45,19 +45,16 @@ func Vendor() error {
|
||||||
|
|
||||||
// Build hugo binary
|
// Build hugo binary
|
||||||
func Hugo() error {
|
func Hugo() error {
|
||||||
mg.Deps(Vendor)
|
|
||||||
return sh.RunWith(flagEnv(), goexe, "build", "-ldflags", ldflags, packageName)
|
return sh.RunWith(flagEnv(), goexe, "build", "-ldflags", ldflags, packageName)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build hugo binary with race detector enabled
|
// Build hugo binary with race detector enabled
|
||||||
func HugoRace() error {
|
func HugoRace() error {
|
||||||
mg.Deps(Vendor)
|
|
||||||
return sh.RunWith(flagEnv(), goexe, "build", "-race", "-ldflags", ldflags, packageName)
|
return sh.RunWith(flagEnv(), goexe, "build", "-race", "-ldflags", ldflags, packageName)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Install hugo binary
|
// Install hugo binary
|
||||||
func Install() error {
|
func Install() error {
|
||||||
mg.Deps(Vendor)
|
|
||||||
return sh.RunWith(flagEnv(), goexe, "install", "-ldflags", ldflags, packageName)
|
return sh.RunWith(flagEnv(), goexe, "install", "-ldflags", ldflags, packageName)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -115,13 +112,11 @@ func Test386() error {
|
||||||
|
|
||||||
// Run tests
|
// Run tests
|
||||||
func Test() error {
|
func Test() error {
|
||||||
mg.Deps(getDep)
|
|
||||||
return sh.Run(goexe, "test", "./...")
|
return sh.Run(goexe, "test", "./...")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Run tests with race detector
|
// Run tests with race detector
|
||||||
func TestRace() error {
|
func TestRace() error {
|
||||||
mg.Deps(getDep)
|
|
||||||
return sh.Run(goexe, "test", "-race", "./...")
|
return sh.Run(goexe, "test", "-race", "./...")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,8 +29,7 @@ parts:
|
||||||
export PATH=$GOPATH/bin:$PATH
|
export PATH=$GOPATH/bin:$PATH
|
||||||
cd $GOPATH/src/github.com/gohugoio/hugo
|
cd $GOPATH/src/github.com/gohugoio/hugo
|
||||||
go get github.com/magefile/mage
|
go get github.com/magefile/mage
|
||||||
mage vendor
|
mage vendor test
|
||||||
mage test
|
|
||||||
rm -f $GOPATH/bin/dep
|
rm -f $GOPATH/bin/dep
|
||||||
rm -f $GOPATH/bin/mage
|
rm -f $GOPATH/bin/mage
|
||||||
install: |
|
install: |
|
||||||
|
|
Loading…
Add table
Reference in a new issue