github-releases-bot/magefile.go

22 lines
489 B
Go
Raw Normal View History

2024-07-11 10:29:54 +02:00
//go:build mage
package main
import (
"github.com/magefile/mage/mg"
"github.com/magefile/mage/sh"
)
const app = "github-release-bot"
2024-07-26 10:25:20 +02:00
// Build builds and exports the application as a docker image tar file.
func Build() error {
2024-07-29 21:49:57 +02:00
return sh.RunV("./gradlew", "clean", "build", "jibBuildTar")
2024-07-11 10:29:54 +02:00
}
2024-07-26 10:25:20 +02:00
// Deploy deploys the application to a specified host via scp.
2024-07-11 10:29:54 +02:00
func Deploy(host string) error {
2024-07-26 10:25:20 +02:00
mg.Deps(Build)
2024-07-11 10:29:54 +02:00
return sh.RunV("scp", "app/build/"+app+".tar", host+":/opt/stacks/"+app+"/")
}