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" echo "Getting packr2 and building embedded files"
go get -u github.com/gobuffalo/packr/v2/packr2 go get -u github.com/gobuffalo/packr/v2/packr2
packr2
echo "Building project" echo "Building project"
go generate ${SRCFILES}
go build -o ${PROJECTNAME} ${GOOPTIONS} ${SRCFILES} go build -o ${PROJECTNAME} ${GOOPTIONS} ${SRCFILES}
if [[ ! -z $DRONE_TAG ]] if [[ ! -z $DRONE_TAG ]]

View File

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

View File

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

View File

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