add cache to yaml

This commit is contained in:
Brad Rydzewski 2015-08-04 10:55:27 -07:00
parent 001e6c9f5f
commit c8405bfd2b
3 changed files with 16 additions and 2 deletions

View file

@ -15,6 +15,6 @@ Drone documentation is organized into several categories:
* [Plugin Guide](http://readme.drone.io/docs/plugin/)
* [API Reference](http://readme.drone.io/docs/api/)
### Community
### Community, Help
Contributions, questions, and comments are welcomed and encouraged. Drone developers hang out in the [drone/drone](https://gitter.im/drone/drone) room on [gitter](https://gitter.im/drone/drone).
Contributions, questions, and comments are welcomed and encouraged. Drone developers hang out in the [drone/drone](https://gitter.im/drone/drone) room on gitter. We ask that you please post your questions to [gitter](https://gitter.im/drone/drone) before creating an issue.

View file

@ -47,6 +47,7 @@ type Step struct {
Entrypoint []string
Command []string
Volumes []string
Cache []string
WorkingDir string `yaml:"working_dir"`
NetworkMode string `yaml:"net"`

View file

@ -37,3 +37,16 @@ func MarshalPrivateKey(privkey *rsa.PrivateKey) []byte {
privateKeyPEM := pem.EncodeToMemory(&pem.Block{Type: "RSA PRIVATE KEY", Headers: nil, Bytes: privateKeyMarshaled})
return privateKeyPEM
}
// helper function to encrypt a plain-text string using
// an RSA public key.
func Encrypt(pubkey *rsa.PublicKey, msg string) ([]byte, error) {
return rsa.EncryptPKCS1v15(rand.Reader, pubkey, []byte(msg))
}
// helper function to encrypt a plain-text string using
// an RSA public key.
func Decrypt(privkey *rsa.PrivateKey, secret string) (string, error) {
msg, err := rsa.DecryptPKCS1v15(rand.Reader, privkey, []byte(secret))
return string(msg), err
}