diff --git a/.freezer/jackfan.us.kg-golang-protobuf-proto-e325f446bebc2998605911c0a2650d9920361d4a.zip b/.freezer/jackfan.us.kg-golang-protobuf-proto-e325f446bebc2998605911c0a2650d9920361d4a.zip deleted file mode 100644 index c7d08ac..0000000 Binary files a/.freezer/jackfan.us.kg-golang-protobuf-proto-e325f446bebc2998605911c0a2650d9920361d4a.zip and /dev/null differ diff --git a/.freezer/jackfan.us.kg-pelletier-go-buffruneio-c37440a7cf42ac63b919c752ca73a85067e05992.zip b/.freezer/jackfan.us.kg-pelletier-go-buffruneio-c37440a7cf42ac63b919c752ca73a85067e05992.zip deleted file mode 100644 index 6bf167b..0000000 Binary files a/.freezer/jackfan.us.kg-pelletier-go-buffruneio-c37440a7cf42ac63b919c752ca73a85067e05992.zip and /dev/null differ diff --git a/.freezer/jackfan.us.kg-pelletier-go-toml-fe7536c3dee2596cdd23ee9976a17c22bdaae286.zip b/.freezer/jackfan.us.kg-pelletier-go-toml-fe7536c3dee2596cdd23ee9976a17c22bdaae286.zip deleted file mode 100644 index 676cbe7..0000000 Binary files a/.freezer/jackfan.us.kg-pelletier-go-toml-fe7536c3dee2596cdd23ee9976a17c22bdaae286.zip and /dev/null differ diff --git a/.freezer/golang-org-x-oauth2-internal-f047394b6d14284165300fd82dad67edb3a4d7f6.zip b/.freezer/golang-org-x-oauth2-internal-f047394b6d14284165300fd82dad67edb3a4d7f6.zip deleted file mode 100644 index 5b4ba99..0000000 Binary files a/.freezer/golang-org-x-oauth2-internal-f047394b6d14284165300fd82dad67edb3a4d7f6.zip and /dev/null differ diff --git a/.freezer/google-golang-org-appengine-a2f4131514e563cedfdb6e7d267df9ad48591e93.zip b/.freezer/google-golang-org-appengine-a2f4131514e563cedfdb6e7d267df9ad48591e93.zip deleted file mode 100644 index 2dade2e..0000000 Binary files a/.freezer/google-golang-org-appengine-a2f4131514e563cedfdb6e7d267df9ad48591e93.zip and /dev/null differ diff --git a/.freezer/google-golang-org-appengine-internal-a2f4131514e563cedfdb6e7d267df9ad48591e93.zip b/.freezer/google-golang-org-appengine-internal-a2f4131514e563cedfdb6e7d267df9ad48591e93.zip deleted file mode 100644 index 0e10344..0000000 Binary files a/.freezer/google-golang-org-appengine-internal-a2f4131514e563cedfdb6e7d267df9ad48591e93.zip and /dev/null differ diff --git a/.freezer/google-golang-org-appengine-internal-app_identity-a2f4131514e563cedfdb6e7d267df9ad48591e93.zip b/.freezer/google-golang-org-appengine-internal-app_identity-a2f4131514e563cedfdb6e7d267df9ad48591e93.zip deleted file mode 100644 index 796ad2f..0000000 Binary files a/.freezer/google-golang-org-appengine-internal-app_identity-a2f4131514e563cedfdb6e7d267df9ad48591e93.zip and /dev/null differ diff --git a/.freezer/google-golang-org-appengine-internal-base-a2f4131514e563cedfdb6e7d267df9ad48591e93.zip b/.freezer/google-golang-org-appengine-internal-base-a2f4131514e563cedfdb6e7d267df9ad48591e93.zip deleted file mode 100644 index cb3c5f9..0000000 Binary files a/.freezer/google-golang-org-appengine-internal-base-a2f4131514e563cedfdb6e7d267df9ad48591e93.zip and /dev/null differ diff --git a/.freezer/google-golang-org-appengine-internal-datastore-a2f4131514e563cedfdb6e7d267df9ad48591e93.zip b/.freezer/google-golang-org-appengine-internal-datastore-a2f4131514e563cedfdb6e7d267df9ad48591e93.zip deleted file mode 100644 index 21e008f..0000000 Binary files a/.freezer/google-golang-org-appengine-internal-datastore-a2f4131514e563cedfdb6e7d267df9ad48591e93.zip and /dev/null differ diff --git a/.freezer/google-golang-org-appengine-internal-log-a2f4131514e563cedfdb6e7d267df9ad48591e93.zip b/.freezer/google-golang-org-appengine-internal-log-a2f4131514e563cedfdb6e7d267df9ad48591e93.zip deleted file mode 100644 index 238e031..0000000 Binary files a/.freezer/google-golang-org-appengine-internal-log-a2f4131514e563cedfdb6e7d267df9ad48591e93.zip and /dev/null differ diff --git a/.freezer/google-golang-org-appengine-internal-modules-a2f4131514e563cedfdb6e7d267df9ad48591e93.zip b/.freezer/google-golang-org-appengine-internal-modules-a2f4131514e563cedfdb6e7d267df9ad48591e93.zip deleted file mode 100644 index 27cbcd0..0000000 Binary files a/.freezer/google-golang-org-appengine-internal-modules-a2f4131514e563cedfdb6e7d267df9ad48591e93.zip and /dev/null differ diff --git a/.freezer/google-golang-org-appengine-internal-remote_api-a2f4131514e563cedfdb6e7d267df9ad48591e93.zip b/.freezer/google-golang-org-appengine-internal-remote_api-a2f4131514e563cedfdb6e7d267df9ad48591e93.zip deleted file mode 100644 index 6ae4d3a..0000000 Binary files a/.freezer/google-golang-org-appengine-internal-remote_api-a2f4131514e563cedfdb6e7d267df9ad48591e93.zip and /dev/null differ diff --git a/.freezer/google-golang-org-appengine-internal-urlfetch-a2f4131514e563cedfdb6e7d267df9ad48591e93.zip b/.freezer/google-golang-org-appengine-internal-urlfetch-a2f4131514e563cedfdb6e7d267df9ad48591e93.zip deleted file mode 100644 index 67ed96e..0000000 Binary files a/.freezer/google-golang-org-appengine-internal-urlfetch-a2f4131514e563cedfdb6e7d267df9ad48591e93.zip and /dev/null differ diff --git a/.freezer/google-golang-org-appengine-urlfetch-a2f4131514e563cedfdb6e7d267df9ad48591e93.zip b/.freezer/google-golang-org-appengine-urlfetch-a2f4131514e563cedfdb6e7d267df9ad48591e93.zip deleted file mode 100644 index 30b8f29..0000000 Binary files a/.freezer/google-golang-org-appengine-urlfetch-a2f4131514e563cedfdb6e7d267df9ad48591e93.zip and /dev/null differ diff --git a/.gitignore b/.gitignore index 2d9a497..690c131 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,8 @@ vendor graven +graven.exe target .DS_Store temp -.vscode \ No newline at end of file +.vscode +.idea \ No newline at end of file diff --git a/.freezer/jackfan.us.kg-bgentry-speakeasy-4aabc24848ce5fd31929f7d1e4ea74d3709c14cd.zip b/.modules/github.com/bgentry/speakeasy/@v/v0.1.0.zip similarity index 93% rename from .freezer/jackfan.us.kg-bgentry-speakeasy-4aabc24848ce5fd31929f7d1e4ea74d3709c14cd.zip rename to .modules/github.com/bgentry/speakeasy/@v/v0.1.0.zip index f47b918..3fae929 100644 Binary files a/.freezer/jackfan.us.kg-bgentry-speakeasy-4aabc24848ce5fd31929f7d1e4ea74d3709c14cd.zip and b/.modules/github.com/bgentry/speakeasy/@v/v0.1.0.zip differ diff --git a/.freezer/jackfan.us.kg-blang-semver-2ee87856327ba09384cabd113bc6b5d174e9ec0f.zip b/.modules/github.com/blang/semver/@v/v3.5.1+incompatible.zip similarity index 92% rename from .freezer/jackfan.us.kg-blang-semver-2ee87856327ba09384cabd113bc6b5d174e9ec0f.zip rename to .modules/github.com/blang/semver/@v/v3.5.1+incompatible.zip index c8539b4..53fee05 100644 Binary files a/.freezer/jackfan.us.kg-blang-semver-2ee87856327ba09384cabd113bc6b5d174e9ec0f.zip and b/.modules/github.com/blang/semver/@v/v3.5.1+incompatible.zip differ diff --git a/.modules/github.com/cpuguy83/go-md2man/v2/@v/v2.0.0-20190314233015-f79a8a8ca69d.zip b/.modules/github.com/cpuguy83/go-md2man/v2/@v/v2.0.0-20190314233015-f79a8a8ca69d.zip new file mode 100644 index 0000000..c48c6c4 Binary files /dev/null and b/.modules/github.com/cpuguy83/go-md2man/v2/@v/v2.0.0-20190314233015-f79a8a8ca69d.zip differ diff --git a/.freezer/jackfan.us.kg-davecgh-go-spew-spew-346938d642f2ec3594ed81d874461961cd0faa76.zip b/.modules/github.com/davecgh/go-spew/@v/v1.1.1.zip similarity index 92% rename from .freezer/jackfan.us.kg-davecgh-go-spew-spew-346938d642f2ec3594ed81d874461961cd0faa76.zip rename to .modules/github.com/davecgh/go-spew/@v/v1.1.1.zip index 8073332..5fb65fb 100644 Binary files a/.freezer/jackfan.us.kg-davecgh-go-spew-spew-346938d642f2ec3594ed81d874461961cd0faa76.zip and b/.modules/github.com/davecgh/go-spew/@v/v1.1.1.zip differ diff --git a/.modules/github.com/fatih/color/@v/v1.7.0.zip b/.modules/github.com/fatih/color/@v/v1.7.0.zip new file mode 100644 index 0000000..c5fa834 Binary files /dev/null and b/.modules/github.com/fatih/color/@v/v1.7.0.zip differ diff --git a/.modules/github.com/golang/protobuf/@v/v1.2.0.zip b/.modules/github.com/golang/protobuf/@v/v1.2.0.zip new file mode 100644 index 0000000..2d516fa Binary files /dev/null and b/.modules/github.com/golang/protobuf/@v/v1.2.0.zip differ diff --git a/.freezer/jackfan.us.kg-google-go-github-github-7a51fb928f52a196d5f31daefb8a489453ef54ff.zip b/.modules/github.com/google/go-github/@v/v17.0.0+incompatible.zip similarity index 70% rename from .freezer/jackfan.us.kg-google-go-github-github-7a51fb928f52a196d5f31daefb8a489453ef54ff.zip rename to .modules/github.com/google/go-github/@v/v17.0.0+incompatible.zip index d5c9d77..0620200 100644 Binary files a/.freezer/jackfan.us.kg-google-go-github-github-7a51fb928f52a196d5f31daefb8a489453ef54ff.zip and b/.modules/github.com/google/go-github/@v/v17.0.0+incompatible.zip differ diff --git a/.freezer/jackfan.us.kg-google-go-querystring-query-53e6ce116135b80d037921a7fdd5138cf32d7a8a.zip b/.modules/github.com/google/go-querystring/@v/v1.0.0.zip similarity index 81% rename from .freezer/jackfan.us.kg-google-go-querystring-query-53e6ce116135b80d037921a7fdd5138cf32d7a8a.zip rename to .modules/github.com/google/go-querystring/@v/v1.0.0.zip index 7e3fedb..39cceed 100644 Binary files a/.freezer/jackfan.us.kg-google-go-querystring-query-53e6ce116135b80d037921a7fdd5138cf32d7a8a.zip and b/.modules/github.com/google/go-querystring/@v/v1.0.0.zip differ diff --git a/.freezer/jackfan.us.kg-hashicorp-errwrap-7554cd9344cec97297fa6649b055a8c98c2a1e55.zip b/.modules/github.com/hashicorp/errwrap/@v/v1.0.0.zip similarity index 96% rename from .freezer/jackfan.us.kg-hashicorp-errwrap-7554cd9344cec97297fa6649b055a8c98c2a1e55.zip rename to .modules/github.com/hashicorp/errwrap/@v/v1.0.0.zip index 8d4fdb7..699211f 100644 Binary files a/.freezer/jackfan.us.kg-hashicorp-errwrap-7554cd9344cec97297fa6649b055a8c98c2a1e55.zip and b/.modules/github.com/hashicorp/errwrap/@v/v1.0.0.zip differ diff --git a/.freezer/jackfan.us.kg-hashicorp-go-multierror-ed905158d87462226a13fe39ddf685ea65f1c11f.zip b/.modules/github.com/hashicorp/go-multierror/@v/v1.0.0.zip similarity index 88% rename from .freezer/jackfan.us.kg-hashicorp-go-multierror-ed905158d87462226a13fe39ddf685ea65f1c11f.zip rename to .modules/github.com/hashicorp/go-multierror/@v/v1.0.0.zip index 066978b..4fb8981 100644 Binary files a/.freezer/jackfan.us.kg-hashicorp-go-multierror-ed905158d87462226a13fe39ddf685ea65f1c11f.zip and b/.modules/github.com/hashicorp/go-multierror/@v/v1.0.0.zip differ diff --git a/.modules/github.com/mattn/go-colorable/@v/v0.1.4.zip b/.modules/github.com/mattn/go-colorable/@v/v0.1.4.zip new file mode 100644 index 0000000..64403f8 Binary files /dev/null and b/.modules/github.com/mattn/go-colorable/@v/v0.1.4.zip differ diff --git a/.modules/github.com/mattn/go-isatty/@v/v0.0.10.zip b/.modules/github.com/mattn/go-isatty/@v/v0.0.10.zip new file mode 100644 index 0000000..931ca44 Binary files /dev/null and b/.modules/github.com/mattn/go-isatty/@v/v0.0.10.zip differ diff --git a/.modules/github.com/pelletier/go-toml/@v/v1.6.0.zip b/.modules/github.com/pelletier/go-toml/@v/v1.6.0.zip new file mode 100644 index 0000000..1ca2d41 Binary files /dev/null and b/.modules/github.com/pelletier/go-toml/@v/v1.6.0.zip differ diff --git a/.freezer/jackfan.us.kg-pmezard-go-difflib-difflib-792786c7400a136282c1664665ae0a8db921c6c2.zip b/.modules/github.com/pmezard/go-difflib/@v/v1.0.0.zip similarity index 92% rename from .freezer/jackfan.us.kg-pmezard-go-difflib-difflib-792786c7400a136282c1664665ae0a8db921c6c2.zip rename to .modules/github.com/pmezard/go-difflib/@v/v1.0.0.zip index 939f59f..7eb6291 100644 Binary files a/.freezer/jackfan.us.kg-pmezard-go-difflib-difflib-792786c7400a136282c1664665ae0a8db921c6c2.zip and b/.modules/github.com/pmezard/go-difflib/@v/v1.0.0.zip differ diff --git a/.modules/github.com/russross/blackfriday/v2/@v/v2.0.1.zip b/.modules/github.com/russross/blackfriday/v2/@v/v2.0.1.zip new file mode 100644 index 0000000..a41aa97 Binary files /dev/null and b/.modules/github.com/russross/blackfriday/v2/@v/v2.0.1.zip differ diff --git a/.modules/github.com/shurcoo!l/sanitized_anchor_name/@v/v1.0.0.zip b/.modules/github.com/shurcoo!l/sanitized_anchor_name/@v/v1.0.0.zip new file mode 100644 index 0000000..34ab744 Binary files /dev/null and b/.modules/github.com/shurcoo!l/sanitized_anchor_name/@v/v1.0.0.zip differ diff --git a/.freezer/jackfan.us.kg-stretchr-testify-assert-f6abca593680b2315d2075e0f5e2a9751e3f431a.zip b/.modules/github.com/stretchr/testify/@v/v1.4.0.zip similarity index 61% rename from .freezer/jackfan.us.kg-stretchr-testify-assert-f6abca593680b2315d2075e0f5e2a9751e3f431a.zip rename to .modules/github.com/stretchr/testify/@v/v1.4.0.zip index 9dc9fc8..5d63685 100644 Binary files a/.freezer/jackfan.us.kg-stretchr-testify-assert-f6abca593680b2315d2075e0f5e2a9751e3f431a.zip and b/.modules/github.com/stretchr/testify/@v/v1.4.0.zip differ diff --git a/.freezer/jackfan.us.kg-urfave-cli-cf33a9befefdd6c6ea1a236ab6d546e797a62cbf.zip b/.modules/github.com/urfave/cli/@v/v1.22.1.zip similarity index 62% rename from .freezer/jackfan.us.kg-urfave-cli-cf33a9befefdd6c6ea1a236ab6d546e797a62cbf.zip rename to .modules/github.com/urfave/cli/@v/v1.22.1.zip index 1aacf55..4531d56 100644 Binary files a/.freezer/jackfan.us.kg-urfave-cli-cf33a9befefdd6c6ea1a236ab6d546e797a62cbf.zip and b/.modules/github.com/urfave/cli/@v/v1.22.1.zip differ diff --git a/.modules/golang.org/x/mod/@v/v0.1.0.zip b/.modules/golang.org/x/mod/@v/v0.1.0.zip new file mode 100644 index 0000000..29be7a4 Binary files /dev/null and b/.modules/golang.org/x/mod/@v/v0.1.0.zip differ diff --git a/.freezer/golang-org-x-net-context-dfe83d419c9403b40b19d08cdba2afec27b002f7.zip b/.modules/golang.org/x/net/@v/v0.0.0-20190404232315-eb5bcb51f2a3.zip similarity index 67% rename from .freezer/golang-org-x-net-context-dfe83d419c9403b40b19d08cdba2afec27b002f7.zip rename to .modules/golang.org/x/net/@v/v0.0.0-20190404232315-eb5bcb51f2a3.zip index 1ec3bcf..019e336 100644 Binary files a/.freezer/golang-org-x-net-context-dfe83d419c9403b40b19d08cdba2afec27b002f7.zip and b/.modules/golang.org/x/net/@v/v0.0.0-20190404232315-eb5bcb51f2a3.zip differ diff --git a/.freezer/golang-org-x-oauth2-f047394b6d14284165300fd82dad67edb3a4d7f6.zip b/.modules/golang.org/x/oauth2/@v/v0.0.0-20190604053449-0f29369cfe45.zip similarity index 63% rename from .freezer/golang-org-x-oauth2-f047394b6d14284165300fd82dad67edb3a4d7f6.zip rename to .modules/golang.org/x/oauth2/@v/v0.0.0-20190604053449-0f29369cfe45.zip index 761e57d..858088a 100644 Binary files a/.freezer/golang-org-x-oauth2-f047394b6d14284165300fd82dad67edb3a4d7f6.zip and b/.modules/golang.org/x/oauth2/@v/v0.0.0-20190604053449-0f29369cfe45.zip differ diff --git a/.modules/golang.org/x/sys/@v/v0.0.0-20191008105621-543471e840be.zip b/.modules/golang.org/x/sys/@v/v0.0.0-20191008105621-543471e840be.zip new file mode 100644 index 0000000..1a362df Binary files /dev/null and b/.modules/golang.org/x/sys/@v/v0.0.0-20191008105621-543471e840be.zip differ diff --git a/.modules/google.golang.org/appengine/@v/v1.4.0.zip b/.modules/google.golang.org/appengine/@v/v1.4.0.zip new file mode 100644 index 0000000..5371ed4 Binary files /dev/null and b/.modules/google.golang.org/appengine/@v/v1.4.0.zip differ diff --git a/.freezer/gopkg-in-yaml-v2-cd8b52f8269e0feb286dfeef29f8fe4d5b397e0b.zip b/.modules/gopkg.in/yaml.v2/@v/v2.2.4.zip similarity index 88% rename from .freezer/gopkg-in-yaml-v2-cd8b52f8269e0feb286dfeef29f8fe4d5b397e0b.zip rename to .modules/gopkg.in/yaml.v2/@v/v2.2.4.zip index 3fa0b11..6d9dd27 100644 Binary files a/.freezer/gopkg-in-yaml-v2-cd8b52f8269e0feb286dfeef29f8fe4d5b397e0b.zip and b/.modules/gopkg.in/yaml.v2/@v/v2.2.4.zip differ diff --git a/README.md b/README.md index 0438060..c231004 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Graven is a build management tool for Go projects. It takes light cues from projects like Maven and Leiningen, but given Go's much -simpler environment and far different take on dependency management, +simpler environment and far different take on dependency management, little is shared beyond the goals. Want to know more? Read about the [Motivation for Graven](docs/motivation.md). @@ -16,12 +16,12 @@ Want to know more? Read about the [Motivation for Graven](docs/motivation.md). Graven currently requires the following tools to be on your path: * `go` - the Go build tool, used to compile and test your application. -* `git` - used during the release process to validate the state of your repo, +* `git` - used during the release process to validate the state of your repo, and tag your repo. Of course if you don't plan to use the `release` command commands, you -can still use `graven` just for building, testing and packaging, and thus -would only require the `go` tool. +can still use `graven` just for building, testing and packaging, and thus +would only require the `go` tool. ## Installation @@ -31,16 +31,16 @@ If you want to run the latest, you can just `go get` the tool. go get -u github.com/cbegin/graven ``` -For greater consistency and stability, you can run a specific relese version from: +For greater consistency and stability, you can run a specific relese version from: * https://github.com/cbegin/graven/releases ## Workflow Example -Whether your starting an entirely new project, or working with existing source, -the workflow should be the same. +Whether your starting an entirely new project, or working with existing source, +the workflow should be the same. -Not all of these steps are always necessary. See below for a description of +Not all of these steps are always necessary. See below for a description of implied workflow dependencies. ```bash @@ -63,52 +63,52 @@ $ graven release $ graven bump [major|minor|patch|QUALIFIER] ``` -A typical development cycle looks like the following diagram. The `init` command -is run once per project, then `clean`, `build`, `test` and `package` are typically used -throughout the development cycle. Releases occur less frequently, and versions +A typical development cycle looks like the following diagram. The `init` command +is run once per project, then `clean`, `build`, `test` and `package` are typically used +throughout the development cycle. Releases occur less frequently, and versions are bumped after the release. -The `freeze` and `unfreeze` commands are optional and on a completely +The `freeze` and `unfreeze` commands are optional and on a completely independent flow, thus can be executed any time. They are discussed separately here: [Freezing Dependencies](docs/freezing.md). ``` - +----------+ - > | build | \ - / +----------+ \ - / \ - / v - +----------+ +----------+ +----------+ - | init |--->| clean | | test | - +----------+ +----------+ +----------+ - ^ / - \ / - \ +----------+ / - \| package |<- - +----------+ +----------+ - | freeze | | - +----------+ v - | +----------+ - | | release | - +-----v----+ +----------+ - | unfreeze | | - +----------+ | - +-----v----+ - | bump | - +----------+ + +----------+ + > | build | \ + / +----------+ \ + / \ + / v + +----------+ +----------+ +----------+ + | init |--->| clean | | test | + +----------+ +----------+ +----------+ + ^ / + \ / + \ +----------+ / + \| package |<- + +----------+ +----------+ + | freeze | | + +----------+ v + | +----------+ + | | release | + +-----v----+ +----------+ + | unfreeze | | + +----------+ | + +-----v----+ + | bump | + +----------+ ``` ## project.yaml example -**Before you have flashbacks of Maven POMs...** note that this is probably the +**Before you have flashbacks of Maven POMs...** note that this is probably the biggest project.yaml file you'll ever see. Most projects will have shorter, simpler project.yaml files, and you'll rarely have to modify them once initialized. The following documented structure (derived from this -very project) will help better understand what you can do with it. +very project) will help better understand what you can do with it. ```yaml -# Name, initially derived from parent directory. +# Name, initially derived from parent directory. name: graven # Version is typically managed with the graven bump command. version: 0.6.6 @@ -158,11 +158,11 @@ artifacts: env: GOARCH: amd64 GOOS: windows -# Resources will be included in the packaged archive. Can be overridden at +# Resources will be included in the packaged archive. Can be overridden at # artifact level. resources: - LICENSE -# Configures a repository for deployment. +# Configures a repository for deployment. # Use graven repo --login --name [name] to authenticate repositories: github: @@ -171,7 +171,7 @@ repositories: artifact: graven type: github # Github repos only support releases - roles: + roles: - release artifactory: url: http://localhost:8081/artifactory/releases/ @@ -179,7 +179,7 @@ repositories: artifact: graven type: maven # Supports both releases and frozen dependencies - roles: + roles: - release - dependency nexus: @@ -188,7 +188,7 @@ repositories: artifact: graven type: maven # Supports both releases and frozen dependencies - roles: + roles: - release - dependency docker: @@ -198,7 +198,7 @@ repositories: type: docker file: Dockerfile # Docker repos only support releases - roles: + roles: - release ``` ## Name and Version @@ -220,7 +220,7 @@ M.m.p-Q * M: Major version. Incremented when the software changes significantly and typically in incompatible ways. * m: Minor version. Incremented when new features are added, and backward compatibility is maintained. * p: Patch version. Incremented when bugs are fixed. Backward compatibility is typically maintained, but is -* sometimes unavoidably broken. +* sometimes unavoidably broken. * Q: Qualifier. This is used to qualify a pre-release build and is typically something like RC1, DEV or TEST. ## Artifacts @@ -242,9 +242,9 @@ artifacts: ``` Each entity listed in the artifacts section represents a distributable artifact that consists of one or more executables built from a number of packages compiled with specified flags and environment -variables. The resulting binaries are packaged up in an archive format (e.g. zip or tar.gz) and +variables. The resulting binaries are packaged up in an archive format (e.g. zip or tar.gz) and additional resources can be included in the archive, specified in the resources array. Both resources -and environment variables can be specified at higher levels to avoid duplication. More specific +and environment variables can be specified at higher levels to avoid duplication. More specific environment variables will override broader scoped ones. The classifier specifies a suffix for the artifact that is usually used to indicate the target platform, but can be used to indicate anything that differs among distributable artifacts. @@ -259,35 +259,35 @@ repositories: artifact: graven type: maven # Supports both releases and frozen dependencies - roles: + roles: - release - dependency ... ``` In the repositories section you can define both release and dependency repositories. A release repository -is where this project will be released. A dependency repository will be used to store frozen vendor -dependencies, so that you don't need to check in your vendor directories or .freezer directory. +is where this project will be released. A dependency repository will be used to store frozen vendor +dependencies, so that you don't need to check in your vendor directories or .modules directory. -Three repository types are currently supported: Github, Docker and Maven (including Nexus and Artifactory). +Three repository types are currently supported: Github, Docker and Maven (including Nexus and Artifactory). Their capabilities and settings are summarized in the table below. -| Field | Github | Docker | Maven | +| Field | Github | Docker | Maven | |-------|--------|--------|-------| | type | github | docker | maven | | url | Github API URL | Docker registry URL | Maven release URL | -| group | Owner | Repository | Group ID | -| artifact | Repo | Image Name | Artifact ID | +| group | Owner | Repository | Group ID | +| artifact | Repo | Image Name | Artifact ID | | roles | release | release | release, dependency | | file | unused | Dockerfile | unused | -### Authenticating +### Authenticating In order to use a repository for releases or dependencies, you'll need to authenticate. To do so, simply call `graven repo --login --name [repo-name]`. The credentials you enter will be stored in your home directory in the .graven.yaml file. Your credentials will be -obfuscated to discourage over-the-shoulder or casual exposure. Even though a strong -encryption algorithm is used, the key is not secure and thus you should treat it as +obfuscated to discourage over-the-shoulder or casual exposure. Even though a strong +encryption algorithm is used, the key is not secure and thus you should treat it as such. diff --git a/buildtool/go_buildtool.go b/buildtool/go_buildtool.go index e1e4e78..5ffb0ff 100644 --- a/buildtool/go_buildtool.go +++ b/buildtool/go_buildtool.go @@ -28,10 +28,13 @@ func (g *GoBuildTool) Build(outputPath string, project *domain.Project, artifact fmt.Printf("Building %v/%v:%v\n", artifact.Classifier, target.Executable, project.Version) var c *exec.Cmd - if target.Flags == "" { + if len(target.Flags) == 0 { c = exec.Command("go", "build", "-o", filepath.Join(outputPath, target.Executable), target.Package) } else { - c = exec.Command("go", "build", "-o", filepath.Join(outputPath, target.Executable), target.Flags, target.Package) + args := []string{"build", "-o", filepath.Join(outputPath, target.Executable)} + args = append(args, target.Flags...) + args = append(args, target.Package) + c = exec.Command("go", args...) } c.Stdout = os.Stdout c.Stderr = os.Stderr diff --git a/commands/commands_test.go b/commands/commands_test.go index 27b4b04..20e0ff2 100644 --- a/commands/commands_test.go +++ b/commands/commands_test.go @@ -4,8 +4,8 @@ import ( "fmt" "os" "path" - "testing" "path/filepath" + "testing" "github.com/cbegin/graven/domain" "github.com/cbegin/graven/test_fixtures/hello/version" @@ -109,17 +109,17 @@ func TestShouldInitDirectory(t *testing.T) { func TestShouldFreezeResources(t *testing.T) { c := &cli.Context{} - _ = os.RemoveAll("../test_fixtures/hello/.freezer") + _ = os.RemoveAll("../test_fixtures/hello/.modules") err := freeze(c) assert.NoError(t, err) - assert.True(t, util.PathExists("../test_fixtures/hello/.freezer/jackfan.us.kg-davecgh-go-spew-spew-346938d642f2ec3594ed81d874461961cd0faa76.zip")) - assert.True(t, util.PathExists("../test_fixtures/hello/.freezer/jackfan.us.kg-fatih-color-62e9147c64a1ed519147b62a56a14e83e2be02c1.zip")) - assert.True(t, util.PathExists("../test_fixtures/hello/.freezer/jackfan.us.kg-mattn-go-colorable-941b50ebc6efddf4c41c8e4537a5f68a4e686b24.zip")) - assert.True(t, util.PathExists("../test_fixtures/hello/.freezer/jackfan.us.kg-mattn-go-isatty-fc9e8d8ef48496124e79ae0df75490096eccf6fe.zip")) - assert.True(t, util.PathExists("../test_fixtures/hello/.freezer/jackfan.us.kg-pmezard-go-difflib-difflib-792786c7400a136282c1664665ae0a8db921c6c2.zip")) - assert.True(t, util.PathExists("../test_fixtures/hello/.freezer/jackfan.us.kg-stretchr-testify-assert-f6abca593680b2315d2075e0f5e2a9751e3f431a.zip")) + assert.True(t, util.PathExists("../test_fixtures/hello/.modules/jackfan.us.kg-davecgh-go-spew-spew-346938d642f2ec3594ed81d874461961cd0faa76.zip")) + assert.True(t, util.PathExists("../test_fixtures/hello/.modules/jackfan.us.kg-fatih-color-62e9147c64a1ed519147b62a56a14e83e2be02c1.zip")) + assert.True(t, util.PathExists("../test_fixtures/hello/.modules/jackfan.us.kg-mattn-go-colorable-941b50ebc6efddf4c41c8e4537a5f68a4e686b24.zip")) + assert.True(t, util.PathExists("../test_fixtures/hello/.modules/jackfan.us.kg-mattn-go-isatty-fc9e8d8ef48496124e79ae0df75490096eccf6fe.zip")) + assert.True(t, util.PathExists("../test_fixtures/hello/.modules/jackfan.us.kg-pmezard-go-difflib-difflib-792786c7400a136282c1664665ae0a8db921c6c2.zip")) + assert.True(t, util.PathExists("../test_fixtures/hello/.modules/jackfan.us.kg-stretchr-testify-assert-f6abca593680b2315d2075e0f5e2a9751e3f431a.zip")) } @@ -217,4 +217,3 @@ func resetVersion() { util.CopyFile("../test_fixtures/hello/project.fixture", "../test_fixtures/hello/project.yaml") util.CopyFile("../test_fixtures/hello/version/version.fixture", "../test_fixtures/hello/version/version.go") } - diff --git a/commands/freeze.go b/commands/freeze.go index 6e068ab..72bd3d4 100644 --- a/commands/freeze.go +++ b/commands/freeze.go @@ -3,15 +3,17 @@ package commands import ( "fmt" "os" + "path/filepath" "github.com/cbegin/graven/domain" + "github.com/cbegin/graven/repotool" "github.com/cbegin/graven/util" "github.com/cbegin/graven/vendortool" "github.com/urfave/cli" - "github.com/cbegin/graven/repotool" ) var supportedVendorTools = []vendortool.VendorTool{ + &vendortool.ModVendorTool{}, &vendortool.GovendorVendorTool{}, &vendortool.GlideVendorTool{}, &vendortool.DepVendorTool{}, @@ -23,7 +25,6 @@ var FreezeCommand = cli.Command{ Action: freeze, } - func selectVendorTool(project *domain.Project) (vendortool.VendorTool, error) { for _, vt := range supportedVendorTools { if vt.VendorFileExists(project) { @@ -50,27 +51,32 @@ func freeze(c *cli.Context) error { return err } - freezerPath := project.ProjectPath(".freezer") + freezerPath := project.ProjectPath(".modules") if _, err := os.Stat(freezerPath); !os.IsNotExist(err) { if err := os.RemoveAll(freezerPath); err != nil { - return fmt.Errorf("Could not clean .freezer: %v", err) + return fmt.Errorf("Could not clean .modules: %v", err) } } if err := os.Mkdir(freezerPath, 0755); err != nil { - return fmt.Errorf("Could not make .freezer: %v", err) + return fmt.Errorf("Could not make .modules: %v", err) } for _, p := range vendorTool.Dependencies() { sourcePath := project.ProjectPath("vendor", p.PackagePath()) - targetFile := project.ProjectPath(".freezer", p.ArchiveFileName()) + targetFile := project.ProjectPath(".modules", p.ArchiveFileName()) if _, err := os.Stat(sourcePath); os.IsNotExist(err) { - fmt.Printf("MISSING dependency %v\n", p.PackagePath()) + fmt.Printf("Skipping %v wasn't found in vendor folder (may be an empty dependency).\n", p.PackagePath()) continue } + dirString, _ := filepath.Split(targetFile) + if dirString != "" { + os.MkdirAll(dirString, 0755) + } + err = util.ZipDir(sourcePath, targetFile, false) if err != nil { return err diff --git a/commands/init.go b/commands/init.go index cefaa84..2352b5b 100644 --- a/commands/init.go +++ b/commands/init.go @@ -118,7 +118,7 @@ func initialize(c *cli.Context) error { targets = append(targets, domain.Target{ Executable: fmt.Sprintf("%v%v", executable, template.Extension), Package: pkg, - Flags: "", + Flags: []string{}, }) } } diff --git a/commands/release.go b/commands/release.go index a247c69..49cbfdf 100644 --- a/commands/release.go +++ b/commands/release.go @@ -45,6 +45,19 @@ func release(c *cli.Context) error { if err := pkg(c); err != nil { return err } + + for repoName, repo := range project.Repositories { + if repo.HasRole(domain.RepositoryRoleRelease) { + if repoTool, ok := repotool.RepoRegistry[repo.Type]; ok { + if err := repoTool.LoginTest(project, repoName); err != nil { + return err + } + } else { + fmt.Printf("Unkown repository type %v for %v\n", repo.Type, repoName) + } + } + } + if os.Getenv("TESTRELEASE") == "" { tagName := fmt.Sprintf("v%s", project.Version) if err := vcsTool.Tag(project, remote, tagName); err != nil { diff --git a/commands/repo.go b/commands/repo.go index 32c0e4b..5757914 100644 --- a/commands/repo.go +++ b/commands/repo.go @@ -11,22 +11,35 @@ import ( ) var RepoCommand = cli.Command{ - Name: "repo", - Usage: "Manages repository connections", - Action: repo, - Flags: []cli.Flag{ - cli.BoolFlag{ - Name: "login", - Usage: "Prompts for repo login credentials.", + Name: "repo", + Usage: "Manages repository connections", + Subcommands: []cli.Command{ + { + Name: "login", + Usage: "Logs into a repository.", + Action: repoLogin, + Flags: []cli.Flag{ + cli.StringFlag{ + Name: "name", + Usage: "Repository name.", + }, + }, }, - cli.StringFlag{ - Name: "name", - Usage: "Name of the repo to manage.", + { + Name: "validate", + Usage: "Tests repo settings and authentication credentials.", + Action: repoValidate, + Flags: []cli.Flag{ + cli.StringFlag{ + Name: "name", + Usage: "Repository name.", + }, + }, }, }, } -func repo(c *cli.Context) error { +func repoLogin(c *cli.Context) error { project, err := domain.FindProject() if err != nil { return err @@ -42,22 +55,48 @@ func repo(c *cli.Context) error { return fmt.Errorf("No repo named %v is found in project.", repoName) } - if c.Bool("login") { - if repoTool, ok := repotool.RepoRegistry[repository.Type]; ok { - err := repoTool.Login(project, repoName) - if err != nil { - return err - } - } else { - fmt.Printf("Unknown repo type: %v. Expected one of %v", repository.Type, reflect.ValueOf(repotool.RepoRegistry).MapKeys()) + if repoTool, ok := repotool.RepoRegistry[repository.Type]; ok { + err := repoTool.Login(project, repoName) + if err != nil { + return err } } else { - s, err := yaml.Marshal(repository) + fmt.Printf("Unknown repo type: %v. Expected one of %v", repository.Type, reflect.ValueOf(repotool.RepoRegistry).MapKeys()) + } + + return nil +} + +func repoValidate(c *cli.Context) error { + project, err := domain.FindProject() + if err != nil { + return err + } + + repoName := c.String("name") + if repoName == "" { + return fmt.Errorf("No repo name specified.") + } + + repository, found := project.Repositories[repoName] + if !found { + return fmt.Errorf("No repo named %v is found in project.", repoName) + } + + if repoTool, ok := repotool.RepoRegistry[repository.Type]; ok { + err := repoTool.LoginTest(project, repoName) if err != nil { return err } - fmt.Printf("%v\n", string(s)) + } else { + return fmt.Errorf("Unknown repo type: %v. Expected one of %v", repository.Type, reflect.ValueOf(repotool.RepoRegistry).MapKeys()) + } + + s, err := yaml.Marshal(repository) + if err != nil { + return err } + fmt.Printf("# Validation successful.\n%v", string(s)) return nil } diff --git a/commands/unfreeze.go b/commands/unfreeze.go index ab9dd5a..6abb60e 100644 --- a/commands/unfreeze.go +++ b/commands/unfreeze.go @@ -5,10 +5,10 @@ import ( "os" "github.com/cbegin/graven/domain" - "github.com/cbegin/graven/util" - "github.com/urfave/cli" "github.com/cbegin/graven/repotool" + "github.com/cbegin/graven/util" "github.com/cbegin/graven/vendortool" + "github.com/urfave/cli" ) var UnfreezeCommand = cli.Command{ @@ -34,7 +34,7 @@ func unfreeze(c *cli.Context) error { } for _, p := range vendorTool.Dependencies() { - sourceFile := project.ProjectPath(".freezer", p.ArchiveFileName()) + sourceFile := project.ProjectPath(".modules", p.ArchiveFileName()) targetDir := project.ProjectPath("vendor", p.PackagePath()) _, err := os.Stat(sourceFile) diff --git a/docs/freezing.md b/docs/freezing.md index 4275ebe..7bfa537 100644 --- a/docs/freezing.md +++ b/docs/freezing.md @@ -1,41 +1,41 @@ # Freezing Dependencies Graven's freeze and unfreeze commands are a mechanism to avoid having to -commit a massive vendor directory to your git repository, while at the +commit a massive vendor directory to your git repository, while at the same time protecting you from losing access to key library dependencies in the event of a leftpad scenario. -## Option 1: Committing the .freezer directory +## Option 1: Committing the .modules directory This may seem odd to many idiomatic Go programmers. -And others will trigger on concerns surrounding "binaries in Github". +And others will trigger on concerns surrounding "binaries in Github". Graven takes steps to ensure that the frozen files are as efficient for Git -as possible. It does not compress them, ensuring that Git's binary diff +as possible. It does not compress them, ensuring that Git's binary diff algorithm and ultimate compression (packing) will handle the files efficiently. -So you can check in the .freezer directory with minimal impact to your repository, -and keep it cleaner than if you had committed potentially tens of thousands of -lines of vendored code. +So you can check in the .modules directory with minimal impact to your repository, +and keep it cleaner than if you had committed potentially tens of thousands of +lines of vendored code. -Still worried about binaries in Git? See this video for more: +Still worried about binaries in Git? See this video for more: * https://www.youtube.com/watch?v=rALm7BCCY-0#t=6m28s ## Option 2: Use Maven Repo like Nexus or Artifactory -You don't need to commit the .freezer directory. If you use a -Maven compatible repository such as Nexus or Artifactory, Graven will -translate the Go import path and revision into maven coordinates and +You don't need to commit the .modules directory. If you use a +Maven compatible repository such as Nexus or Artifactory, Graven will +translate the Go import path and revision into maven coordinates and can push and pull those dependencies from your own private repo, to ensure -you're never leftpadded. In this case the .freezer directory acts like a -cache and can be .gitignored. +you're never leftpadded. In this case the .modules directory acts like a +cache and can be .gitignored. ## Do I have to freeze my dependencies to use Graven? No. -The freeze and unfreeze commands are entirely optional and separate -from primary graven workflow (see below). So if you enjoy cluttering your repo -with thousands of lines of third party code (likely more than your own app has) +The freeze and unfreeze commands are entirely optional and separate +from primary graven workflow (see below). So if you enjoy cluttering your repo +with thousands of lines of third party code (likely more than your own app has) in your vendor directory, you can continue to do so! Graven has no core dependency on the freeze and unfreeze features. diff --git a/domain/project.go b/domain/project.go index a438f1c..b674bc5 100644 --- a/domain/project.go +++ b/domain/project.go @@ -37,7 +37,7 @@ type Artifact struct { type Target struct { Executable string `yaml:"executable,omitempty"` Package string `yaml:"package,omitempty"` - Flags string `yaml:"flags,omitempty"` + Flags []string `yaml:"flags,omitempty"` Environment map[string]string `yaml:"env,omitempty"` } @@ -126,24 +126,9 @@ func LoadProject(filepath string) (*Project, error) { } func (project *Project) Environment() []string { - environment := []string{} - homedir, _ := os.LookupEnv("HOME") - userprofile, _ := os.LookupEnv("USERPROFILE") - //gomod, _ := os.LookupEnv("GO111MODULE") - //goproxy := "file://" + project.ProjectPath(".modules") - gopath, _ := os.LookupEnv("GOPATH") - path, _ := os.LookupEnv("PATH") - temp, _ := os.LookupEnv("TEMP") - tmp, _ := os.LookupEnv("TMP") - tmpdir, _ := os.LookupEnv("TMPDIR") - environment = append(environment, fmt.Sprintf("%s=%s", "HOME", homedir)) - environment = append(environment, fmt.Sprintf("%s=%s", "USERPROFILE", userprofile)) - //environment = append(environment, fmt.Sprintf("%s=%s", "GO111MODULE", gomod)) - //environment = append(environment, fmt.Sprintf("%s=%s", "GOPROXY", goproxy)) - environment = append(environment, fmt.Sprintf("%s=%s", "GOPATH", gopath)) - environment = append(environment, fmt.Sprintf("%s=%s", "PATH", path)) - environment = append(environment, fmt.Sprintf("%s=%s", "TMPDIR", tmpdir)) - environment = append(environment, fmt.Sprintf("%s=%s", "TMP", tmp)) - environment = append(environment, fmt.Sprintf("%s=%s", "TEMP", temp)) - return environment + // This function used to do more with the existing environment, + // but now we just forward the whole environment to avoid surprising + // behavior. We'll keep it in case we ever want to add the ability to + // unset existing env vars at some point. + return os.Environ() } diff --git a/domain/project_test.go b/domain/project_test.go index 4d6d508..13ac465 100644 --- a/domain/project_test.go +++ b/domain/project_test.go @@ -35,6 +35,6 @@ func TestShouldLoadProject(t *testing.T) { for _, g := range linux.Targets { assert.Equal(t, "hello", g.Executable) assert.Equal(t, ".", g.Package) - assert.Equal(t, "-p=4", g.Flags) + assert.Equal(t, []string{"-p", "4"}, g.Flags) } } diff --git a/go.mod b/go.mod index 3a54b34..25077ba 100644 --- a/go.mod +++ b/go.mod @@ -5,22 +5,16 @@ go 1.12 require ( github.com/bgentry/speakeasy v0.1.0 github.com/blang/semver v3.5.1+incompatible - github.com/davecgh/go-spew v1.1.0 github.com/fatih/color v1.7.0 - github.com/golang/protobuf v0.0.0-20170613224224-e325f446bebc - github.com/google/go-github v0.0.0-20170604030111-7a51fb928f52 - github.com/google/go-querystring v0.0.0-20170111101155-53e6ce116135 - github.com/hashicorp/errwrap v0.0.0-20141028054710-7554cd9344ce - github.com/hashicorp/go-multierror v0.0.0-20161216184304-ed905158d874 - github.com/mattn/go-colorable v0.1.1 // indirect - github.com/mattn/go-isatty v0.0.7 // indirect - github.com/pelletier/go-buffruneio v0.2.0 - github.com/pelletier/go-toml v0.0.0-20170602065532-fe7536c3dee2 - github.com/pmezard/go-difflib v1.0.0 - github.com/stretchr/testify v0.0.0-20170601210322-f6abca593680 - github.com/urfave/cli v0.0.0-20170612000038-cf33a9befefd - golang.org/x/net v0.0.0-20170613075437-dfe83d419c94 - golang.org/x/oauth2 v0.0.0-20170517174439-f047394b6d14 - google.golang.org/appengine v0.0.0-20170522224838-a2f4131514e5 - gopkg.in/yaml.v2 v2.0.0-20170407172122-cd8b52f8269e + github.com/google/go-github v17.0.0+incompatible + github.com/google/go-querystring v1.0.0 // indirect + github.com/hashicorp/go-multierror v1.0.0 + github.com/mattn/go-colorable v0.1.4 // indirect + github.com/mattn/go-isatty v0.0.10 // indirect + github.com/pelletier/go-toml v1.6.0 + github.com/stretchr/testify v1.4.0 + github.com/urfave/cli v1.22.1 + golang.org/x/mod v0.1.0 + golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 + gopkg.in/yaml.v2 v2.2.4 ) diff --git a/go.sum b/go.sum index f391549..26bc976 100644 --- a/go.sum +++ b/go.sum @@ -1,40 +1,68 @@ +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ= github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= -github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= +github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d h1:U+s90UTSYgptZMwQh2aRr3LuazLJIa+Pg3Kc1ylSYVY= +github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/golang/protobuf v0.0.0-20170613224224-e325f446bebc/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/google/go-github v0.0.0-20170604030111-7a51fb928f52 h1:RO1+F2JB1BPRWnm4WDgfkW7Y4l1F+AyemYnlYtmDP3s= -github.com/google/go-github v0.0.0-20170604030111-7a51fb928f52/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= -github.com/google/go-querystring v0.0.0-20170111101155-53e6ce116135 h1:zLTLjkaOFEFIOxY5BWLFLwh+cL8vOBW4XJ2aqLE/Tf0= -github.com/google/go-querystring v0.0.0-20170111101155-53e6ce116135/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= -github.com/hashicorp/errwrap v0.0.0-20141028054710-7554cd9344ce h1:prjrVgOk2Yg6w+PflHoszQNLTUh4kaByUcEWM/9uin4= -github.com/hashicorp/errwrap v0.0.0-20141028054710-7554cd9344ce/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/go-multierror v0.0.0-20161216184304-ed905158d874 h1:cAv7ZbSmyb1wjn6T4TIiyFCkpcfgpbcNNC3bM2srLaI= -github.com/hashicorp/go-multierror v0.0.0-20161216184304-ed905158d874/go.mod h1:JMRHfdO9jKNzS/+BTlxCjKNQHg/jZAft8U7LloJvN7I= -github.com/mattn/go-colorable v0.1.1 h1:G1f5SKeVxmagw/IyvzvtZE4Gybcc4Tr1tf7I8z0XgOg= -github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= -github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.7 h1:UvyT9uN+3r7yLEYSlJsbQGdsaB/a0DlgWP3pql6iwOc= -github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/pelletier/go-buffruneio v0.2.0 h1:U4t4R6YkofJ5xHm3dJzuRpPZ0mr5MMCoAWooScCR7aA= -github.com/pelletier/go-buffruneio v0.2.0/go.mod h1:JkE26KsDizTr40EUHkXVtNPvgGtbSNq5BcowyYOWdKo= -github.com/pelletier/go-toml v0.0.0-20170602065532-fe7536c3dee2 h1:R8IuqpiwO2+eDcNz+Ic88Xn1OMUjmC9HWdRRmlORhEE= -github.com/pelletier/go-toml v0.0.0-20170602065532-fe7536c3dee2/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= +github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/google/go-github v17.0.0+incompatible h1:N0LgJ1j65A7kfXrZnUDaYCs/Sf4rEjNlfyDHW9dolSY= +github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= +github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk= +github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= +github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= +github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-multierror v1.0.0 h1:iVjPR7a6H0tWELX5NxNe7bYopibicUzc7uPribsnS6o= +github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/mattn/go-colorable v0.1.4 h1:snbPLB8fVfU9iwbbo30TPtbLRzwWu6aJS6Xh4eaaviA= +github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.10 h1:qxFzApOv4WsAL965uUPIsXzAKCZxN2p9UqdhFS4ZW10= +github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= +github.com/pelletier/go-toml v1.6.0 h1:aetoXYr0Tv7xRU/V4B4IZJ2QcbtMUFoNb3ORp7TzIK4= +github.com/pelletier/go-toml v1.6.0/go.mod h1:5N711Q9dKgbdkxHL+MEfF31hpT7l0S0s/t2kKREewys= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/testify v0.0.0-20170601210322-f6abca593680 h1:k3Cv7ttquofwySV/QIpSg4f2UYl/sPXAoTKIxO9CNGc= -github.com/stretchr/testify v0.0.0-20170601210322-f6abca593680/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/urfave/cli v0.0.0-20170612000038-cf33a9befefd h1:Wk6e4p3hxb5tJ9h7kq18Lj72PRj+H6LgkduN8fyx+bo= -github.com/urfave/cli v0.0.0-20170612000038-cf33a9befefd/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= -golang.org/x/net v0.0.0-20170613075437-dfe83d419c94 h1:EdIET8whq4N22VwgYx7yzsJdhY+2fC3YUfxpy7MYPaY= -golang.org/x/net v0.0.0-20170613075437-dfe83d419c94/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/oauth2 v0.0.0-20170517174439-f047394b6d14 h1:5fvqvN1Glau4dT9f9CReJ/5DQdgl50EfDOzX7jBecZg= -golang.org/x/oauth2 v0.0.0-20170517174439-f047394b6d14/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q= +github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= +github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/urfave/cli v1.22.1 h1:+mkCCcOFKPnCmVYVcURKps1Xe+3zP90gSYGNfRkjoIY= +github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/mod v0.1.0 h1:sfUMP1Gu8qASkorDVjnMuvgJzwFbTZSeXFiGBYAVdl4= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e h1:bRhVy7zSSasaqNksaRZiA5EEI+Ei4I1nO5Jh72wfHlg= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3 h1:0GoQqolDA55aaLxZyTzK/Y2ePZzZTUrRacwib7cNsYQ= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 h1:SVwTIAaPC2U/AvvLNZ2a7OVsmBpC8L5BlwK1whH3hm0= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -google.golang.org/appengine v0.0.0-20170522224838-a2f4131514e5/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -gopkg.in/yaml.v2 v2.0.0-20170407172122-cd8b52f8269e h1:o/mfNjxpTLivuKEfxzzwrJ8PmulH2wEp7t713uMwKAA= -gopkg.in/yaml.v2 v2.0.0-20170407172122-cd8b52f8269e/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191008105621-543471e840be h1:QAcqgptGM8IQBC9K/RC4o+O9YmqEm0diQn9QmZw/0mU= +golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/project.yaml b/project.yaml index e17f887..03ea38c 100644 --- a/project.yaml +++ b/project.yaml @@ -1,11 +1,12 @@ name: graven -version: 1.0.5-DEV -go_version: ">=1.10.0" +version: 2.0.0-RC2 +go_version: ">=1.12.0" artifacts: - classifier: darwin targets: - executable: bin/graven package: . + flags: ["-mod", "vendor"] archive: tgz env: GOARCH: amd64 @@ -14,6 +15,7 @@ artifacts: targets: - executable: bin/graven package: . + flags: ["-mod", "vendor"] archive: tar.gz env: GOARCH: amd64 @@ -22,6 +24,7 @@ artifacts: targets: - executable: graven.exe package: . + flags: ["-mod", "vendor"] archive: zip env: GOARCH: amd64 diff --git a/repotool/docker_repotool.go b/repotool/docker_repotool.go index 8ec316a..96f4226 100644 --- a/repotool/docker_repotool.go +++ b/repotool/docker_repotool.go @@ -15,6 +15,10 @@ func (r *DockerRepotool) Login(project *domain.Project, repo string) error { return GenericLogin(project, repo) } +func (r *DockerRepotool) LoginTest(project *domain.Project, repo string) error { + return nil +} + func (r *DockerRepotool) Release(project *domain.Project, repo string) error { config := config.NewConfig() @@ -57,7 +61,6 @@ func (r *DockerRepotool) UploadDependency(project *domain.Project, repo string, return fmt.Errorf("Docker repos don't support dependencies.") } - -func (g *DockerRepotool) DownloadDependency(project *domain.Project, repo string, dependencyFile, dependencyPath string) error { +func (r *DockerRepotool) DownloadDependency(project *domain.Project, repo string, dependencyFile, dependencyPath string) error { return fmt.Errorf("Docker repos don't support dependencies.") -} \ No newline at end of file +} diff --git a/repotool/github_repotool.go b/repotool/github_repotool.go index 6eabaff..35b5fd8 100644 --- a/repotool/github_repotool.go +++ b/repotool/github_repotool.go @@ -27,6 +27,25 @@ func (g *GithubRepoTool) Login(project *domain.Project, repo string) error { return nil } +func (g *GithubRepoTool) LoginTest(project *domain.Project, repo string) error { + gh, ctx, err := authenticate(project, repo) + if err != nil { + return fmt.Errorf("Authentication error for repo %v: %v", repo, err) + } + + repository, found := project.Repositories[repo] + if !found { + return fmt.Errorf("No repo named %v is found in project.", repo) + } + + _, _, err = gh.Repositories.ListReleases(ctx, repository.Group, repository.Artifact, &github.ListOptions{}) + if err != nil { + return fmt.Errorf("Error listing releases for %v: %v", repo, err) + } + + return nil +} + func (g *GithubRepoTool) Release(project *domain.Project, repo string) error { gh, ctx, err := authenticate(project, repo) if err != nil { diff --git a/repotool/maven_repotool.go b/repotool/maven_repotool.go index e89bc90..7153c60 100644 --- a/repotool/maven_repotool.go +++ b/repotool/maven_repotool.go @@ -17,6 +17,10 @@ func (m *MavenRepoTool) Login(project *domain.Project, repo string) error { return GenericLogin(project, repo) } +func (m *MavenRepoTool) LoginTest(project *domain.Project, repo string) error { + return nil +} + func (m *MavenRepoTool) Release(project *domain.Project, repo string) error { config := config.NewConfig() diff --git a/repotool/repotool.go b/repotool/repotool.go index b58824a..5d8cceb 100644 --- a/repotool/repotool.go +++ b/repotool/repotool.go @@ -17,6 +17,7 @@ func init() { type RepoTool interface { Login(project *domain.Project, repo string) error + LoginTest(project *domain.Project, repo string) error Release(project *domain.Project, repo string) error UploadDependency(project *domain.Project, repo string, dependencyFile, dependencyPath string) error DownloadDependency(project *domain.Project, repo string, dependencyFile, dependencyPath string) error diff --git a/test_fixtures/hello/.freezer/jackfan.us.kg-davecgh-go-spew-spew-346938d642f2ec3594ed81d874461961cd0faa76.zip b/test_fixtures/hello/.modules/jackfan.us.kg-davecgh-go-spew-spew-346938d642f2ec3594ed81d874461961cd0faa76.zip similarity index 98% rename from test_fixtures/hello/.freezer/jackfan.us.kg-davecgh-go-spew-spew-346938d642f2ec3594ed81d874461961cd0faa76.zip rename to test_fixtures/hello/.modules/jackfan.us.kg-davecgh-go-spew-spew-346938d642f2ec3594ed81d874461961cd0faa76.zip index b99fdd2..92d698f 100644 Binary files a/test_fixtures/hello/.freezer/jackfan.us.kg-davecgh-go-spew-spew-346938d642f2ec3594ed81d874461961cd0faa76.zip and b/test_fixtures/hello/.modules/jackfan.us.kg-davecgh-go-spew-spew-346938d642f2ec3594ed81d874461961cd0faa76.zip differ diff --git a/test_fixtures/hello/.freezer/jackfan.us.kg-fatih-color-62e9147c64a1ed519147b62a56a14e83e2be02c1.zip b/test_fixtures/hello/.modules/jackfan.us.kg-fatih-color-62e9147c64a1ed519147b62a56a14e83e2be02c1.zip similarity index 98% rename from test_fixtures/hello/.freezer/jackfan.us.kg-fatih-color-62e9147c64a1ed519147b62a56a14e83e2be02c1.zip rename to test_fixtures/hello/.modules/jackfan.us.kg-fatih-color-62e9147c64a1ed519147b62a56a14e83e2be02c1.zip index dde80eb..cc3ba72 100644 Binary files a/test_fixtures/hello/.freezer/jackfan.us.kg-fatih-color-62e9147c64a1ed519147b62a56a14e83e2be02c1.zip and b/test_fixtures/hello/.modules/jackfan.us.kg-fatih-color-62e9147c64a1ed519147b62a56a14e83e2be02c1.zip differ diff --git a/test_fixtures/hello/.freezer/jackfan.us.kg-mattn-go-colorable-941b50ebc6efddf4c41c8e4537a5f68a4e686b24.zip b/test_fixtures/hello/.modules/jackfan.us.kg-mattn-go-colorable-941b50ebc6efddf4c41c8e4537a5f68a4e686b24.zip similarity index 96% rename from test_fixtures/hello/.freezer/jackfan.us.kg-mattn-go-colorable-941b50ebc6efddf4c41c8e4537a5f68a4e686b24.zip rename to test_fixtures/hello/.modules/jackfan.us.kg-mattn-go-colorable-941b50ebc6efddf4c41c8e4537a5f68a4e686b24.zip index b7c3656..a8a0bff 100644 Binary files a/test_fixtures/hello/.freezer/jackfan.us.kg-mattn-go-colorable-941b50ebc6efddf4c41c8e4537a5f68a4e686b24.zip and b/test_fixtures/hello/.modules/jackfan.us.kg-mattn-go-colorable-941b50ebc6efddf4c41c8e4537a5f68a4e686b24.zip differ diff --git a/test_fixtures/hello/.freezer/jackfan.us.kg-mattn-go-isatty-fc9e8d8ef48496124e79ae0df75490096eccf6fe.zip b/test_fixtures/hello/.modules/jackfan.us.kg-mattn-go-isatty-fc9e8d8ef48496124e79ae0df75490096eccf6fe.zip similarity index 81% rename from test_fixtures/hello/.freezer/jackfan.us.kg-mattn-go-isatty-fc9e8d8ef48496124e79ae0df75490096eccf6fe.zip rename to test_fixtures/hello/.modules/jackfan.us.kg-mattn-go-isatty-fc9e8d8ef48496124e79ae0df75490096eccf6fe.zip index 4e35afd..0e96bf8 100644 Binary files a/test_fixtures/hello/.freezer/jackfan.us.kg-mattn-go-isatty-fc9e8d8ef48496124e79ae0df75490096eccf6fe.zip and b/test_fixtures/hello/.modules/jackfan.us.kg-mattn-go-isatty-fc9e8d8ef48496124e79ae0df75490096eccf6fe.zip differ diff --git a/test_fixtures/hello/.freezer/jackfan.us.kg-pmezard-go-difflib-difflib-792786c7400a136282c1664665ae0a8db921c6c2.zip b/test_fixtures/hello/.modules/jackfan.us.kg-pmezard-go-difflib-difflib-792786c7400a136282c1664665ae0a8db921c6c2.zip similarity index 99% rename from test_fixtures/hello/.freezer/jackfan.us.kg-pmezard-go-difflib-difflib-792786c7400a136282c1664665ae0a8db921c6c2.zip rename to test_fixtures/hello/.modules/jackfan.us.kg-pmezard-go-difflib-difflib-792786c7400a136282c1664665ae0a8db921c6c2.zip index 20bcb3b..27f084a 100644 Binary files a/test_fixtures/hello/.freezer/jackfan.us.kg-pmezard-go-difflib-difflib-792786c7400a136282c1664665ae0a8db921c6c2.zip and b/test_fixtures/hello/.modules/jackfan.us.kg-pmezard-go-difflib-difflib-792786c7400a136282c1664665ae0a8db921c6c2.zip differ diff --git a/test_fixtures/hello/.freezer/jackfan.us.kg-stretchr-testify-assert-f6abca593680b2315d2075e0f5e2a9751e3f431a.zip b/test_fixtures/hello/.modules/jackfan.us.kg-stretchr-testify-assert-f6abca593680b2315d2075e0f5e2a9751e3f431a.zip similarity index 98% rename from test_fixtures/hello/.freezer/jackfan.us.kg-stretchr-testify-assert-f6abca593680b2315d2075e0f5e2a9751e3f431a.zip rename to test_fixtures/hello/.modules/jackfan.us.kg-stretchr-testify-assert-f6abca593680b2315d2075e0f5e2a9751e3f431a.zip index 42f6ab0..a564e7c 100644 Binary files a/test_fixtures/hello/.freezer/jackfan.us.kg-stretchr-testify-assert-f6abca593680b2315d2075e0f5e2a9751e3f431a.zip and b/test_fixtures/hello/.modules/jackfan.us.kg-stretchr-testify-assert-f6abca593680b2315d2075e0f5e2a9751e3f431a.zip differ diff --git a/test_fixtures/hello/.freezer/golang-org-x-sys-unix-c23410a886927bab8ca5e80b08af6a56faeb330d.zip b/test_fixtures/hello/.modules/golang-org-x-sys-unix-c23410a886927bab8ca5e80b08af6a56faeb330d.zip similarity index 98% rename from test_fixtures/hello/.freezer/golang-org-x-sys-unix-c23410a886927bab8ca5e80b08af6a56faeb330d.zip rename to test_fixtures/hello/.modules/golang-org-x-sys-unix-c23410a886927bab8ca5e80b08af6a56faeb330d.zip index 2cbf746..df9317b 100644 Binary files a/test_fixtures/hello/.freezer/golang-org-x-sys-unix-c23410a886927bab8ca5e80b08af6a56faeb330d.zip and b/test_fixtures/hello/.modules/golang-org-x-sys-unix-c23410a886927bab8ca5e80b08af6a56faeb330d.zip differ diff --git a/test_fixtures/hello/project.fixture b/test_fixtures/hello/project.fixture index ed8152a..791dd4c 100644 --- a/test_fixtures/hello/project.fixture +++ b/test_fixtures/hello/project.fixture @@ -5,7 +5,7 @@ artifacts: targets: - executable: hello package: . - flags: "" + flags: [] env: {} archive: tgz resources: @@ -17,7 +17,7 @@ artifacts: targets: - executable: hello package: . - flags: "-p=4" + flags: ["-p", "4"] env: {} archive: tar.gz resources: @@ -29,7 +29,7 @@ artifacts: targets: - executable: hello.exe package: . - flags: "" + flags: [] env: {} archive: zip resources: diff --git a/test_fixtures/hello/project.yaml b/test_fixtures/hello/project.yaml index ed8152a..791dd4c 100644 --- a/test_fixtures/hello/project.yaml +++ b/test_fixtures/hello/project.yaml @@ -5,7 +5,7 @@ artifacts: targets: - executable: hello package: . - flags: "" + flags: [] env: {} archive: tgz resources: @@ -17,7 +17,7 @@ artifacts: targets: - executable: hello package: . - flags: "-p=4" + flags: ["-p", "4"] env: {} archive: tar.gz resources: @@ -29,7 +29,7 @@ artifacts: targets: - executable: hello.exe package: . - flags: "" + flags: [] env: {} archive: zip resources: diff --git a/test_fixtures/hello/vendor/vendor.json b/test_fixtures/hello/vendor/vendor.json index 984db67..b433d46 100644 --- a/test_fixtures/hello/vendor/vendor.json +++ b/test_fixtures/hello/vendor/vendor.json @@ -39,7 +39,7 @@ "revisionTime": "2017-06-01T20:57:54Z" }, { - "checksumSHA1": "2L67OZQlNdATOW57chc6+Hc8SO0=", + "checksumSHA1": "pMtZBKBzTz+Y9N0dN1JQi5sOldM=", "path": "golang.org/x/sys/unix", "revision": "c23410a886927bab8ca5e80b08af6a56faeb330d", "revisionTime": "2017-06-23T11:49:42Z" diff --git a/test_fixtures/resources/download.txt b/test_fixtures/resources/download.txt new file mode 100644 index 0000000..d45ee68 --- /dev/null +++ b/test_fixtures/resources/download.txt @@ -0,0 +1,26 @@ + "Path": "cloud.google.com/go", + "Path": "github.com/BurntSushi/toml", + "Path": "github.com/bgentry/speakeasy", + "Path": "github.com/blang/semver", + "Path": "github.com/davecgh/go-spew", + "Path": "github.com/fatih/color", + "Path": "github.com/golang/protobuf", + "Path": "github.com/google/go-github", + "Path": "github.com/google/go-querystring", + "Path": "github.com/hashicorp/errwrap", + "Path": "github.com/hashicorp/go-multierror", + "Path": "github.com/mattn/go-colorable", + "Path": "github.com/mattn/go-isatty", + "Path": "github.com/pelletier/go-toml", + "Path": "github.com/pmezard/go-difflib", + "Path": "github.com/stretchr/objx", + "Path": "github.com/stretchr/testify", + "Path": "github.com/urfave/cli", + "Path": "golang.org/x/net", + "Path": "golang.org/x/oauth2", + "Path": "golang.org/x/sync", + "Path": "golang.org/x/sys", + "Path": "golang.org/x/text", + "Path": "google.golang.org/appengine", + "Path": "gopkg.in/check.v1", + "Path": "gopkg.in/yaml.v2", \ No newline at end of file diff --git a/test_fixtures/resources/go-list-mod.txt b/test_fixtures/resources/go-list-mod.txt new file mode 100644 index 0000000..f4bb8da --- /dev/null +++ b/test_fixtures/resources/go-list-mod.txt @@ -0,0 +1,27 @@ +cloud.google.com/go +github.com/BurntSushi/toml +github.com/bgentry/speakeasy +github.com/blang/semver +github.com/cbegin/graven +github.com/davecgh/go-spew +github.com/fatih/color +github.com/golang/protobuf +github.com/google/go-github +github.com/google/go-querystring +github.com/hashicorp/errwrap +github.com/hashicorp/go-multierror +github.com/mattn/go-colorable +github.com/mattn/go-isatty +github.com/pelletier/go-toml +github.com/pmezard/go-difflib +github.com/stretchr/objx +github.com/stretchr/testify +github.com/urfave/cli +golang.org/x/net +golang.org/x/oauth2 +golang.org/x/sync +golang.org/x/sys +golang.org/x/text +google.golang.org/appengine +gopkg.in/check.v1 +gopkg.in/yaml.v2 diff --git a/test_fixtures/resources/govendor.txt b/test_fixtures/resources/govendor.txt new file mode 100644 index 0000000..e87d422 --- /dev/null +++ b/test_fixtures/resources/govendor.txt @@ -0,0 +1,20 @@ +github.com/bgentry/speakeasy +github.com/blang/semver +github.com/davecgh/go-spew/spew +github.com/fatih/color +github.com/golang/protobuf/proto +github.com/google/go-github/github +github.com/google/go-querystring/query +github.com/hashicorp/errwrap +github.com/hashicorp/go-multierror +github.com/mattn/go-colorable +github.com/mattn/go-isatty +github.com/pelletier/go-toml +github.com/pmezard/go-difflib/difflib +github.com/stretchr/testify/assert +github.com/urfave/cli +golang.org/x/net +golang.org/x/oauth2 +golang.org/x/sys/unix +google.golang.org/appengine +gopkg.in/yaml.v2 \ No newline at end of file diff --git a/test_fixtures/resources/merged.txt b/test_fixtures/resources/merged.txt new file mode 100644 index 0000000..064a14e --- /dev/null +++ b/test_fixtures/resources/merged.txt @@ -0,0 +1,26 @@ +cloud.google.com/go v0.34.0 +github.com/BurntSushi/toml v0.3.1 +github.com/bgentry/speakeasy v0.1.0 +github.com/blang/semver v3.5.1+incompatible +github.com/davecgh/go-spew v1.1.1 +github.com/fatih/color v1.7.0 +github.com/golang/protobuf v1.2.0 +github.com/google/go-github v17.0.0+incompatible +github.com/google/go-querystring v1.0.0 +github.com/hashicorp/errwrap v1.0.0 +github.com/hashicorp/go-multierror v1.0.0 +github.com/mattn/go-colorable v0.1.1 +github.com/mattn/go-isatty v0.0.7 +github.com/pelletier/go-toml v1.3.0 +github.com/pmezard/go-difflib v1.0.0 +github.com/stretchr/objx v0.1.0 +github.com/stretchr/testify v1.3.0 +github.com/urfave/cli v1.20.0 +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e +golang.org/x/oauth2 v0.0.0-20190402181905-9f3314589c9a +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223 +golang.org/x/text v0.3.0 +google.golang.org/appengine v1.4.0 +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 +gopkg.in/yaml.v2 v2.2.2 \ No newline at end of file diff --git a/test_fixtures/resources/modules.txt b/test_fixtures/resources/modules.txt new file mode 100644 index 0000000..f57c27d --- /dev/null +++ b/test_fixtures/resources/modules.txt @@ -0,0 +1,20 @@ +github.com/bgentry/speakeasy +github.com/blang/semver +github.com/davecgh/go-spew +github.com/fatih/color +github.com/golang/protobuf +github.com/google/go-github +github.com/google/go-querystring +github.com/hashicorp/errwrap +github.com/hashicorp/go-multierror +github.com/mattn/go-colorable +github.com/mattn/go-isatty +github.com/pelletier/go-toml +github.com/pmezard/go-difflib +github.com/stretchr/testify +github.com/urfave/cli +golang.org/x/net +golang.org/x/oauth2 +golang.org/x/sys +google.golang.org/appengine +gopkg.in/yaml.v2 \ No newline at end of file diff --git a/vendor/vendor.json b/vendor/vendor.json deleted file mode 100644 index ecf50ed..0000000 --- a/vendor/vendor.json +++ /dev/null @@ -1,181 +0,0 @@ -{ - "comment": "", - "ignore": "test", - "package": [ - { - "path": "appengine", - "revision": "" - }, - { - "path": "appengine_internal", - "revision": "" - }, - { - "path": "appengine_internal/base", - "revision": "" - }, - { - "checksumSHA1": "oTmBS67uxM6OXB/+OJUAG9LK4jw=", - "path": "github.com/bgentry/speakeasy", - "revision": "4aabc24848ce5fd31929f7d1e4ea74d3709c14cd", - "revisionTime": "2017-04-17T20:07:03Z" - }, - { - "checksumSHA1": "OT4XN9z5k69e2RsMSpwW74B+yk4=", - "path": "github.com/blang/semver", - "revision": "2ee87856327ba09384cabd113bc6b5d174e9ec0f", - "revisionTime": "2017-07-27T06:48:18Z" - }, - { - "checksumSHA1": "dvabztWVQX8f6oMLRyv4dLH+TGY=", - "path": "github.com/davecgh/go-spew/spew", - "revision": "346938d642f2ec3594ed81d874461961cd0faa76", - "revisionTime": "2016-10-29T20:57:26Z" - }, - { - "checksumSHA1": "qlPUeFabwF4RKAOF1H+yBFU1Veg=", - "path": "github.com/golang/protobuf/proto", - "revision": "e325f446bebc2998605911c0a2650d9920361d4a", - "revisionTime": "2017-06-13T22:42:24Z" - }, - { - "checksumSHA1": "gww+CMJY8zP/FGE2QSb4lOAd2bU=", - "path": "github.com/google/go-github/github", - "revision": "7a51fb928f52a196d5f31daefb8a489453ef54ff", - "revisionTime": "2017-06-04T03:01:11Z" - }, - { - "checksumSHA1": "p3IB18uJRs4dL2K5yx24MrLYE9A=", - "path": "github.com/google/go-querystring/query", - "revision": "53e6ce116135b80d037921a7fdd5138cf32d7a8a", - "revisionTime": "2017-01-11T10:11:55Z" - }, - { - "checksumSHA1": "cdOCt0Yb+hdErz8NAQqayxPmRsY=", - "path": "github.com/hashicorp/errwrap", - "revision": "7554cd9344cec97297fa6649b055a8c98c2a1e55", - "revisionTime": "2014-10-28T05:47:10Z" - }, - { - "checksumSHA1": "4fgV2vzKKVyIlQ9nMyXIP5muq9E=", - "path": "github.com/hashicorp/go-multierror", - "revision": "ed905158d87462226a13fe39ddf685ea65f1c11f", - "revisionTime": "2016-12-16T18:43:04Z" - }, - { - "checksumSHA1": "F1IYMLBLAZaTOWnmXsgaxTGvrWI=", - "path": "github.com/pelletier/go-buffruneio", - "revision": "c37440a7cf42ac63b919c752ca73a85067e05992", - "revisionTime": "2017-02-27T22:03:11Z" - }, - { - "checksumSHA1": "vHrGGP777P2fqQHr2IYwNVVRQ/o=", - "path": "github.com/pelletier/go-toml", - "revision": "fe7536c3dee2596cdd23ee9976a17c22bdaae286", - "revisionTime": "2017-06-02T06:55:32Z" - }, - { - "checksumSHA1": "LuFv4/jlrmFNnDb/5SCSEPAM9vU=", - "path": "github.com/pmezard/go-difflib/difflib", - "revision": "792786c7400a136282c1664665ae0a8db921c6c2", - "revisionTime": "2016-01-10T10:55:54Z" - }, - { - "checksumSHA1": "5NBHAe3S15q3L9hOLThnMZjIZRE=", - "path": "github.com/stretchr/testify/assert", - "revision": "f6abca593680b2315d2075e0f5e2a9751e3f431a", - "revisionTime": "2017-06-01T20:57:54Z" - }, - { - "checksumSHA1": "lus29xeARKSKWgpA5UPegnYCSEI=", - "path": "github.com/urfave/cli", - "revision": "cf33a9befefdd6c6ea1a236ab6d546e797a62cbf", - "revisionTime": "2017-06-12T00:00:38Z" - }, - { - "checksumSHA1": "Y+HGqEkYM15ir+J93MEaHdyFy0c=", - "path": "golang.org/x/net/context", - "revision": "dfe83d419c9403b40b19d08cdba2afec27b002f7", - "revisionTime": "2017-06-09T23:50:55Z" - }, - { - "checksumSHA1": "SjCoL7KD7qBmgSuqGTCAuUhigDk=", - "path": "golang.org/x/oauth2", - "revision": "f047394b6d14284165300fd82dad67edb3a4d7f6", - "revisionTime": "2017-05-17T17:14:19Z" - }, - { - "checksumSHA1": "Umx4Fmn5FyXJyUVzKWhnQdvFNkc=", - "path": "golang.org/x/oauth2/internal", - "revision": "f047394b6d14284165300fd82dad67edb3a4d7f6", - "revisionTime": "2017-05-17T17:14:19Z" - }, - { - "checksumSHA1": "WPEbk80NB3Esdh4Yk0PXr2K7xVU=", - "path": "google.golang.org/appengine", - "revision": "a2f4131514e563cedfdb6e7d267df9ad48591e93", - "revisionTime": "2017-05-22T22:48:38Z" - }, - { - "checksumSHA1": "4o2JkeR2LyUfZ7BQIzHUejyqKno=", - "path": "google.golang.org/appengine/internal", - "revision": "a2f4131514e563cedfdb6e7d267df9ad48591e93", - "revisionTime": "2017-05-22T22:48:38Z" - }, - { - "checksumSHA1": "x6Thdfyasqd68dWZWqzWWeIfAfI=", - "path": "google.golang.org/appengine/internal/app_identity", - "revision": "a2f4131514e563cedfdb6e7d267df9ad48591e93", - "revisionTime": "2017-05-22T22:48:38Z" - }, - { - "checksumSHA1": "TsNO8P0xUlLNyh3Ic/tzSp/fDWM=", - "path": "google.golang.org/appengine/internal/base", - "revision": "a2f4131514e563cedfdb6e7d267df9ad48591e93", - "revisionTime": "2017-05-22T22:48:38Z" - }, - { - "checksumSHA1": "5QsV5oLGSfKZqTCVXP6NRz5T4Tw=", - "path": "google.golang.org/appengine/internal/datastore", - "revision": "a2f4131514e563cedfdb6e7d267df9ad48591e93", - "revisionTime": "2017-05-22T22:48:38Z" - }, - { - "checksumSHA1": "Gep2T9zmVYV8qZfK2gu3zrmG6QE=", - "path": "google.golang.org/appengine/internal/log", - "revision": "a2f4131514e563cedfdb6e7d267df9ad48591e93", - "revisionTime": "2017-05-22T22:48:38Z" - }, - { - "checksumSHA1": "eLZVX1EHLclFtQnjDIszsdyWRHo=", - "path": "google.golang.org/appengine/internal/modules", - "revision": "a2f4131514e563cedfdb6e7d267df9ad48591e93", - "revisionTime": "2017-05-22T22:48:38Z" - }, - { - "checksumSHA1": "a1XY7rz3BieOVqVI2Et6rKiwQCk=", - "path": "google.golang.org/appengine/internal/remote_api", - "revision": "a2f4131514e563cedfdb6e7d267df9ad48591e93", - "revisionTime": "2017-05-22T22:48:38Z" - }, - { - "checksumSHA1": "QtAbHtHmDzcf6vOV9eqlCpKgjiw=", - "path": "google.golang.org/appengine/internal/urlfetch", - "revision": "a2f4131514e563cedfdb6e7d267df9ad48591e93", - "revisionTime": "2017-05-22T22:48:38Z" - }, - { - "checksumSHA1": "akOV9pYnCbcPA8wJUutSQVibdyg=", - "path": "google.golang.org/appengine/urlfetch", - "revision": "a2f4131514e563cedfdb6e7d267df9ad48591e93", - "revisionTime": "2017-05-22T22:48:38Z" - }, - { - "checksumSHA1": "fALlQNY1fM99NesfLJ50KguWsio=", - "path": "gopkg.in/yaml.v2", - "revision": "cd8b52f8269e0feb286dfeef29f8fe4d5b397e0b", - "revisionTime": "2017-04-07T17:21:22Z" - } - ], - "rootPath": "github.com/cbegin/graven" -} diff --git a/vendortool/govendor_vendortool.go b/vendortool/govendor_vendortool.go index 115b1bb..9c6c609 100644 --- a/vendortool/govendor_vendortool.go +++ b/vendortool/govendor_vendortool.go @@ -56,7 +56,6 @@ func (g *GovendorPackage) Tag() string { return g.Revision } - func (g *GovendorVendorTool) VendorFileExists(project *domain.Project) bool { vendorFilePath := project.ProjectPath("vendor", "vendor.json") return util.PathExists(vendorFilePath) diff --git a/vendortool/mod_vendortool.go b/vendortool/mod_vendortool.go new file mode 100644 index 0000000..726b380 --- /dev/null +++ b/vendortool/mod_vendortool.go @@ -0,0 +1,122 @@ +package vendortool + +import ( + "encoding/json" + "fmt" + "os" + "os/exec" + "regexp" + "strings" + + "path/filepath" + + "golang.org/x/mod/module" + "github.com/cbegin/graven/domain" + "github.com/cbegin/graven/util" +) + +type ModPackage struct { + Path string `json:"Path,omitempty"` + Version string `json:"Version,omitempty"` + Info string `json:"Info,omitempty"` + GoMod string `json:"GoMod,omitempty"` + Zip string `json:"Zip,omitempty"` + Dir string `json:"Dir,omitempty"` + Sum string `json:"Sum,omitempty"` + GoModSum string `json:"GoModSum,omitempty"` +} + +type ModVendorTool struct { + Packages []ModPackage `json:"Packages,omitempty"` +} + +func (g *ModVendorTool) Name() string { + return "mod" +} + +func (g *ModPackage) ArchiveFileName() string { + unescaped := fmt.Sprintf("%v/@v/%v.zip", g.Path, g.Version) + escapedPath, err := module.EscapePath(g.Path) + if err != nil { + fmt.Printf("Error, could not escape module path %v: %v\n", g.Path, err) + return unescaped + } + escapedVersion, err := module.EscapeVersion(g.Version) + if err != nil { + fmt.Printf("Error, could not escape module version %v@%v: %v\n", g.Path, g.Version, err) + return unescaped + } + return fmt.Sprintf("%v/@v/%v.zip", escapedPath, escapedVersion) +} + +func (g *ModPackage) PackagePath() string { + osIndependentPath := filepath.Join(strings.FieldsFunc(g.Path, func(r rune) bool { return r == '\\' || r == '/' })...) + return osIndependentPath +} + +func (g *ModPackage) Tag() string { + return g.Version +} + +func (g *ModVendorTool) VendorFileExists(project *domain.Project) bool { + vendorFilePath := project.ProjectPath("go.mod") + return util.PathExists(vendorFilePath) +} + +func (g *ModVendorTool) LoadFile(project *domain.Project) error { + c := exec.Command("go", "mod", "download", "-json") + c.Stderr = os.Stderr + c.Stdin = os.Stdin + c.Dir = project.ProjectPath() + c.Env = project.Environment() + bytes, err := c.Output() + + err = json.Unmarshal(fixJSONArray(bytes), g) + if err != nil { + return err + } + + if err != nil { + return fmt.Errorf("FAILED to download module information (%v)\n", err) + } + + if !c.ProcessState.Success() { + return fmt.Errorf("FAILED to download module information (command exited in an error state. %v)\n", c) + } + + return g.vendorModules(project) +} + +func (g *ModVendorTool) vendorModules(project *domain.Project) error { + c := exec.Command("go", "mod", "vendor") + c.Stderr = os.Stderr + c.Stdin = os.Stdin + c.Dir = project.ProjectPath() + c.Env = project.Environment() + _, err := c.Output() + + if err != nil { + return fmt.Errorf("FAILED to vendor modules (%v)\n", err) + } + + if !c.ProcessState.Success() { + return fmt.Errorf("FAILED to vendor modules (command exited in an error state. %v)\n", c) + } + return nil +} + +func (g *ModVendorTool) Dependencies() []PackageDepencency { + deps := make([]PackageDepencency, len(g.Packages)) + for i, dx := range g.Packages { + d := dx + deps[i] = &d + } + return deps +} + +func fixJSONArray(notJSON []byte) []byte { + var re = regexp.MustCompile(`}\s*{`) + s := re.ReplaceAllString(string(notJSON), "},\n{") + s = `{"Packages":[` + s + `]}` + return []byte(s) +} diff --git a/version/version.go b/version/version.go index ce7046b..783bcff 100644 --- a/version/version.go +++ b/version/version.go @@ -1,4 +1,4 @@ // graven - This file was generated. It will be overwritten. Do not modify. package version -var Version = "1.0.5-DEV" +var Version = "2.0.0-RC2"