diff --git a/Gopkg.lock b/Gopkg.lock new file mode 100644 index 0000000..acca637 --- /dev/null +++ b/Gopkg.lock @@ -0,0 +1,154 @@ +# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. + + +[[projects]] + branch = "master" + name = "github.com/CloudyKit/fastprinter" + packages = ["."] + revision = "74b38d55f37af5d6c05ca11147d616b613a3420e" + +[[projects]] + name = "github.com/CloudyKit/jet" + packages = ["."] + revision = "2b064536b25ab0e9c54245f9e2cc5bd4766033fe" + version = "v2.1.2" + +[[projects]] + name = "github.com/Microsoft/go-winio" + packages = ["."] + revision = "78439966b38d69bf38227fbf57ac8a6fee70f69a" + version = "v0.4.5" + +[[projects]] + name = "github.com/Sirupsen/logrus" + packages = ["."] + revision = "f006c2ac4710855cf0f916dd6b77acf6b048dc6e" + version = "v1.0.3" + +[[projects]] + branch = "master" + name = "github.com/cuigh/auxo" + packages = [".","app","app/flag","byte/size","config","data","data/guid","encoding/yaml","errors","ext/files","ext/reflects","ext/texts","ext/times","log","log/console","log/file","net/web","net/web/filter","net/web/filter/auth","net/web/renderer","net/web/renderer/jet","net/web/router","security","security/password","util/cast","util/debug","util/i18n"] + revision = "cd9aaaa6a0ad82e195a712b03555c948b993c14d" + +[[projects]] + branch = "master" + name = "github.com/docker/distribution" + packages = [".","digestset","reference"] + revision = "e5b5e44386f7964a1f010a2b8b7687d073215bbb" + +[[projects]] + branch = "master" + name = "github.com/docker/docker" + packages = ["api","api/types","api/types/blkiodev","api/types/container","api/types/events","api/types/filters","api/types/image","api/types/mount","api/types/network","api/types/registry","api/types/strslice","api/types/swarm","api/types/swarm/runtime","api/types/time","api/types/versions","api/types/volume","client","pkg/stdcopy"] + revision = "f62aeae97791b4c2318791a9b621d7da4c17ac32" + source = "https://github.com/moby/moby.git" + +[[projects]] + name = "github.com/docker/go-connections" + packages = ["nat","sockets","tlsconfig"] + revision = "3ede32e2033de7505e6500d6c868c2b9ed9f169d" + version = "v0.3.0" + +[[projects]] + name = "github.com/docker/go-units" + packages = ["."] + revision = "0dadbb0345b35ec7ef35e228dabb8de89a65bf52" + version = "v0.3.2" + +[[projects]] + name = "github.com/go-ldap/ldap" + packages = ["."] + revision = "8168ee085ee43257585e50c6441aadf54ecb2c9f" + version = "v2.5.0" + +[[projects]] + name = "github.com/gogo/protobuf" + packages = ["proto"] + revision = "342cbe0a04158f6dcb03ca0079991a51a4248c02" + version = "v0.5" + +[[projects]] + name = "github.com/gorilla/context" + packages = ["."] + revision = "1ea25387ff6f684839d82767c1733ff4d4d15d0a" + version = "v1.1" + +[[projects]] + name = "github.com/gorilla/mux" + packages = ["."] + revision = "7f08801859139f86dfafd1c296e2cba9a80d292e" + version = "v1.6.0" + +[[projects]] + name = "github.com/mattn/go-shellwords" + packages = ["."] + revision = "02e3cf038dcea8290e44424da473dd12be796a8a" + version = "v1.0.3" + +[[projects]] + branch = "master" + name = "github.com/mitchellh/mapstructure" + packages = ["."] + revision = "06020f85339e21b2478f756a78e295255ffa4d6a" + +[[projects]] + name = "github.com/opencontainers/go-digest" + packages = ["."] + revision = "279bed98673dd5bef374d3b6e4b09e2af76183bf" + version = "v1.0.0-rc1" + +[[projects]] + name = "github.com/opencontainers/image-spec" + packages = ["specs-go","specs-go/v1"] + revision = "d60099175f88c47cd379c4738d158884749ed235" + version = "v1.0.1" + +[[projects]] + name = "github.com/pkg/errors" + packages = ["."] + revision = "645ef00459ed84a119197bfb8d8205042c6df63d" + version = "v0.8.0" + +[[projects]] + branch = "master" + name = "golang.org/x/crypto" + packages = ["acme","acme/autocert","ssh/terminal"] + revision = "9f005a07e0d31d45e6656d241bb5c0f2efd4bc94" + +[[projects]] + branch = "master" + name = "golang.org/x/net" + packages = ["context","context/ctxhttp","proxy"] + revision = "a337091b0525af65de94df2eb7e98bd9962dcbe2" + +[[projects]] + branch = "master" + name = "golang.org/x/sys" + packages = ["unix","windows"] + revision = "bf42f188b9bc6f2cf5b8ee5a912ef1aedd0eba4c" + +[[projects]] + name = "gopkg.in/asn1-ber.v1" + packages = ["."] + revision = "379148ca0225df7a432012b8df0355c2a2063ac0" + version = "v1.2" + +[[projects]] + branch = "v2" + name = "gopkg.in/mgo.v2" + packages = [".","bson","internal/json","internal/sasl","internal/scram"] + revision = "3f83fa5005286a7fe593b055f0d7771a7dce4655" + +[[projects]] + branch = "v2" + name = "gopkg.in/yaml.v2" + packages = ["."] + revision = "eb3733d160e74a9c7e442f435eb3bea458e1d19f" + +[solve-meta] + analyzer-name = "dep" + analyzer-version = 1 + inputs-digest = "9b88c72e1df239e3431f07193b5f1ac5f6889418ac95af966cd58b2947a44596" + solver-name = "gps-cdcl" + solver-version = 1 diff --git a/Gopkg.toml b/Gopkg.toml index a86a739..b6937ba 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -1,12 +1,46 @@ -[[constraint]] - name = "github.com/docker/docker" - source = "github.com/moby/moby" - branch = "master" +required = ["github.com/docker/distribution"] [[constraint]] - name = "github.com/cuigh/auxo" branch = "master" + name = "github.com/cuigh/auxo" + +[[constraint]] + name = "github.com/docker/docker" + branch = "master" + source = "https://github.com/moby/moby.git" + +[[constraint]] + name = "github.com/docker/go-connections" + version = "0.3.0" + +[[constraint]] + name = "github.com/docker/go-units" + version = "0.3.2" [[constraint]] name = "github.com/go-ldap/ldap" + version = "2.5.0" + +[[constraint]] + name = "github.com/mattn/go-shellwords" + version = "1.0.3" + +[[constraint]] branch = "master" + name = "github.com/mitchellh/mapstructure" + +[[constraint]] + name = "github.com/pkg/errors" + version = "0.8.0" + +[[constraint]] + branch = "v2" + name = "gopkg.in/mgo.v2" + +[[constraint]] + branch = "v2" + name = "gopkg.in/yaml.v2" + +[[constraint]] + name = "github.com/docker/distribution" + branch = "master" \ No newline at end of file diff --git a/README.md b/README.md index ae752a6..27d745c 100644 --- a/README.md +++ b/README.md @@ -115,7 +115,12 @@ docker service create \ ## Build -**Swirl** use `dep` as dependency management tool(coming soon). +**Swirl** use `dep` as dependency management tool. You can build **Swirl** + +```sh +$ dep ensure +$ go build +``` ## License diff --git a/biz/docker/service.go b/biz/docker/service.go index 52149a4..b0a10d8 100644 --- a/biz/docker/service.go +++ b/biz/docker/service.go @@ -557,9 +557,9 @@ func ServiceLogs(name string, line int, timestamps bool) (stdout, stderr *bytes. return } -// todo: support auto wrapping // ServiceCommand returns the docker command line to create this service. -func ServiceCommand(name string) (cmd string, err error) { +func ServiceCommand(name string) (cmd string, err error) { // nolint: gocyclo + // todo: support auto wrapping var ( ctx context.Context cli *client.Client diff --git a/biz/docker/stack.go b/biz/docker/stack.go index 678898c..087770d 100644 --- a/biz/docker/stack.go +++ b/biz/docker/stack.go @@ -279,7 +279,7 @@ func createSecrets(ctx context.Context, cli *client.Client, secrets []swarm.Secr if err = cli.SecretUpdate(ctx, secret.ID, secret.Meta.Version, secretSpec); err != nil { return errors.Wrap(err, "failed to update secret "+secretSpec.Name) } - case client.IsErrSecretNotFound(err): + case client.IsErrNotFound(err): // secret does not exist, then we create a new one. if _, err = cli.SecretCreate(ctx, secretSpec); err != nil { return errors.Wrap(err, "failed to create secret "+secretSpec.Name) @@ -300,7 +300,7 @@ func createConfigs(ctx context.Context, cli *client.Client, configs []swarm.Conf if err = cli.ConfigUpdate(ctx, config.ID, config.Meta.Version, configSpec); err != nil { errors.Wrap(err, "failed to update config "+configSpec.Name) } - case client.IsErrConfigNotFound(err): + case client.IsErrNotFound(err): // config does not exist, then we create a new one. if _, err = cli.ConfigCreate(ctx, configSpec); err != nil { errors.Wrap(err, "failed to create config "+configSpec.Name)