mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-10-22 05:47:57 +00:00
added revision number to drone
binary, per issue #230
This commit is contained in:
2
Makefile
2
Makefile
@@ -56,7 +56,7 @@ js:
|
|||||||
cd cmd/droned/assets && find js -name "*.js" ! -name '.*' ! -name "main.js" -exec cat {} \; > js/main.js
|
cd cmd/droned/assets && find js -name "*.js" ! -name '.*' ! -name "main.js" -exec cat {} \; > js/main.js
|
||||||
|
|
||||||
build:
|
build:
|
||||||
cd cmd/drone && go build -o ../../bin/drone
|
cd cmd/drone && go build -ldflags "-X main.version $(SHA)" -o ../../bin/drone
|
||||||
cd cmd/droned && go build -ldflags "-X main.version $(SHA)" -o ../../bin/droned
|
cd cmd/droned && go build -ldflags "-X main.version $(SHA)" -o ../../bin/droned
|
||||||
|
|
||||||
test: $(PKGS)
|
test: $(PKGS)
|
||||||
|
@@ -39,6 +39,10 @@ var (
|
|||||||
|
|
||||||
// displays the help / usage if True
|
// displays the help / usage if True
|
||||||
help = flag.Bool("h", false, "")
|
help = flag.Bool("h", false, "")
|
||||||
|
|
||||||
|
// version number, currently deterined by the
|
||||||
|
// git revision number (sha)
|
||||||
|
version string
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
@@ -103,6 +107,10 @@ func main() {
|
|||||||
path = filepath.Join(path, ".drone.yml")
|
path = filepath.Join(path, ".drone.yml")
|
||||||
vet(path)
|
vet(path)
|
||||||
|
|
||||||
|
// print the version / revision number
|
||||||
|
case args[0] == "version" && len(args) == 1:
|
||||||
|
println(version)
|
||||||
|
|
||||||
// print the help message
|
// print the help message
|
||||||
case args[0] == "help" && len(args) == 1:
|
case args[0] == "help" && len(args) == 1:
|
||||||
flag.Usage()
|
flag.Usage()
|
||||||
|
Reference in New Issue
Block a user