Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): Make Apostille Go-Gettable Again #8

Merged
merged 1 commit into from
Jan 30, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
161 changes: 0 additions & 161 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,161 +0,0 @@
[submodule "vendor/github.com/Sirupsen/logrus"]
path = vendor/github.com/Sirupsen/logrus
url = https://github.com/Sirupsen/logrus
[submodule "vendor/github.com/docker/distribution"]
path = vendor/github.com/docker/distribution
url = https://github.com/docker/distribution
[submodule "vendor/github.com/docker/libtrust"]
path = vendor/github.com/docker/libtrust
url = https://github.com/docker/libtrust
[submodule "vendor/github.com/docker/go-connections"]
path = vendor/github.com/docker/go-connections
url = https://github.com/docker/go-connections
[submodule "vendor/github.com/docker/notary"]
path = vendor/github.com/docker/notary
url = https://github.com/ecordell/notary
branch = lib-fixes
[submodule "vendor/github.com/go-sql-driver/mysql"]
path = vendor/github.com/go-sql-driver/mysql
url = https://github.com/go-sql-driver/mysql
[submodule "vendor/github.com/spf13/viper"]
path = vendor/github.com/spf13/viper
url = https://github.com/spf13/viper
[submodule "vendor/github.com/fsnotify/fsnotify"]
path = vendor/github.com/fsnotify/fsnotify
url = https://github.com/fsnotify/fsnotify
[submodule "vendor/golang.org/x/sys"]
path = vendor/golang.org/x/sys
url = https://go.googlesource.com/sys
[submodule "vendor/github.com/hashicorp/hcl"]
path = vendor/github.com/hashicorp/hcl
url = https://github.com/hashicorp/hcl
[submodule "vendor/github.com/magiconair/properties"]
path = vendor/github.com/magiconair/properties
url = https://github.com/magiconair/properties
[submodule "vendor/github.com/mitchellh/mapstructure"]
path = vendor/github.com/mitchellh/mapstructure
url = https://github.com/mitchellh/mapstructure
[submodule "vendor/github.com/pelletier/go-toml"]
path = vendor/github.com/pelletier/go-toml
url = https://github.com/pelletier/go-toml
[submodule "vendor/github.com/pelletier/go-buffruneio"]
path = vendor/github.com/pelletier/go-buffruneio
url = https://github.com/pelletier/go-buffruneio
[submodule "vendor/github.com/spf13/afero"]
path = vendor/github.com/spf13/afero
url = https://github.com/spf13/afero
[submodule "vendor/golang.org/x/text"]
path = vendor/golang.org/x/text
url = https://go.googlesource.com/text
[submodule "vendor/github.com/spf13/cast"]
path = vendor/github.com/spf13/cast
url = https://github.com/spf13/cast
[submodule "vendor/github.com/spf13/jwalterweatherman"]
path = vendor/github.com/spf13/jwalterweatherman
url = https://github.com/spf13/jwalterweatherman
[submodule "vendor/github.com/spf13/pflag"]
path = vendor/github.com/spf13/pflag
url = https://github.com/spf13/pflag
[submodule "vendor/gopkg.in/yaml.v2"]
path = vendor/gopkg.in/yaml.v2
url = https://gopkg.in/yaml.v2
[submodule "vendor/golang.org/x/net"]
path = vendor/golang.org/x/net
url = https://go.googlesource.com/net
[submodule "vendor/github.com/mattn/go-sqlite3"]
path = vendor/github.com/mattn/go-sqlite3
url = https://github.com/mattn/go-sqlite3
[submodule "vendor/github.com/stretchr/testify"]
path = vendor/github.com/stretchr/testify
url = https://github.com/stretchr/testify
[submodule "vendor/github.com/gorilla/mux"]
path = vendor/github.com/gorilla/mux
url = https://github.com/gorilla/mux
[submodule "vendor/github.com/jinzhu/gorm"]
path = vendor/github.com/jinzhu/gorm
url = https://github.com/jinzhu/gorm
[submodule "vendor/github.com/jinzhu/inflection"]
path = vendor/github.com/jinzhu/inflection
url = https://github.com/jinzhu/inflection
[submodule "vendor/golang.org/x/crypto"]
path = vendor/golang.org/x/crypto
url = https://go.googlesource.com/crypto
[submodule "vendor/github.com/agl/ed25519"]
path = vendor/github.com/agl/ed25519
url = https://github.com/agl/ed25519
[submodule "vendor/gopkg.in/dancannon/gorethink.v3"]
path = vendor/gopkg.in/dancannon/gorethink.v3
url = https://gopkg.in/dancannon/gorethink.v3
[submodule "vendor/github.com/cenk/backoff"]
path = vendor/github.com/cenk/backoff
url = https://github.com/cenk/backoff
[submodule "vendor/github.com/hailocab/go-hostpool"]
path = vendor/github.com/hailocab/go-hostpool
url = https://github.com/hailocab/go-hostpool
[submodule "vendor/gopkg.in/fatih/pool.v2"]
path = vendor/gopkg.in/fatih/pool.v2
url = https://gopkg.in/fatih/pool.v2
[submodule "vendor/gopkg.in/gorethink/gorethink.v2"]
path = vendor/gopkg.in/gorethink/gorethink.v2
url = https://gopkg.in/gorethink/gorethink.v2
[submodule "vendor/github.com/golang/protobuf"]
path = vendor/github.com/golang/protobuf
url = https://github.com/golang/protobuf
[submodule "vendor/google.golang.org/grpc"]
path = vendor/google.golang.org/grpc
url = https://github.com/ecordell/grpc-go
branch = v1.0.1-GA
[submodule "vendor/github.com/Shopify/logrus-bugsnag"]
path = vendor/github.com/Shopify/logrus-bugsnag
url = https://github.com/Shopify/logrus-bugsnag
[submodule "vendor/github.com/bugsnag/bugsnag-go"]
path = vendor/github.com/bugsnag/bugsnag-go
url = https://github.com/bugsnag/bugsnag-go
[submodule "vendor/github.com/bugsnag/panicwrap"]
path = vendor/github.com/bugsnag/panicwrap
url = https://github.com/bugsnag/panicwrap
[submodule "vendor/github.com/kardianos/osext"]
path = vendor/github.com/kardianos/osext
url = https://github.com/kardianos/osext
[submodule "vendor/github.com/prometheus/client_golang"]
path = vendor/github.com/prometheus/client_golang
url = https://github.com/prometheus/client_golang
[submodule "vendor/github.com/beorn7/perks"]
path = vendor/github.com/beorn7/perks
url = https://github.com/beorn7/perks
[submodule "vendor/github.com/prometheus/client_model"]
path = vendor/github.com/prometheus/client_model
url = https://github.com/prometheus/client_model
[submodule "vendor/github.com/prometheus/common"]
path = vendor/github.com/prometheus/common
url = https://github.com/prometheus/common
[submodule "vendor/github.com/matttproud/golang_protobuf_extensions"]
path = vendor/github.com/matttproud/golang_protobuf_extensions
url = https://github.com/matttproud/golang_protobuf_extensions
[submodule "vendor/github.com/prometheus/procfs"]
path = vendor/github.com/prometheus/procfs
url = https://github.com/prometheus/procfs
[submodule "vendor/github.com/lib/pq"]
path = vendor/github.com/lib/pq
url = https://github.com/lib/pq
[submodule "vendor/github.com/docker/go"]
path = vendor/github.com/docker/go
url = https://github.com/docker/go
[submodule "vendor/github.com/surullabs/lint"]
path = vendor/github.com/surullabs/lint
url = https://github.com/surullabs/lint
[submodule "vendor/honnef.co/go/simple"]
path = vendor/honnef.co/go/simple
url = https://github.com/dominikh/go-simple
[submodule "vendor/honnef.co/go/lint"]
path = vendor/honnef.co/go/lint
url = https://github.com/dominikh/go-lint
[submodule "vendor/golang.org/x/tools"]
path = vendor/golang.org/x/tools
url = https://go.googlesource.com/tools
[submodule "vendor/honnef.co/go/ssa"]
path = vendor/honnef.co/go/ssa
url = https://github.com/dominikh/go-ssa
[submodule "vendor/honnef.co/go/staticcheck"]
path = vendor/honnef.co/go/staticcheck
url = https://github.com/dominikh/go-staticcheck
36 changes: 13 additions & 23 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,49 +19,39 @@ APOSTILLE_BUILDTAGS ?= pkcs11
APOSTILLEDIR := /go/src/github.com/docker/apostille

