updated static files generation handling
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Paul 2020-12-08 21:05:30 +01:00
parent 48e1aeb067
commit d99c6c9959
6 changed files with 17 additions and 12 deletions

View File

@ -30,9 +30,9 @@ build() {
echo "Getting packr2 and building embedded files"
go get -u github.com/gobuffalo/packr/v2/packr2
packr2
echo "Building project"
go generate ${SRCFILES}
go build -o ${PROJECTNAME} ${GOOPTIONS} ${SRCFILES}
if [[ ! -z $DRONE_TAG ]]

View File

@ -1,13 +1,15 @@
//go:generate packr2 -v
package main
import (
"log"
_ "git.paulbsd.com/paulbsd/qrz/packrd"
"git.paulbsd.com/paulbsd/qrz/src/config"
"git.paulbsd.com/paulbsd/qrz/src/database"
"git.paulbsd.com/paulbsd/qrz/src/qrz"
"git.paulbsd.com/paulbsd/qrz/src/qrzws"
"github.com/gobuffalo/packr/v2"
_ "github.com/lib/pq"
)
@ -18,6 +20,8 @@ func main() {
cfg.GetConfig()
cfg.Version = version
PackrGen()
err := database.Initialize(&cfg)
if err != nil {
log.Fatalln(err)
@ -34,3 +38,8 @@ func main() {
log.Fatalln(err)
}
}
func PackrGen() {
packr.New("static", "../../static")
packr.New("templates", "../../templates")
}

View File

@ -1,10 +0,0 @@
package main
import (
"github.com/gobuffalo/packr/v2"
)
func main() {
packr.New("static", "./static")
packr.New("templates", "./templates")
}

View File

@ -1,3 +1,5 @@
//go:generate packr2 -v
package qrzws
import (

View File

@ -1,3 +1,5 @@
//go:generate packr2 -v
package static
import (

View File

@ -1,3 +1,5 @@
//go:generate packr2 -v
package templates
import (