*: move from godep to glide

This commit is contained in:
Eric Chiang 2016-04-08 11:55:56 -07:00
parent de8f345642
commit 3b86cd524c
5 changed files with 175 additions and 206 deletions

View file

@ -82,68 +82,45 @@ docker rm -f dex_postgres
## Vendoring dependencies
dex uses [godep](https://github.com/tools/godep) for vendoring external dependencies. This section details how to add and update those dependencies.
dex uses [glide](https://github.com/Masterminds/glide) for vendoring external dependencies. This section details how to add and update those dependencies.
Before continuing, please ensure you have the **latest version** of godep available in your PATH.
Before continuing, please ensure you have the **latest version** of glide available in your PATH.
```
go get -u github.com/tools/godep
go get -u github.com/Masterminds/glide
```
### Preparing your GOPATH
Godep assumes code uses the [standard Go directory layout](https://golang.org/doc/code.html#Organization) with the GOPATH environment variable. Developers who use a different workflow (for instance, prefer working from `~/src/dex`) should see [rkt's documentation](https://github.com/coreos/rkt/blob/master/Documentation/hacking.md#having-the-right-directory-layout-ie-gopath) for workarounds.
Godep determines depdencies using the GOPATH, not the vendored code in the Godeps directory. The first step is to "restore" your GOPATH to match the vendored state of dex. From dex's top level directory run:
```
godep restore -v
```
Next, continue to either *Adding a new package* or *Updating an existing package*.
### Adding a new package
After adding a new `import` to dex source, godep will automatically detect it and update the vendored code. Once code changes are finalized, bring the dependency into your GOPATH and save the state:
After adding a new `import` to dex source, use `glide get` to add the dependency to the `glide.yaml` and `glide.lock` files.
```
go get github.com/mavricknz/ldap # Replace with your dependency.
godep save ./...
glide get -u -v -s github.com/godbus/dbus
```
Note that dex does **not** rewrite import paths like other CoreOS projects.
Note that __all of these flags are manditory__. This should add an entry to the glide files, add the package to the `vendor` directory, and remove nested `vendor` directories and version control information.
## Updating an existing package
After restoring your GOPATH, update the dependency in your GOPATH to the version you wish to check in.
To update an existing package, edit the `glide.yaml` file to the desired verison (most likely a git hash), and run `glide update`.
```
cd $GOPATH/src/github.com/lib/pq # Replace with your dependency.
git checkout origin master
{{ edit the entry in glide.yaml }}
glide update -u -v -s github.com/lib/pq
```
Then, move to dex's top level directory and run:
```
godep update github.com/lib/pq
```
To update a group of packages, use the `...` notation.
```
godep update github.com/coreos/go-oidc/...
```
Like `glide get` all flags are manditory. If the update was successful, `glide.lock` will have been updated to reflect the changes to `glide.yaml` and the package will have been updated in `vendor`.
## Finalizing your change
Use git to ensure the Godeps directory has updated only your target packages.
Use git to ensure the `vendor` directory has updated only your target packages, and that no other entries in `glide.yaml` and `glide.lock` have changed.
Changes to the Godeps directory should be added as a separate commit from other changes for readability:
```
git status # make sure things look reasonable
git add Godeps
git commit -m "Godeps: updated postgres driver"
git add vendor
git commit -m "vendor: updated postgres driver"
# continue working

165
Godeps/Godeps.json generated
View file

@ -1,165 +0,0 @@
{
"ImportPath": "github.com/coreos/dex",
"GoVersion": "go1.6",
"Packages": [
"./..."
],
"Deps": [
{
"ImportPath": "github.com/PuerkitoBio/goquery",
"Comment": "v0.3.2-79-gb444041",
"Rev": "b4440419d81240f8451a505b2f806c853bc2befc"
},
{
"ImportPath": "github.com/andybalholm/cascadia",
"Rev": "6122e68c2642b7b75c538a63b15168c6c80fb757"
},
{
"ImportPath": "github.com/coreos/go-oidc/http",
"Rev": "6039032c0b15517897116d333ead8edf38792437"
},
{
"ImportPath": "github.com/coreos/go-oidc/jose",
"Rev": "6039032c0b15517897116d333ead8edf38792437"
},
{
"ImportPath": "github.com/coreos/go-oidc/key",
"Rev": "6039032c0b15517897116d333ead8edf38792437"
},
{
"ImportPath": "github.com/coreos/go-oidc/oauth2",
"Rev": "6039032c0b15517897116d333ead8edf38792437"
},
{
"ImportPath": "github.com/coreos/go-oidc/oidc",
"Rev": "6039032c0b15517897116d333ead8edf38792437"
},
{
"ImportPath": "github.com/coreos/pkg/capnslog",
"Rev": "fa94270d4bac0d8ae5dc6b71894e251aada93f74"
},
{
"ImportPath": "github.com/coreos/pkg/flagutil",
"Rev": "fa94270d4bac0d8ae5dc6b71894e251aada93f74"
},
{
"ImportPath": "github.com/coreos/pkg/health",
"Rev": "fa94270d4bac0d8ae5dc6b71894e251aada93f74"
},
{
"ImportPath": "github.com/coreos/pkg/httputil",
"Rev": "fa94270d4bac0d8ae5dc6b71894e251aada93f74"
},
{
"ImportPath": "github.com/coreos/pkg/timeutil",
"Rev": "fa94270d4bac0d8ae5dc6b71894e251aada93f74"
},
{
"ImportPath": "github.com/go-gorp/gorp",
"Comment": "v1.7-138-gc44345f",
"Rev": "c44345f52fc81d27c47e6b592dedaf8c28a972eb"
},
{
"ImportPath": "github.com/gorilla/handlers",
"Rev": "60c7bfde3e33c201519a200a4507a158cc03a17b"
},
{
"ImportPath": "github.com/inconshreveable/mousetrap",
"Rev": "76626ae9c91c4f2a10f34cad8ce83ea42c93bb75"
},
{
"ImportPath": "github.com/jonboulle/clockwork",
"Rev": "3f831b65b61282ba6bece21b91beea2edc4c887a"
},
{
"ImportPath": "github.com/julienschmidt/httprouter",
"Comment": "v1.1",
"Rev": "8c199fb6259ffc1af525cc3ad52ee60ba8359669"
},
{
"ImportPath": "github.com/kylelemons/godebug/diff",
"Rev": "808ac284003ce2b08ef590da08f95379e8a06936"
},
{
"ImportPath": "github.com/kylelemons/godebug/pretty",
"Rev": "808ac284003ce2b08ef590da08f95379e8a06936"
},
{
"ImportPath": "github.com/lib/pq",
"Rev": "7175accbed18058468c07811f76440d6e8d7cf19"
},
{
"ImportPath": "github.com/mailgun/mailgun-go",
"Rev": "9578dc67692294bb7e2a6f4b15dd18c97af19440"
},
{
"ImportPath": "github.com/mattn/go-sqlite3",
"Comment": "v1.1.0-25-g2513631",
"Rev": "2513631704612107a1c8b1803fb8e6b3dda2230e"
},
{
"ImportPath": "github.com/mbanzon/simplehttp",
"Rev": "04c542e7ac706a25820090f274ea6a4f39a63326"
},
{
"ImportPath": "github.com/pborman/uuid",
"Rev": "ca53cad383cad2479bbba7f7a1a05797ec1386e4"
},
{
"ImportPath": "github.com/rubenv/sql-migrate",
"Rev": "53184e1edfb4f9655b0fa8dd2c23e7763f452bda"
},
{
"ImportPath": "github.com/spf13/cobra",
"Rev": "b3f29e98e63a3618988a231fd02b45c1e6369d4f"
},
{
"ImportPath": "github.com/spf13/pflag",
"Rev": "7f60f83a2c81bc3c3c0d5297f61ddfa68da9d3b7"
},
{
"ImportPath": "golang.org/x/crypto/bcrypt",
"Rev": "1fbbd62cfec66bd39d91e97749579579d4d3037e"
},
{
"ImportPath": "golang.org/x/crypto/blowfish",
"Rev": "1fbbd62cfec66bd39d91e97749579579d4d3037e"
},
{
"ImportPath": "golang.org/x/net/html",
"Rev": "dfe268fd2bb5c793f4c083803609fce9806c6f80"
},
{
"ImportPath": "google.golang.org/api/google-api-go-generator",
"Rev": "d3edb0282bde692467788c50070a9211afe75cf3"
},
{
"ImportPath": "google.golang.org/api/googleapi",
"Rev": "d3edb0282bde692467788c50070a9211afe75cf3"
},
{
"ImportPath": "gopkg.in/alexcesaro/quotedprintable.v3",
"Rev": "2caba252f4dc53eaf6b553000885530023f54623"
},
{
"ImportPath": "gopkg.in/asn1-ber.v1",
"Comment": "v1.1",
"Rev": "4e86f4367175e39f69d9358a5f17b4dda270378d"
},
{
"ImportPath": "gopkg.in/gomail.v2",
"Comment": "2.0.0-2-gb1e5552",
"Rev": "b1e55520bf557d8a614f1e1f493ce892c1b5e97e"
},
{
"ImportPath": "gopkg.in/gorp.v1",
"Comment": "v1.7.1",
"Rev": "c87af80f3cc5036b55b83d77171e156791085e2e"
},
{
"ImportPath": "gopkg.in/ldap.v2",
"Comment": "v2.2",
"Rev": "e9a325d64989e2844be629682cb085d2c58eef8d"
}
]
}

5
Godeps/Readme generated
View file

@ -1,5 +0,0 @@
This directory tree is generated automatically by godep.
Please do not edit.
See https://github.com/tools/godep for more information.

85
glide.lock generated Normal file
View file

@ -0,0 +1,85 @@
hash: b0a1c1b400f077dac572450cb9602aabba62d9b7c6fc8ef426c2093de7621e8c
updated: 2016-04-08T11:43:54.191409294-07:00
imports:
- name: github.com/andybalholm/cascadia
version: 6122e68c2642b7b75c538a63b15168c6c80fb757
- name: github.com/coreos/go-oidc
version: 6039032c0b15517897116d333ead8edf38792437
subpackages:
- http
- jose
- key
- oauth2
- oidc
- name: github.com/coreos/pkg
version: fa94270d4bac0d8ae5dc6b71894e251aada93f74
subpackages:
- capnslog
- flagutil
- health
- httputil
- timeutil
- name: github.com/go-gorp/gorp
version: c44345f52fc81d27c47e6b592dedaf8c28a972eb
- name: github.com/gorilla/handlers
version: 60c7bfde3e33c201519a200a4507a158cc03a17b
- name: github.com/inconshreveable/mousetrap
version: 76626ae9c91c4f2a10f34cad8ce83ea42c93bb75
- name: github.com/jonboulle/clockwork
version: 3f831b65b61282ba6bece21b91beea2edc4c887a
- name: github.com/julienschmidt/httprouter
version: 8c199fb6259ffc1af525cc3ad52ee60ba8359669
- name: github.com/kylelemons/godebug
version: 808ac284003ce2b08ef590da08f95379e8a06936
subpackages:
- diff
- pretty
- name: github.com/lib/pq
version: 7175accbed18058468c07811f76440d6e8d7cf19
subpackages:
- oid
- name: github.com/mailgun/mailgun-go
version: 9578dc67692294bb7e2a6f4b15dd18c97af19440
- name: github.com/mattn/go-sqlite3
version: 2513631704612107a1c8b1803fb8e6b3dda2230e
- name: github.com/mbanzon/simplehttp
version: 04c542e7ac706a25820090f274ea6a4f39a63326
- name: github.com/pborman/uuid
version: ca53cad383cad2479bbba7f7a1a05797ec1386e4
- name: github.com/PuerkitoBio/goquery
version: b4440419d81240f8451a505b2f806c853bc2befc
- name: github.com/rubenv/sql-migrate
version: 53184e1edfb4f9655b0fa8dd2c23e7763f452bda
subpackages:
- sqlparse
- name: github.com/spf13/cobra
version: b3f29e98e63a3618988a231fd02b45c1e6369d4f
- name: github.com/spf13/pflag
version: 7f60f83a2c81bc3c3c0d5297f61ddfa68da9d3b7
- name: golang.org/x/crypto
version: 1fbbd62cfec66bd39d91e97749579579d4d3037e
subpackages:
- bcrypt
- blowfish
- name: golang.org/x/net
version: dfe268fd2bb5c793f4c083803609fce9806c6f80
subpackages:
- html
- html/atom
- name: google.golang.org/api
version: d3edb0282bde692467788c50070a9211afe75cf3
subpackages:
- google-api-go-generator
- googleapi
- googleapi/internal/uritemplates
- name: gopkg.in/alexcesaro/quotedprintable.v3
version: 2caba252f4dc53eaf6b553000885530023f54623
- name: gopkg.in/asn1-ber.v1
version: 4e86f4367175e39f69d9358a5f17b4dda270378d
- name: gopkg.in/gomail.v2
version: b1e55520bf557d8a614f1e1f493ce892c1b5e97e
- name: gopkg.in/gorp.v1
version: c87af80f3cc5036b55b83d77171e156791085e2e
- name: gopkg.in/ldap.v2
version: e9a325d64989e2844be629682cb085d2c58eef8d
devImports: []

77
glide.yaml Normal file
View file

@ -0,0 +1,77 @@
package: github.com/coreos/dex
import:
- package: github.com/PuerkitoBio/goquery
version: b4440419d81240f8451a505b2f806c853bc2befc
- package: github.com/andybalholm/cascadia
version: 6122e68c2642b7b75c538a63b15168c6c80fb757
- package: github.com/coreos/go-oidc
version: 6039032c0b15517897116d333ead8edf38792437
subpackages:
- http
- jose
- key
- oauth2
- oidc
- package: github.com/coreos/pkg
version: fa94270d4bac0d8ae5dc6b71894e251aada93f74
subpackages:
- capnslog
- flagutil
- health
- httputil
- timeutil
- package: github.com/go-gorp/gorp
version: c44345f52fc81d27c47e6b592dedaf8c28a972eb
- package: github.com/gorilla/handlers
version: 60c7bfde3e33c201519a200a4507a158cc03a17b
- package: github.com/inconshreveable/mousetrap
version: 76626ae9c91c4f2a10f34cad8ce83ea42c93bb75
- package: github.com/jonboulle/clockwork
version: 3f831b65b61282ba6bece21b91beea2edc4c887a
- package: github.com/julienschmidt/httprouter
version: 8c199fb6259ffc1af525cc3ad52ee60ba8359669
- package: github.com/kylelemons/godebug
version: 808ac284003ce2b08ef590da08f95379e8a06936
subpackages:
- diff
- pretty
- package: github.com/lib/pq
version: 7175accbed18058468c07811f76440d6e8d7cf19
- package: github.com/mailgun/mailgun-go
version: 9578dc67692294bb7e2a6f4b15dd18c97af19440
- package: github.com/mattn/go-sqlite3
version: 2513631704612107a1c8b1803fb8e6b3dda2230e
- package: github.com/mbanzon/simplehttp
version: 04c542e7ac706a25820090f274ea6a4f39a63326
- package: github.com/pborman/uuid
version: ca53cad383cad2479bbba7f7a1a05797ec1386e4
- package: github.com/rubenv/sql-migrate
version: 53184e1edfb4f9655b0fa8dd2c23e7763f452bda
- package: github.com/spf13/cobra
version: b3f29e98e63a3618988a231fd02b45c1e6369d4f
- package: github.com/spf13/pflag
version: 7f60f83a2c81bc3c3c0d5297f61ddfa68da9d3b7
- package: golang.org/x/crypto
version: 1fbbd62cfec66bd39d91e97749579579d4d3037e
subpackages:
- bcrypt
- blowfish
- package: golang.org/x/net
version: dfe268fd2bb5c793f4c083803609fce9806c6f80
subpackages:
- html
- package: google.golang.org/api
version: d3edb0282bde692467788c50070a9211afe75cf3
subpackages:
- google-api-go-generator
- googleapi
- package: gopkg.in/alexcesaro/quotedprintable.v3
version: 2caba252f4dc53eaf6b553000885530023f54623
- package: gopkg.in/asn1-ber.v1
version: 4e86f4367175e39f69d9358a5f17b4dda270378d
- package: gopkg.in/gomail.v2
version: b1e55520bf557d8a614f1e1f493ce892c1b5e97e
- package: gopkg.in/gorp.v1
version: c87af80f3cc5036b55b83d77171e156791085e2e
- package: gopkg.in/ldap.v2
version: e9a325d64989e2844be629682cb085d2c58eef8d