GO_VERSION := $(shell go version | grep "1\.[7-9]\(\.[0-9]+\)*\|devel")

# check to make sure we have the right version. development versions of Go are
# not officially supported, but allowed for building

ifeq ($(strip $(GO_VERSION))$(SKIPENVCHECK),)
$(error Bad Go version - please install Go >= 1.7)
endif

GLIDE := $(shell command -v glide -v 2> /dev/null)

ifndef GLIDE
$(shell curl https://glide.sh/get | sh)
endif

_empty :=
_space := $(empty) $(empty)

PKGS ?= $(shell go list -tags "${APOSTILLE_BUILDTAGS}" ./... | grep -v /vendor/ | tr '\n' ' ')

.PHONY: clean all build init test integration integration-postgres
.PHONY: clean all build test integration integration-postgres

all: init clean build test
all: clean build test

${PREFIX}/bin/apostille: APOSTILLE_VERSION $(shell find . -type f -name '*.go')
@echo "+ $@"
@go build -tags ${APOSTILLE_BUILDTAGS} -o $@ ${GO_LDFLAGS} ./cmd/apostille


update-deps:
@glide up -v


init:
@echo "+ $@"
@git submodule update --init --recursive --remote
@rm -rf vendor/github.com/docker/distribution/vendor
@rm -rf vendor/github.com/docker/notary/vendor

deps:
@vendetta
@git config --file=.gitmodules submodule.vendor/github.com/docker/notary.url https://github.com/ecordell/notary
@git config --file=.gitmodules submodule.vendor/github.com/docker/notary.branch lib-fixes
@git config --file=.gitmodules submodule.vendor/google.golang.org/grpc.url https://github.com/ecordell/grpc-go
@git config --file=.gitmodules submodule.vendor/google.golang.org/grpc.branch v1.0.1-GA
@git submodule sync
@git submodule update --init --recursive --remote
@rm -rf vendor/github.com/docker/distribution/vendor
@rm -rf vendor/github.com/docker/notary/vendor

build: init
build:
@echo "+ $@"
@go build -tags "${APOSTILLE_BUILDTAGS}" -v ${GO_LDFLAGS} $(PKGS)
@go install -tags "${APOSTILLE_BUILDTAGS}" -v ${GO_LDFLAGS} $(PKGS)

clean:
@echo "+ $@"
Expand Down
Empty file modified aposql/mysql-initdb.d/initial-apostille.sql
100644 → 100755
Empty file.
Empty file modified aposql/mysql-initdb.d/initial-notarysigner.sql
100644 → 100755
Empty file.
9 changes: 4 additions & 5 deletions cmd/apostille/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ func getNotarySigner(hostname, port string, tlsConfig *tls.Config) (*client.Nota
}
}
}
return nil, fmt.Errorf("unable to contact signer: %s:%s", hostname, port)
}

