add global resource limmits

This commit is contained in:
Brad Rydzewski
2019-10-29 13:08:42 -07:00
parent 3c1ae23a1e
commit 3761bd0df4
10 changed files with 49 additions and 64 deletions

View File

@@ -73,6 +73,15 @@ type Config struct {
Trusted bool `envconfig:"DRONE_LIMIT_TRUSTED"`
}
Resources struct {
Memory int64 `envconfig:"DRONE_MEMORY_LIMIT"`
MemorySwap int64 `envconfig:"DRONE_MEMORY_SWAP_LIMIT"`
CPUQuota int64 `envconfig:"DRONE_CPU_QUOTA"`
CPUPeriod int64 `envconfig:"DRONE_CPU_PERIOD"`
CPUShares int64 `envconfig:"DRONE_CPU_SHARES"`
CPUSet []string `envconfig:"DRONE_CPU_SET"`
}
Secret struct {
Endpoint string `envconfig:"DRONE_SECRET_PLUGIN_ENDPOINT"`
Token string `envconfig:"DRONE_SECRET_PLUGIN_TOKEN"`