-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
29 lines (24 loc) · 921 Bytes
/
main.go
File metadata and controls
29 lines (24 loc) · 921 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package main
import (
"context"
"github.com/digital-ai/community-release-k8s-integration/k8s/cmd"
"github.com/digital-ai/community-release-k8s-integration/task/server"
"github.com/digital-ai/release-integration-sdk-go/runner"
"github.com/digital-ai/release-integration-sdk-go/task"
"github.com/digital-ai/release-integration-sdk-go/task/command"
"os"
)
var PluginVersion = os.Getenv("VERSION")
var BuildDate = os.Getenv("BUILD_DATE")
func prepareCommandFactory(input task.InputContext) (command.CommandFactory, error) {
k8sServer, err := server.DeserializeKubernetesServer(input.Task.Properties)
if err != nil {
return nil, err
}
return cmd.NewK8sCommandFactory(*k8sServer, task.DefaultResponseResultField, task.SecureResponseResultField)
}
var commandRunner = runner.NewCommandRunner(prepareCommandFactory)
func main() {
context.Background()
runner.Execute(PluginVersion, BuildDate, commandRunner)
}