// getTrustService parses the configuration and determines which trust service and
Expand Down Expand Up @@ -271,7 +270,7 @@ func loadQuayRoot(cs signed.CryptoService) (*tuf.Repo, error) {
}
x509PublicKey := tufUtils.CertToKey(cert)
if x509PublicKey == nil {
return nil, fmt.Errorf("cannot use regenerated certificate: format %s", cert.PublicKeyAlgorithm)
return nil, fmt.Errorf("cannot use regenerated certificate: format %v", cert.PublicKeyAlgorithm)
}

// Generate root role
Expand Down Expand Up @@ -317,13 +316,13 @@ func loadQuayRoot(cs signed.CryptoService) (*tuf.Repo, error) {
return nil, err
}

if _, err := repo.InitTargets(data.CanonicalTargetsRole); err != nil {
if _, err = repo.InitTargets(data.CanonicalTargetsRole); err != nil {
return nil, err
}
if err := repo.InitSnapshot(); err != nil {
if err = repo.InitSnapshot(); err != nil {
return nil, err
}
if err := repo.InitTimestamp(); err != nil {
if err = repo.InitTimestamp(); err != nil {
return nil, err
}

Expand Down
22 changes: 18 additions & 4 deletions cmd/apostille/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,31 @@ import (
"github.com/spf13/viper"
"github.com/stretchr/testify/require"
"github.com/surullabs/lint"
"github.com/surullabs/lint/gofmt"
"github.com/surullabs/lint/govet"
"github.com/surullabs/lint/golint"
"github.com/surullabs/lint/dupl"
"github.com/surullabs/lint/gosimple"
"github.com/surullabs/lint/gostaticcheck"
)

const (
Cert = "../../fixtures/notary-server.crt"
Key = "../../fixtures/notary-server.key"
Root = "../../fixtures/root-ca.crt"
Cert = "../../vendor/github.com/docker/notary/fixtures/notary-server.crt"
Key = "../../vendor/github.com/docker/notary/fixtures/notary-server.key"
Root = "../../vendor/github.com/docker/notary/fixtures/root-ca.crt"
)


func TestLint(t *testing.T) {
if err := lint.Default.Check("./..."); err != nil {
custom := lint.Group{
gofmt.Check{}, // Enforce gofmt usage
govet.Check{}, // Use govet without -shadow
golint.Check{}, // Enforce Google Go style guide
dupl.Check{Threshold: 25}, // Identify duplicates
gosimple.Check{}, // Simplification suggestions
gostaticcheck.Check{}, // Verify function parameters
}
if err := custom.Check("../..."); err != nil {
t.Fatal("lint failures: %v", err)
}
}
Expand Down
6 changes: 3 additions & 3 deletions fixtures/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
"type": "remote",
"hostname": "notarysigner",
"port": "7899",
"tls_ca_file": "./test_certs/root-ca.crt",
"tls_ca_file": "./vendor/github.com/docker/notary/fixtures/root-ca.crt",
"key_algorithm": "ecdsa",
"tls_client_cert": "./test_certs/notary-server.crt",
"tls_client_key": "./test_certs/notary-server.key"
"tls_client_cert": "./vendor/github.com/docker/notary/fixtures/notary-server.crt",
"tls_client_key": "./vendor/github.com/docker/notary/fixtures/notary-server.key"
},
"logging": {
"level": "debug"
Expand Down
6 changes: 3 additions & 3 deletions fixtures/config.mysql.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
"type": "remote",
"hostname": "notarysigner",
"port": "7899",
"tls_ca_file": "./test_certs/root-ca.crt",
"tls_ca_file": "../vendor/github.com/docker/notary/fixtures/root-ca.crt",
"key_algorithm": "ecdsa",
"tls_client_cert": "./test_certs/notary-server.crt",
"tls_client_key": "./test_certs/notary-server.key"
"tls_client_cert": "../vendor/github.com/docker/notary/fixtures/notary-server.crt",
"tls_client_key": "../vendor/github.com/docker/notary/fixtures/notary-server.key"
},
"logging": {
"level": "debug"
Expand Down
6 changes: 3 additions & 3 deletions fixtures/config.postgres.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
"type": "remote",
"hostname": "notarysigner",
"port": "7899",
"tls_ca_file": "./test_certs/root-ca.crt",
"tls_ca_file": "../vendor/github.com/docker/notary/fixtures/root-ca.crt",
"key_algorithm": "ecdsa",
"tls_client_cert": "./test_certs/notary-server.crt",
"tls_client_key": "./test_certs/notary-server.key"
"tls_client_cert": "../vendor/github.com/docker/notary/fixtures/notary-server.crt",
"tls_client_key": "../vendor/github.com/docker/notary/fixtures/notary-server.key"
},
"logging": {
"level": "debug"
Expand Down
Loading