mirror of
https://github.com/lightningnetwork/lnd.git
synced 2024-11-19 01:43:16 +01:00
build/deployment: add prod+dev targets
This commit is contained in:
parent
10b35a8f20
commit
738ba45bcf
36
build/deployment.go
Normal file
36
build/deployment.go
Normal file
@ -0,0 +1,36 @@
|
||||
package build
|
||||
|
||||
// DeploymentType is an enum specifying the deployment to compile.
|
||||
type DeploymentType byte
|
||||
|
||||
const (
|
||||
// Development is a deployment that includes extra testing hooks and
|
||||
// logging configurations.
|
||||
Development DeploymentType = iota
|
||||
|
||||
// Production is a deployment that strips out testing logic and uses
|
||||
// Default logging.
|
||||
Production
|
||||
)
|
||||
|
||||
// String returns a human readable name for a build type.
|
||||
func (b DeploymentType) String() string {
|
||||
switch b {
|
||||
case Development:
|
||||
return "development"
|
||||
case Production:
|
||||
return "production"
|
||||
default:
|
||||
return "unknown"
|
||||
}
|
||||
}
|
||||
|
||||
// IsProdBuild returns true if this is a production build.
|
||||
func IsProdBuild() bool {
|
||||
return Deployment == Production
|
||||
}
|
||||
|
||||
// IsDevBuild returns true if this is a development build.
|
||||
func IsDevBuild() bool {
|
||||
return Deployment == Development
|
||||
}
|
6
build/deployment_dev.go
Normal file
6
build/deployment_dev.go
Normal file
@ -0,0 +1,6 @@
|
||||
// +build dev
|
||||
|
||||
package build
|
||||
|
||||
// Deployment specifies a development build.
|
||||
const Deployment = Development
|
6
build/deployment_prod.go
Normal file
6
build/deployment_prod.go
Normal file
@ -0,0 +1,6 @@
|
||||
// +build !dev
|
||||
|
||||
package build
|
||||
|
||||
// Deployment specifies a production build.
|
||||
const Deployment = Production
|
Loading…
Reference in New Issue
Block a user