mirror of
https://github.com/semaphoreui/semaphore.git
synced 2025-01-20 23:39:56 +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":
|
||||
userKey = addAccessKey(&userProject.ID)
|
||||
case "repository":
|
||||
pRepo, err := store.Sql().Exec(
|
||||
"insert into project__repository (project_id, git_url, ssh_key_id, name) values (?, ?, ?, ?)",
|
||||
userProject.ID, "git@github.com/ansible,semaphore/semaphore", userKey.ID, "ITR-"+uid)
|
||||
pRepo, err := store.CreateRepository(db.Repository{
|
||||
ProjectID: userProject.ID,
|
||||
GitURL: "git@github.com/ansible,semaphore/semaphore",
|
||||
GitBranch: "develop",
|
||||
SSHKeyID: userKey.ID,
|
||||
Name: "ITR-" + uid,
|
||||
})
|
||||
printError(err)
|
||||
repoID, _ = pRepo.LastInsertId()
|
||||
repoID = int64(pRepo.ID)
|
||||
case "inventory":
|
||||
res, err := store.Sql().Exec(
|
||||
"insert into project__inventory (project_id, name, type, ssh_key_id, inventory) values (?, ?, ?, ?, ?)",
|
||||
|
Loading…
Reference in New Issue
Block a user