From 8ac61c6318f14272047d9c4205f76b2166dd91a5 Mon Sep 17 00:00:00 2001 From: warber Date: Fri, 13 Oct 2023 12:52:54 +0200 Subject: [PATCH] chore: sketched next steps for trigger deployment Signed-off-by: Bernd Warmuth --- cmd/monaco/deploy/acc/deploy.go | 39 +++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 cmd/monaco/deploy/acc/deploy.go diff --git a/cmd/monaco/deploy/acc/deploy.go b/cmd/monaco/deploy/acc/deploy.go new file mode 100644 index 0000000000..36920567fa --- /dev/null +++ b/cmd/monaco/deploy/acc/deploy.go @@ -0,0 +1,39 @@ +/* + * @license + * Copyright 2023 Dynatrace LLC + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package acc + +import ( + "github.com/dynatrace/dynatrace-configuration-as-code/v2/pkg/persistence/account" + "github.com/spf13/afero" +) + +// deployAcc triggers the deployment of account management resources for a given monaco project +func deployAcc(fs afero.Fs, projectName string) error { // nolint:unused + accResources, err := account.Load(fs, projectName) + if err != nil { + return err + } + + err = account.Validate(accResources) + if err != nil { + return err + } + + // (tbd) convert acc resources to internal representation to be deployable and pass to pkg/deploy/acc::Deploy() + + return nil +}