mirror of
https://github.com/semaphoreui/semaphore.git
synced 2025-01-21 07:49:34 +01:00
test: create repo via store
This commit is contained in:
parent
bf32821820
commit
5196cf3e45
@ -80,11 +80,15 @@ func resolveCapability(caps []string, resolved []string, uid string) {
|
|||||||
case "access_key":
|
case "access_key":
|
||||||
userKey = addAccessKey(&userProject.ID)
|
userKey = addAccessKey(&userProject.ID)
|
||||||
case "repository":
|
case "repository":
|
||||||
pRepo, err := store.Sql().Exec(
|
pRepo, err := store.CreateRepository(db.Repository{
|
||||||
"insert into project__repository (project_id, git_url, ssh_key_id, name) values (?, ?, ?, ?)",
|
ProjectID: userProject.ID,
|
||||||
userProject.ID, "git@github.com/ansible,semaphore/semaphore", userKey.ID, "ITR-"+uid)
|
GitURL: "git@github.com/ansible,semaphore/semaphore",
|
||||||
|
GitBranch: "develop",
|
||||||
|
SSHKeyID: userKey.ID,
|
||||||
|
Name: "ITR-" + uid,
|
||||||
|
})
|
||||||
printError(err)
|
printError(err)
|
||||||
repoID, _ = pRepo.LastInsertId()
|
repoID = int64(pRepo.ID)
|
||||||
case "inventory":
|
case "inventory":
|
||||||
res, err := store.Sql().Exec(
|
res, err := store.Sql().Exec(
|
||||||
"insert into project__inventory (project_id, name, type, ssh_key_id, inventory) values (?, ?, ?, ?, ?)",
|
"insert into project__inventory (project_id, name, type, ssh_key_id, inventory) values (?, ?, ?, ?, ?)",
|
||||||
|
Loading…
Reference in New Issue
Block a user