mirror of
https://github.com/semaphoreui/semaphore.git
synced 2025-01-20 15:29:28 +01:00
feat: create none inventory by default
This commit is contained in:
parent
4c8312bc9b
commit
4a5ca60c70
@ -1,10 +1,10 @@
|
||||
package projects
|
||||
|
||||
import (
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/ansible-semaphore/semaphore/api/helpers"
|
||||
"github.com/ansible-semaphore/semaphore/db"
|
||||
"github.com/ansible-semaphore/semaphore/util"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"net/http"
|
||||
|
||||
"github.com/gorilla/context"
|
||||
@ -223,6 +223,17 @@ func AddProject(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
_, err = store.CreateInventory(db.Inventory{
|
||||
Name: "None",
|
||||
ProjectID: body.ID,
|
||||
Type: "none",
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
helpers.WriteError(w, err)
|
||||
return
|
||||
}
|
||||
|
||||
if bodyWithDemo.Demo {
|
||||
err = createDemoProject(body.ID, store)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user