github-releases-bot/magefile.go

21 lines
489 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 and exports the application as a docker image tar file.
func Build() error {
return sh.RunV("./gradlew", "clean", "build", "jibBuildTar")
}
// Deploy deploys the application to a specified host via scp.
func Deploy(host string) error {
mg.Deps(Build)
return sh.RunV("scp", "app/build/"+app+".tar", host+":/opt/stacks/"+app+"/")
}