grim/convey
Clone
Summary
Browse
Changes
Graph
Merge the redux branch into default.
2021-12-20, Gary Kramlich
6b1dbda836d9
Merge the redux branch into default.
This officials abandons the 0.14.0 release and moves right on to 0.15.0 which
includes replacing docker with podman and simplifying many things.
package
docker
import
(
"fmt"
log
"github.com/sirupsen/logrus"
"keep.imfreedom.org/grim/convey/environment"
"keep.imfreedom.org/grim/convey/podman"
"keep.imfreedom.org/grim/convey/runtime"
"keep.imfreedom.org/grim/convey/tasks"
"keep.imfreedom.org/grim/convey/yaml"
)
type
Tag
struct
{
Source
string
`yaml:"source"`
Destination
string
`yaml:"destination"`
Destinations
yaml
.
StringOrSlice
`yaml:"destinations"`
realTag
*
podman
.
Tag
}
// New creates a new Tag task.
func
(
t
*
Tag
)
New
()
tasks
.
Task
{
return
&
Tag
{}
}
// Valid validates the Tag task.
func
(
t
*
Tag
)
Valid
()
error
{
if
t
.
Destination
!=
""
{
t
.
Destinations
=
append
([]
string
{
t
.
Destination
},
t
.
Destinations
...
)
}
t
.
realTag
=
&
podman
.
Tag
{
Image
:
t
.
Source
,
Targets
:
t
.
Destinations
,
}
return
t
.
realTag
.
Valid
()
}
// Executes the task
func
(
t
*
Tag
)
Execute
(
name
string
,
logger
*
log
.
Entry
,
env
environment
.
Environment
,
rt
*
runtime
.
Runtime
)
error
{
return
t
.
realTag
.
Execute
(
name
,
logger
,
env
,
rt
)
}
func
(
t
*
Tag
)
Deprecated
()
error
{
return
fmt
.
Errorf
(
"docker/tag has been deprecated in favor of podman/tag since 0.15.0"
)
}