-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.go
45 lines (37 loc) · 886 Bytes
/
release.go
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package main
import (
"context"
"runtime/debug"
"github.com/hashicorp/go-hclog"
"github.com/hashicorp/waypoint-plugin-sdk/component"
"github.com/hashicorp/waypoint-plugin-sdk/terminal"
)
// Releaser is the ReleaseManager implementation
type Releaser struct {
}
// ReleaseFunc implements component.ReleaseManager
func (r *Releaser) ReleaseFunc() interface{} {
return r.release
}
func (r *Release) URL() string { return r.Url }
func (r *Releaser) release(
ctx context.Context,
ui terminal.UI,
src *component.Source,
job *component.JobInfo,
log hclog.Logger,
deployment *Deployment,
) (*Release, error) {
defer func() {
if r := recover(); r != nil {
log.Error("Panic: %s %s", r, string(debug.Stack()))
}
}()
return &Release{
Url: deployment.Url,
}, nil
}
var (
_ component.ReleaseManager = (*Releaser)(nil)
_ component.Release = (*Release)(nil)
)