-
Notifications
You must be signed in to change notification settings - Fork 670
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vendor dependencies, add hacking guide #148
Merged
Merged
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
# Hacking Guide | ||
|
||
## Overview | ||
|
||
This guide contains instructions for building artifacts contained in this repository. | ||
|
||
### Go | ||
|
||
This spec includes several Go packages, and a command line tool considered to be a reference implementation of the OCI image specification. | ||
|
||
Prerequsites: | ||
* Go >=1.5 | ||
* make | ||
|
||
The following make targets are relevant for any work involving the Go packages. | ||
|
||
### Linting | ||
|
||
The included Go source code is being examined for any linting violations not included in the standard Go compiler. Linting is done using [gometalinter](https://github.com/alecthomas/gometalinter). | ||
|
||
Invocation: | ||
``` | ||
$ make lint | ||
``` | ||
|
||
### Tests | ||
|
||
This target executes all Go based tests. | ||
|
||
Invocation: | ||
``` | ||
$ make test | ||
$ make validate-examples | ||
``` | ||
|
||
### OCI image tool | ||
|
||
This target builds the `oci-image-tool` binary. | ||
|
||
Invocation: | ||
``` | ||
$ make oci-image-tool | ||
``` | ||
|
||
### Virtual schema http/FileSystem | ||
|
||
The `oci-image-tool` uses a virtual [http/FileSystem](https://golang.org/pkg/net/http/#FileSystem) to load the JSON schema files for validating OCI images and/or manifests. The virtual file system is generated using the `esc` tool and compiled into the `oci-image-tool` binary so the JSON schema files don't have to be distributed along with the binary. | ||
|
||
Whenever changes are being done in any of the `schema/*.json` files, one must refresh the generated virtual file system. Otherwise schema changes will not be visible inside the `oci-image-tool`. | ||
|
||
Prerequisites: | ||
* [esc](https://github.com/mjibson/esc) | ||
|
||
Invocation: | ||
``` | ||
$ make schema-fs | ||
``` | ||
|
||
### JSON schema formatting | ||
|
||
This target auto-formats all JSON files in the `schema` directory using the `jq` tool. | ||
|
||
Prerequisites: | ||
* [jq](https://stedolan.github.io/jq/) | ||
|
||
Invocation: | ||
``` | ||
$ make fmt | ||
``` | ||
|
||
### OCI image specification PDF/HTML documentation files | ||
|
||
This target generates a PDF/HTML version of the OCI image specification. | ||
|
||
Prerequisites: | ||
* [Docker](https://www.docker.com/) | ||
|
||
Invocation: | ||
``` | ||
$ make docs | ||
``` | ||
|
||
### License header check | ||
|
||
This target checks if the source code includes necessary headers. | ||
|
||
Invocation: | ||
``` | ||
$ make check-license | ||
``` | ||
|
||
### Update vendored dependencies | ||
|
||
This target updates all vendored depencies to their newest available versions. The `glide` tools is being used for the actual management and `glide-vc` tool is being used for stripping down the vendor directory size. | ||
|
||
Prerequisites: | ||
* [glide](https://github.com/Masterminds/glide) | ||
* [glide-vc](https://github.com/sgotti/glide-vc) | ||
|
||
Invocation: | ||
``` | ||
$ make update-deps | ||
``` | ||
|
||
### Clean build artifacts | ||
|
||
This target cleans all generated/compiled artifacts. | ||
|
||
Invocation: | ||
``` | ||
$ make clean | ||
``` | ||
|
||
### Create PNG images from dot files | ||
|
||
This target generates PNG image files from DOT source files in the `img` directory. | ||
|
||
Prerequisites: | ||
* [graphviz](http://www.graphviz.org/) | ||
|
||
Invocation: | ||
``` | ||
$ make img/media-types.png | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably better to use find's
-exec
instead of the for loop (-execdir
is safer, but not in POSIX). Although you may have to keep the for loop, because-i
is not in POSIX for sed.