mirror of https://github.com/docker/docs.git
Fixing makefile
Signed-off-by: Diogo Monica <diogo@docker.com> Signed-off-by: David Lawrence <david.lawrence@docker.com> Signed-off-by: Diogo Monica <diogo@docker.com> (github: endophage)
This commit is contained in:
parent
07f0065152
commit
b59225297a
13
Makefile
13
Makefile
|
|
@ -15,6 +15,7 @@ GO_LDFLAGS=-ldflags "-w $(CTIMEVAR)"
|
|||
GO_LDFLAGS_STATIC=-ldflags "-w $(CTIMEVAR) -extldflags -static"
|
||||
GOOSES = darwin freebsd linux
|
||||
GOARCHS = amd64
|
||||
NOTARY_BUILDFLAGS="pkcs11"
|
||||
GO_EXC = go
|
||||
NOTARYDIR := /go/src/github.com/docker/notary
|
||||
|
||||
|
|
@ -49,15 +50,15 @@ version/version.go:
|
|||
|
||||
${PREFIX}/bin/notary-server: NOTARY_VERSION $(shell find . -type f -name '*.go')
|
||||
@echo "+ $@"
|
||||
@godep go build -o $@ ${GO_LDFLAGS} ./cmd/notary-server
|
||||
@godep go build -tags ${NOTARY_BUILDFLAGS} -o $@ ${GO_LDFLAGS} ./cmd/notary-server
|
||||
|
||||
${PREFIX}/bin/notary: NOTARY_VERSION $(shell find . -type f -name '*.go')
|
||||
@echo "+ $@"
|
||||
@godep go build -o $@ ${GO_LDFLAGS} ./cmd/notary
|
||||
@godep go build -tags ${NOTARY_BUILDFLAGS} -o $@ ${GO_LDFLAGS} ./cmd/notary
|
||||
|
||||
${PREFIX}/bin/notary-signer: NOTARY_VERSION $(shell find . -type f -name '*.go')
|
||||
@echo "+ $@"
|
||||
@godep go build -o $@ ${GO_LDFLAGS} ./cmd/notary-signer
|
||||
@godep go build -tags ${NOTARY_BUILDFLAGS} -o $@ ${GO_LDFLAGS} ./cmd/notary-signer
|
||||
|
||||
vet: go_version
|
||||
@echo "+ $@"
|
||||
|
|
@ -73,16 +74,16 @@ lint:
|
|||
|
||||
build: go_version
|
||||
@echo "+ $@"
|
||||
@go build -v ${GO_LDFLAGS} ./...
|
||||
@go build -tags ${NOTARY_BUILDFLAGS} -v ${GO_LDFLAGS} ./...
|
||||
|
||||
test: OPTS =
|
||||
test: go_version
|
||||
@echo "+ $@ $(OPTS)"
|
||||
go test $(OPTS) ./...
|
||||
go test -tags ${NOTARY_BUILDFLAGS} $(OPTS) ./...
|
||||
|
||||
test-full: vet lint
|
||||
@echo "+ $@"
|
||||
go test -v ./...
|
||||
go test -tags ${NOTARY_BUILDFLAGS} -v ./...
|
||||
|
||||
protos:
|
||||
@protoc --go_out=plugins=grpc:. proto/*.proto
|
||||
|
|
|
|||
|
|
@ -3,12 +3,14 @@
|
|||
package client
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/docker/notary/cryptoservice"
|
||||
"github.com/docker/notary/keystoremanager"
|
||||
"github.com/docker/notary/pkg/passphrase"
|
||||
"github.com/docker/notary/trustmanager"
|
||||
"github.com/docker/notary/tuf/store"
|
||||
)
|
||||
|
||||
|
|
@ -16,9 +18,14 @@ import (
|
|||
// It takes the base directory under where all the trust files will be stored
|
||||
// (usually ~/.docker/trust/).
|
||||
func NewNotaryRepository(baseDir, gun, baseURL string, rt http.RoundTripper,
|
||||
passphraseRetriever passphrase.Retriever) (*NotaryRepository, error) {
|
||||
retriever passphrase.Retriever) (*NotaryRepository, error) {
|
||||
keysPath := filepath.Join(baseDir, keystoremanager.PrivDir)
|
||||
fileKeyStore, err := trustmanager.NewKeyFileStore(keysPath, retriever)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to create private key store in directory: %s", keysPath)
|
||||
}
|
||||
|
||||
keyStoreManager, err := keystoremanager.NewKeyStoreManager(baseDir, passphraseRetriever)
|
||||
keyStoreManager, err := keystoremanager.NewKeyStoreManager(baseDir, fileKeyStore)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
package client
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"path/filepath"
|
||||
|
||||
|
|
@ -10,6 +11,7 @@ import (
|
|||
"github.com/docker/notary/keystoremanager"
|
||||
"github.com/docker/notary/pkg/passphrase"
|
||||
"github.com/docker/notary/signer/api"
|
||||
"github.com/docker/notary/trustmanager"
|
||||
"github.com/docker/notary/tuf/store"
|
||||
)
|
||||
|
||||
|
|
@ -17,14 +19,16 @@ import (
|
|||
// It takes the base directory under where all the trust files will be stored
|
||||
// (usually ~/.docker/trust/).
|
||||
func NewNotaryRepository(baseDir, gun, baseURL string, rt http.RoundTripper,
|
||||
passphraseRetriever passphrase.Retriever) (*NotaryRepository, error) {
|
||||
retriever passphrase.Retriever) (*NotaryRepository, error) {
|
||||
|
||||
keyStoreManager, err := keystoremanager.NewKeyStoreManager(baseDir, passphraseRetriever)
|
||||
keysPath := filepath.Join(baseDir, keystoremanager.PrivDir)
|
||||
fileKeyStore, err := trustmanager.NewKeyFileStore(keysPath, retriever)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return nil, fmt.Errorf("failed to create private key store in directory: %s", keysPath)
|
||||
}
|
||||
|
||||
yubiKeyStore := api.NewYubiKeyStore()
|
||||
keyStoreManager, err := keystoremanager.NewKeyStoreManager(baseDir, fileKeyStore)
|
||||
yubiKeyStore := api.NewYubiKeyStore(retriever)
|
||||
cryptoService := cryptoservice.NewCryptoService(gun, yubiKeyStore, keyStoreManager.KeyStore)
|
||||
|
||||
nRepo := &NotaryRepository{
|
||||
|
|
|
|||
Loading…
Reference in New Issue