mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-10-21 23:10:44 +00:00
added git revision to the binary for debugging purposes
This commit is contained in:
4
Makefile
4
Makefile
@@ -1,3 +1,5 @@
|
|||||||
|
SHA := $(shell git rev-parse --short HEAD)
|
||||||
|
BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
|
||||||
|
|
||||||
all: embed build
|
all: embed build
|
||||||
|
|
||||||
@@ -32,7 +34,7 @@ embed:
|
|||||||
|
|
||||||
build:
|
build:
|
||||||
cd cmd/drone && go build -o ../../bin/drone
|
cd cmd/drone && go build -o ../../bin/drone
|
||||||
cd cmd/droned && go build -o ../../bin/droned
|
cd cmd/droned && go build -ldflags "-X main.version $(SHA)" -o ../../bin/droned
|
||||||
|
|
||||||
test:
|
test:
|
||||||
go test -v github.com/drone/drone/pkg/build
|
go test -v github.com/drone/drone/pkg/build
|
||||||
|
@@ -46,6 +46,9 @@ var (
|
|||||||
// build will timeout after N milliseconds.
|
// build will timeout after N milliseconds.
|
||||||
// this will default to 500 minutes (6 hours)
|
// this will default to 500 minutes (6 hours)
|
||||||
timeout time.Duration
|
timeout time.Duration
|
||||||
|
|
||||||
|
// commit sha for the current build.
|
||||||
|
version string
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@@ -67,6 +70,9 @@ func main() {
|
|||||||
setupStatic()
|
setupStatic()
|
||||||
setupHandlers()
|
setupHandlers()
|
||||||
|
|
||||||
|
// debug
|
||||||
|
log.Printf("starting drone version %s on port %s\n", version, port)
|
||||||
|
|
||||||
// start webserver using HTTPS or HTTP
|
// start webserver using HTTPS or HTTP
|
||||||
if sslcert != "" && sslkey != "" {
|
if sslcert != "" && sslkey != "" {
|
||||||
panic(http.ListenAndServeTLS(port, sslcert, sslkey, nil))
|
panic(http.ListenAndServeTLS(port, sslcert, sslkey, nil))
|
||||||
|
Reference in New Issue
Block a user