github-releases-bot/magefile.go
2024-09-16 13:51:36 +02:00

27 lines
596 B
Go

//go:build mage
package main
import (
"github.com/magefile/mage/mg"
"github.com/magefile/mage/sh"
)
const app = "github-release-bot"
// Build builds the application.
func Build() error {
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.
func Deploy(host string) error {
mg.Deps(BuildImage)
return sh.RunV("scp", "app/build/"+app+".tar", host+":/opt/stacks/"+app+"/")
}