aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/setting/actions.go9
-rw-r--r--modules/storage/storage.go11
2 files changed, 16 insertions, 4 deletions
diff --git a/modules/setting/actions.go b/modules/setting/actions.go
index b11500dab4..eb1b637a1c 100644
--- a/modules/setting/actions.go
+++ b/modules/setting/actions.go
@@ -10,7 +10,8 @@ import (
// Actions settings
var (
Actions = struct {
- Storage // how the created logs should be stored
+ LogStorage Storage // how the created logs should be stored
+ ArtifactStorage Storage // how the created artifacts should be stored
Enabled bool
DefaultActionsURL string `ini:"DEFAULT_ACTIONS_URL"`
}{
@@ -25,5 +26,9 @@ func loadActionsFrom(rootCfg ConfigProvider) {
log.Fatal("Failed to map Actions settings: %v", err)
}
- Actions.Storage = getStorage(rootCfg, "actions_log", "", nil)
+ actionsSec := rootCfg.Section("actions.artifacts")
+ storageType := actionsSec.Key("STORAGE_TYPE").MustString("")
+
+ Actions.LogStorage = getStorage(rootCfg, "actions_log", "", nil)
+ Actions.ArtifactStorage = getStorage(rootCfg, "actions_artifacts", storageType, actionsSec)
}
diff --git a/modules/storage/storage.go b/modules/storage/storage.go
index caecab306e..5b6efccb6a 100644
--- a/modules/storage/storage.go
+++ b/modules/storage/storage.go
@@ -128,6 +128,8 @@ var (
// Actions represents actions storage
Actions ObjectStorage = uninitializedStorage
+ // Actions Artifacts represents actions artifacts storage
+ ActionsArtifacts ObjectStorage = uninitializedStorage
)
// Init init the stoarge
@@ -212,9 +214,14 @@ func initPackages() (err error) {
func initActions() (err error) {
if !setting.Actions.Enabled {
Actions = discardStorage("Actions isn't enabled")
+ ActionsArtifacts = discardStorage("ActionsArtifacts isn't enabled")
return nil
}
- log.Info("Initialising Actions storage with type: %s", setting.Actions.Storage.Type)
- Actions, err = NewStorage(setting.Actions.Storage.Type, &setting.Actions.Storage)
+ log.Info("Initialising Actions storage with type: %s", setting.Actions.LogStorage.Type)
+ if Actions, err = NewStorage(setting.Actions.LogStorage.Type, &setting.Actions.LogStorage); err != nil {
+ return err
+ }
+ log.Info("Initialising ActionsArtifacts storage with type: %s", setting.Actions.ArtifactStorage.Type)
+ ActionsArtifacts, err = NewStorage(setting.Actions.ArtifactStorage.Type, &setting.Actions.ArtifactStorage)
return err
}