Transmit user PGP keys
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
8251fb2f96
commit
5f0888a805
@ -349,10 +349,22 @@ func TriggerTagUpdate(c *gin.Context, work *Work, repo *Repository, u *User, tag
|
||||
repo_tag = *tag
|
||||
}
|
||||
|
||||
var pgp_keys string
|
||||
keys, err := u.GetKeys()
|
||||
if err != nil {
|
||||
c.AbortWithStatusJSON(http.StatusForbidden, gin.H{"errmsg": "Something goes really wrong with your PGP keys: unable to retrieve them."})
|
||||
return
|
||||
}
|
||||
|
||||
for _, k := range keys {
|
||||
pgp_keys += k.Content + "\n"
|
||||
}
|
||||
|
||||
client := drone.NewClient(droneEndpoint, droneConfig)
|
||||
result, err := client.BuildCreate("srs", "atsebay.t-worker", "", "master", map[string]string{
|
||||
"REPO_URL": repo.URI,
|
||||
"REPO_TAG": repo_tag,
|
||||
"USER_PGP_PUBKEY": pgp_keys,
|
||||
"LOGIN": u.Login,
|
||||
"DEST": fmt.Sprintf("%d", work.Id),
|
||||
})
|
||||
|
Reference in New Issue
Block a user