mirror of
https://github.com/containers/skopeo.git
synced 2025-08-01 23:07:51 +00:00
commit
d7ae061a83
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,4 +1,3 @@
|
|||||||
!cmd/skopeo/
|
|
||||||
/skopeo
|
/skopeo
|
||||||
/skopeo.1
|
/skopeo.1
|
||||||
/layers-*
|
/layers-*
|
||||||
|
3
Makefile
3
Makefile
@ -22,12 +22,11 @@ endif
|
|||||||
DOCKER_RUN_DOCKER := $(DOCKER_FLAGS) "$(DOCKER_IMAGE)"
|
DOCKER_RUN_DOCKER := $(DOCKER_FLAGS) "$(DOCKER_IMAGE)"
|
||||||
|
|
||||||
GIT_COMMIT := $(shell git rev-parse HEAD 2> /dev/null || true)
|
GIT_COMMIT := $(shell git rev-parse HEAD 2> /dev/null || true)
|
||||||
LDFLAGS := "-X github.com/projectatomic/skopeo.GitCommit=${GIT_COMMIT} ${LDFLAGS}"
|
|
||||||
|
|
||||||
all: man binary
|
all: man binary
|
||||||
|
|
||||||
binary:
|
binary:
|
||||||
go build -ldflags ${LDFLAGS} -o ${DEST}skopeo ./cmd/skopeo
|
go build -ldflags "-X main.gitCommit=${GIT_COMMIT}" -o ${DEST}skopeo .
|
||||||
|
|
||||||
build-container:
|
build-container:
|
||||||
docker build ${DOCKER_BUILD_ARGS} -t "$(DOCKER_IMAGE)" .
|
docker build ${DOCKER_BUILD_ARGS} -t "$(DOCKER_IMAGE)" .
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
package skopeo
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"crypto/tls"
|
"crypto/tls"
|
||||||
|
@ -6,7 +6,6 @@ import (
|
|||||||
|
|
||||||
"github.com/Sirupsen/logrus"
|
"github.com/Sirupsen/logrus"
|
||||||
"github.com/codegangsta/cli"
|
"github.com/codegangsta/cli"
|
||||||
"github.com/projectatomic/skopeo"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var inspectCmd = cli.Command{
|
var inspectCmd = cli.Command{
|
||||||
@ -19,7 +18,7 @@ var inspectCmd = cli.Command{
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
Action: func(c *cli.Context) {
|
Action: func(c *cli.Context) {
|
||||||
img, err := skopeo.ParseImage(c)
|
img, err := parseImage(c)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logrus.Fatal(err)
|
logrus.Fatal(err)
|
||||||
}
|
}
|
@ -3,7 +3,6 @@ package main
|
|||||||
import (
|
import (
|
||||||
"github.com/Sirupsen/logrus"
|
"github.com/Sirupsen/logrus"
|
||||||
"github.com/codegangsta/cli"
|
"github.com/codegangsta/cli"
|
||||||
"github.com/projectatomic/skopeo"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// TODO(runcom): document args and usage
|
// TODO(runcom): document args and usage
|
||||||
@ -11,7 +10,7 @@ var layersCmd = cli.Command{
|
|||||||
Name: "layers",
|
Name: "layers",
|
||||||
Usage: "get images layers",
|
Usage: "get images layers",
|
||||||
Action: func(c *cli.Context) {
|
Action: func(c *cli.Context) {
|
||||||
img, err := skopeo.ParseImage(c)
|
img, err := parseImage(c)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logrus.Fatal(err)
|
logrus.Fatal(err)
|
||||||
}
|
}
|
@ -6,18 +6,26 @@ import (
|
|||||||
|
|
||||||
"github.com/Sirupsen/logrus"
|
"github.com/Sirupsen/logrus"
|
||||||
"github.com/codegangsta/cli"
|
"github.com/codegangsta/cli"
|
||||||
"github.com/projectatomic/skopeo"
|
"github.com/projectatomic/skopeo/version"
|
||||||
|
)
|
||||||
|
|
||||||
|
// gitCommit will be the hash that the binary was built from
|
||||||
|
// and will be populated by the Makefile
|
||||||
|
var gitCommit = ""
|
||||||
|
|
||||||
|
const (
|
||||||
|
usage = `interact with registries`
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
app := cli.NewApp()
|
app := cli.NewApp()
|
||||||
app.Name = "skopeo"
|
app.Name = "skopeo"
|
||||||
if skopeo.GitCommit != "" {
|
if gitCommit != "" {
|
||||||
app.Version = fmt.Sprintf("%s commit: %s", skopeo.Version, skopeo.GitCommit)
|
app.Version = fmt.Sprintf("%s commit: %s", version.Version, gitCommit)
|
||||||
} else {
|
} else {
|
||||||
app.Version = skopeo.Version
|
app.Version = version.Version
|
||||||
}
|
}
|
||||||
app.Usage = "interact with registries"
|
app.Usage = usage
|
||||||
// TODO(runcom)
|
// TODO(runcom)
|
||||||
//app.EnableBashCompletion = true
|
//app.EnableBashCompletion = true
|
||||||
app.Flags = []cli.Flag{
|
app.Flags = []cli.Flag{
|
@ -8,12 +8,12 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/projectatomic/skopeo"
|
"github.com/projectatomic/skopeo/version"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
signatureType = "atomic container signature"
|
signatureType = "atomic container signature"
|
||||||
signatureCreatorID = "atomic " + skopeo.Version
|
signatureCreatorID = "atomic " + version.Version
|
||||||
)
|
)
|
||||||
|
|
||||||
// InvalidSignatureError is returned when parsing an invalid signature.
|
// InvalidSignatureError is returned when parsing an invalid signature.
|
||||||
|
4
utils.go
4
utils.go
@ -1,4 +1,4 @@
|
|||||||
package skopeo
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
@ -9,7 +9,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// ParseImage converts image URL-like string to an initialized handler for that image.
|
// ParseImage converts image URL-like string to an initialized handler for that image.
|
||||||
func ParseImage(c *cli.Context) (types.Image, error) {
|
func parseImage(c *cli.Context) (types.Image, error) {
|
||||||
var (
|
var (
|
||||||
imgName = c.Args().First()
|
imgName = c.Args().First()
|
||||||
certPath = c.GlobalString("cert-path")
|
certPath = c.GlobalString("cert-path")
|
||||||
|
@ -1,7 +0,0 @@
|
|||||||
package skopeo
|
|
||||||
|
|
||||||
// Version is a version of thils build.
|
|
||||||
const Version = "0.1.12-dev"
|
|
||||||
|
|
||||||
// GitCommit is a git commit hash of this build. It is ordinarily overriden by LDFLAGS in Makefile.
|
|
||||||
var GitCommit = ""
|
|
4
version/version.go
Normal file
4
version/version.go
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
package version
|
||||||
|
|
||||||
|
// Version is the version of the build.
|
||||||
|
const Version = "0.1.12-dev"
|
Loading…
Reference in New Issue
Block a user