You've already forked woodpecker
mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-07-12 22:21:40 +02:00
Global and organization registries (#1672)
Co-authored-by: Anbraten <6918444+anbraten@users.noreply.github.com>
This commit is contained in:
@ -27,7 +27,7 @@ import (
|
||||
// GetRegistry
|
||||
//
|
||||
// @Summary Get a registry by name
|
||||
// @Router /repos/{repo_id}/registry/{registry} [get]
|
||||
// @Router /repos/{repo_id}/registries/{registry} [get]
|
||||
// @Produce json
|
||||
// @Success 200 {object} Registry
|
||||
// @Tags Repository registries
|
||||
@ -36,10 +36,10 @@ import (
|
||||
// @Param registry path string true "the registry name"
|
||||
func GetRegistry(c *gin.Context) {
|
||||
repo := session.Repo(c)
|
||||
name := c.Param("registry")
|
||||
addr := c.Param("registry")
|
||||
|
||||
registryService := server.Config.Services.Manager.RegistryServiceFromRepo(repo)
|
||||
registry, err := registryService.RegistryFind(repo, name)
|
||||
registry, err := registryService.RegistryFind(repo, addr)
|
||||
if err != nil {
|
||||
handleDBError(c, err)
|
||||
return
|
||||
@ -50,7 +50,7 @@ func GetRegistry(c *gin.Context) {
|
||||
// PostRegistry
|
||||
//
|
||||
// @Summary Create a registry
|
||||
// @Router /repos/{repo_id}/registry [post]
|
||||
// @Router /repos/{repo_id}/registries [post]
|
||||
// @Produce json
|
||||
// @Success 200 {object} Registry
|
||||
// @Tags Repository registries
|
||||
@ -87,7 +87,7 @@ func PostRegistry(c *gin.Context) {
|
||||
// PatchRegistry
|
||||
//
|
||||
// @Summary Update a registry by name
|
||||
// @Router /repos/{repo_id}/registry/{registry} [patch]
|
||||
// @Router /repos/{repo_id}/registries/{registry} [patch]
|
||||
// @Produce json
|
||||
// @Success 200 {object} Registry
|
||||
// @Tags Repository registries
|
||||
@ -96,10 +96,8 @@ func PostRegistry(c *gin.Context) {
|
||||
// @Param registry path string true "the registry name"
|
||||
// @Param registryData body Registry true "the attributes for the registry"
|
||||
func PatchRegistry(c *gin.Context) {
|
||||
var (
|
||||
repo = session.Repo(c)
|
||||
name = c.Param("registry")
|
||||
)
|
||||
repo := session.Repo(c)
|
||||
addr := c.Param("registry")
|
||||
|
||||
in := new(model.Registry)
|
||||
err := c.Bind(in)
|
||||
@ -109,7 +107,7 @@ func PatchRegistry(c *gin.Context) {
|
||||
}
|
||||
|
||||
registryService := server.Config.Services.Manager.RegistryServiceFromRepo(repo)
|
||||
registry, err := registryService.RegistryFind(repo, name)
|
||||
registry, err := registryService.RegistryFind(repo, addr)
|
||||
if err != nil {
|
||||
handleDBError(c, err)
|
||||
return
|
||||
@ -135,7 +133,7 @@ func PatchRegistry(c *gin.Context) {
|
||||
// GetRegistryList
|
||||
//
|
||||
// @Summary List registries
|
||||
// @Router /repos/{repo_id}/registry [get]
|
||||
// @Router /repos/{repo_id}/registries [get]
|
||||
// @Produce json
|
||||
// @Success 200 {array} Registry
|
||||
// @Tags Repository registries
|
||||
@ -162,7 +160,7 @@ func GetRegistryList(c *gin.Context) {
|
||||
// DeleteRegistry
|
||||
//
|
||||
// @Summary Delete a registry by name
|
||||
// @Router /repos/{repo_id}/registry/{registry} [delete]
|
||||
// @Router /repos/{repo_id}/registries/{registry} [delete]
|
||||
// @Produce plain
|
||||
// @Success 204
|
||||
// @Tags Repository registries
|
||||
@ -171,10 +169,10 @@ func GetRegistryList(c *gin.Context) {
|
||||
// @Param registry path string true "the registry name"
|
||||
func DeleteRegistry(c *gin.Context) {
|
||||
repo := session.Repo(c)
|
||||
name := c.Param("registry")
|
||||
addr := c.Param("registry")
|
||||
|
||||
registryService := server.Config.Services.Manager.RegistryServiceFromRepo(repo)
|
||||
err := registryService.RegistryDelete(repo, name)
|
||||
err := registryService.RegistryDelete(repo, addr)
|
||||
if err != nil {
|
||||
handleDBError(c, err)
|
||||
return
|
||||
|
Reference in New Issue
Block a user