/
legacy_interface.go
80 lines (61 loc) · 1.81 KB
/
legacy_interface.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
package container_backend
import (
"context"
"github.com/werf/werf/pkg/image"
)
type BuildOptions struct {
IntrospectBeforeError bool
IntrospectAfterError bool
}
type LegacyImageInterface interface {
Name() string
SetName(name string)
Pull(ctx context.Context) error
Push(ctx context.Context) error
// TODO: build specifics for stapel builder and dockerfile builder
// TODO: should be under a single separate interface
Container() LegacyContainer
BuilderContainer() LegacyBuilderContainer
Build(context.Context, BuildOptions) error
SetBuiltID(builtID string)
GetBuiltID() string
BuiltID() string
TagBuiltImage(ctx context.Context) error
Introspect(ctx context.Context) error
SetInfo(info *image.Info)
IsExistsLocally() bool
SetStageDescription(stage *image.StageDescription)
GetStageDescription() *image.StageDescription
GetCopy() LegacyImageInterface
}
type LegacyContainer interface {
Name() string
UserRunCommands() []string
UserCommitChanges() []string
AddServiceRunCommands(commands ...string)
AddRunCommands(commands ...string)
RunOptions() LegacyContainerOptions
CommitChangeOptions() LegacyContainerOptions
ServiceCommitChangeOptions() LegacyContainerOptions
}
type LegacyBuilderContainer interface {
AddServiceRunCommands(commands ...string)
AddRunCommands(commands ...string)
AddVolume(volumes ...string)
AddVolumeFrom(volumesFrom ...string)
AddExpose(exposes ...string)
AddEnv(envs map[string]string)
AddLabel(labels map[string]string)
}
type LegacyContainerOptions interface {
AddVolume(volumes ...string)
AddVolumeFrom(volumesFrom ...string)
AddExpose(exposes ...string)
AddEnv(envs map[string]string)
AddLabel(labels map[string]string)
AddCmd(cmd string)
AddWorkdir(workdir string)
AddUser(user string)
AddEntrypoint(entrypoint string)
AddHealthCheck(check string)
}