Update magefile

This commit is contained in:
Ryan Harg 2024-09-16 13:51:36 +02:00
parent 1b09d6791a
commit 8740379647

View file

@ -9,13 +9,19 @@ import (
const app = "github-release-bot" const app = "github-release-bot"
// Build builds and exports the application as a docker image tar file. // Build builds the application.
func Build() error { func Build() error {
return sh.RunV("./gradlew", "clean", "build", "jibBuildTar") return sh.RunV("./gradlew", "clean", "build")
}
// BuildImage builds a docke rimage and exports it as a tar file.
func BuildImage() error {
mg.Deps(Build)
return sh.RunV("./gradlew", "jibBuildTar")
} }
// Deploy deploys the application to a specified host via scp. // Deploy deploys the application to a specified host via scp.
func Deploy(host string) error { func Deploy(host string) error {
mg.Deps(Build) mg.Deps(BuildImage)
return sh.RunV("scp", "app/build/"+app+".tar", host+":/opt/stacks/"+app+"/") return sh.RunV("scp", "app/build/"+app+".tar", host+":/opt/stacks/"+app+"/")
} }