Skip to content

Commit

Permalink
*: move to opencontainers/image-tools
Browse files Browse the repository at this point in the history
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
  • Loading branch information
runcom committed Sep 15, 2016
1 parent b5b3f3c commit fe363aa
Show file tree
Hide file tree
Showing 74 changed files with 754 additions and 8,262 deletions.
7 changes: 3 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
code-of-conduct.md
/oci-image-tool
/oci-validate-examples
output
/oci-create-runtime-bundle
/oci-unpack
/oci-image-validate
1 change: 1 addition & 0 deletions .tool/lint
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ for d in $(find . -type d -not -iwholename '*.git*' -a -not -iname '.tool' -a -n
--exclude='.*_test\.go:.*error return value not checked.*\(errcheck\)$' \
--exclude='duplicate of.*_test.go.*\(dupl\)$' \
--exclude='schema/fs.go' \
--exclude='duplicate of.*main.go.*\(dupl\)$' \
--disable=aligncheck \
--disable=gotype \
--disable=gas \
Expand Down
8 changes: 2 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
language: go
go:
- 1.6
- 1.7

sudo: required

services:
- docker

before_script:
- export PATH=$HOME/gopath/bin:$PATH

before_install:
- docker pull vbatts/pandoc
- make install.tools
- go get -u github.com/alecthomas/gometalinter
- gometalinter --install --update
Expand All @@ -24,5 +21,4 @@ script:
- make lint
- make check-license
- make test
- make oci-image-tool
- make docs
- make tools
19 changes: 0 additions & 19 deletions ChangeLog

This file was deleted.

124 changes: 0 additions & 124 deletions HACKING.md

This file was deleted.

99 changes: 15 additions & 84 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,98 +1,28 @@
GO15VENDOREXPERIMENT=1
export GO15VENDOREXPERIMENT

DOCKER ?= $(shell command -v docker 2>/dev/null)
PANDOC ?= $(shell command -v pandoc 2>/dev/null)

ifeq "$(strip $(PANDOC))" ''
ifneq "$(strip $(DOCKER))" ''
PANDOC = $(DOCKER) run \
-it \
--rm \
-v $(shell pwd)/:/input/:ro \
-v $(shell pwd)/$(OUTPUT_DIRNAME)/:/$(OUTPUT_DIRNAME)/ \
-u $(shell id -u) \
--workdir /input \
vbatts/pandoc
PANDOC_SRC := /input/
PANDOC_DST := /
endif
endif

# These docs are in an order that determines how they show up in the PDF/HTML docs.
DOC_FILES := \
README.md \
code-of-conduct.md \
project.md \
media-types.md \
descriptor.md \
image-layout.md \
layer.md \
config.md \
manifest.md

FIGURE_FILES := \
img/media-types.png

OUTPUT_DIRNAME ?= output/
DOC_FILENAME ?= oci-image-spec

EPOCH_TEST_COMMIT ?= v0.2.0

default: help

help:
@echo "Usage: make <target>"
@echo
@echo " * 'docs' - produce document in the $(OUTPUT_DIRNAME) directory"
@echo " * 'fmt' - format the json with indentation"
@echo " * 'validate-examples' - validate the examples in the specification markdown files"
@echo " * 'oci-image-tool' - build the oci-image-tool binary"
@echo " * 'schema-fs' - regenerate the virtual schema http/FileSystem"
@echo " * 'tools' - build the oci image tools binaries"
@echo " * 'check-license' - check license headers in source files"
@echo " * 'lint' - Execute the source code linter"
@echo " * 'test' - Execute the unit tests"
@echo " * 'update-deps' - Update vendored dependencies"
@echo " * 'img/*.png' - Generate PNG from dot file"

fmt:
for i in schema/*.json ; do jq --indent 2 -M . "$${i}" > xx && cat xx > "$${i}" && rm xx ; done

docs: $(OUTPUT_DIRNAME)/$(DOC_FILENAME).pdf $(OUTPUT_DIRNAME)/$(DOC_FILENAME).html

ifeq "$(strip $(PANDOC))" ''
$(OUTPUT_DIRNAME)/$(DOC_FILENAME).pdf: $(DOC_FILES) $(FIGURE_FILES)
$(error cannot build $@ without either pandoc or docker)
else
$(OUTPUT_DIRNAME)/$(DOC_FILENAME).pdf: $(DOC_FILES) $(FIGURE_FILES)
@mkdir -p $(OUTPUT_DIRNAME)/ && \
$(PANDOC) -f markdown_github -t latex -o $(PANDOC_DST)$@ $(patsubst %,$(PANDOC_SRC)%,$(DOC_FILES))
ls -sh $(shell readlink -f $@)

$(OUTPUT_DIRNAME)/$(DOC_FILENAME).html: $(DOC_FILES) $(FIGURE_FILES)
@mkdir -p $(OUTPUT_DIRNAME)/ && \
cp -ap img/ $(shell pwd)/$(OUTPUT_DIRNAME)/&& \
$(PANDOC) -f markdown_github -t html5 -o $(PANDOC_DST)$@ $(patsubst %,$(PANDOC_SRC)%,$(DOC_FILES))
ls -sh $(shell readlink -f $@)
endif

code-of-conduct.md:
curl -o $@ https://raw.githubusercontent.com/opencontainers/tob/d2f9d68c1332870e40693fe077d311e0742bc73d/code-of-conduct.md

validate-examples:
go test -run TestValidate ./schema

oci-image-tool:
go build ./cmd/oci-image-tool

schema-fs:
@echo "generating schema fs"
@cd schema && printf "%s\n\n%s\n" "$$(cat ../.header)" "$$(go generate)" > fs.go

check-license:
@echo "checking license headers"
@./.tool/check-license

tools:
go build ./cmd/oci-create-runtime-bundle
go build ./cmd/oci-unpack
go build ./cmd/oci-image-validate

lint:
@echo "checking lint"
@./.tool/lint
Expand All @@ -108,9 +38,6 @@ update-deps:
# see http://sed.sourceforge.net/sed1line.txt
find vendor -type f -exec sed -i -e :a -e '/^\n*$$/{$$d;N;ba' -e '}' "{}" \;

img/%.png: img/%.dot
dot -Tpng $^ > $@

.PHONY: .gitvalidation

# When this is running in travis, it will only check the travis commit range
Expand All @@ -124,7 +51,7 @@ endif

.PHONY: install.tools

install.tools: .install.gitvalidation .install.glide .install.glide-vc
install.tools: .install.gitvalidation .install.glide .install.glide-vc .install.gometalinter

.install.gitvalidation:
go get github.com/vbatts/git-validation
Expand All @@ -135,15 +62,19 @@ install.tools: .install.gitvalidation .install.glide .install.glide-vc
.install.glide-vc:
go get github.com/sgotti/glide-vc

.install.gometalinter:
go get github.com/alecthomas/gometalinter
gometalinter --install --update

clean:
rm -rf *~ $(OUTPUT_DIRNAME)
rm -f oci-image-tool
rm -f oci-create-runtime-bundle
rm -f oci-unpack
rm -f oci-image-validate

.PHONY: \
validate-examples \
oci-image-tool \
tools \
check-license \
clean \
lint \
docs \
test
Loading

0 comments on commit fe363aa

Please sign in to comment.