From 863ffb6f43c154ba486e495c2af38a27bf50f9fd Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Wed, 25 Jan 2017 16:47:11 -0800 Subject: [PATCH 1/4] Makefile: Add .install.esc and make it part of install.tools So we can 'make schema-fs' in Travis. Signed-off-by: W. Trevor King --- Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 05e033e82..8552f10be 100644 --- a/Makefile +++ b/Makefile @@ -118,7 +118,10 @@ endif .PHONY: install.tools -install.tools: .install.gitvalidation .install.glide .install.glide-vc +install.tools: .install.esc .install.gitvalidation .install.glide .install.glide-vc + +.install.esc: + go get -u github.com/mjibson/esc .install.gitvalidation: go get -u github.com/vbatts/git-validation From 033a3feeca9258eda0c2d54d4bf3790cff674873 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Wed, 25 Jan 2017 16:09:32 -0800 Subject: [PATCH 2/4] .travis.yml: Rebuild schema-fs in the Travis tests And error out if that fails. 'make schema-fs' is in before_install, since things are really broken in that case and we want to error the build exit immediately [1]. If someone forgot to run schema-fs, that's less serious and we only want to fail the build (and still run the other tests) [1]. [1]: https://docs.travis-ci.com/user/customizing-the-build/#Breaking-the-Build Signed-off-by: W. Trevor King --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 17f4840ce..578a3fdaf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,11 +16,13 @@ before_install: - go get -u github.com/alecthomas/gometalinter - gometalinter --install - go get -t -d ./... + - make schema-fs install: true script: - env | grep TRAVIS_ + - git diff --exit-code - make .gitvalidation - make lint - make check-license From feedbc664836a4488bcb43d228ecbb9536499dcf Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Wed, 25 Jan 2017 20:32:58 -0800 Subject: [PATCH 3/4] schema/gen.go: Set -modtime=0 in 'esc' invocation To give reproducible builds regardless of when you check the JSON files out of Git. Signed-off-by: W. Trevor King --- schema/gen.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/schema/gen.go b/schema/gen.go index c3ff5779c..007ee7af6 100644 --- a/schema/gen.go +++ b/schema/gen.go @@ -18,4 +18,4 @@ package schema // using esc (https://github.com/mjibson/esc). // This should generally be invoked with `make schema-fs` -//go:generate esc -private -pkg=schema -ignore=.*go . +//go:generate esc -private -modtime=0 -pkg=schema -ignore=.*go . From 4112ba180b3a5e27a7787652509d805e102ec338 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Fri, 27 Jan 2017 07:07:42 -0800 Subject: [PATCH 4/4] schema/fs.go: Rebuild the schema To zero out the modtimes (picking up the change from the previous commit). Generated with: $ make schema-fs Signed-off-by: W. Trevor King --- schema/fs.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/schema/fs.go b/schema/fs.go index 48a2beb81..1ef43c8f4 100644 --- a/schema/fs.go +++ b/schema/fs.go @@ -205,7 +205,7 @@ var _escData = map[string]*_escFile{ "/config-schema.json": { local: "config-schema.json", size: 774, - modtime: 1485388791, + modtime: 0, compressed: ` H4sIAAAJbogA/5SRvW7rMAyFdz+F4WS8ju7QKWsfoEPHooMqUzEDWFRJZgiKvHv1EzcxEBTuEsSH/M4R ya+mbbsBxDFGRQrdvu1eIoRnCmoxALfpn8dD+xrBoUdnS9e/jG3FjTDZjIyqcW/MUSj0Vd0RH8zA1mv/ @@ -219,7 +219,7 @@ AP//XlvgsQYDAAA= "/content-descriptor.json": { local: "content-descriptor.json", size: 956, - modtime: 1485388791, + modtime: 0, compressed: ` H4sIAAAJbogA/5STP2/bMBDFd3+KgxIgSxx1CDoYQZZ279BuRQeaPEmXmn96PCNVC3/3HkUpttsigRfD fHyP9zvy9HsF0DjMlikJxdBsoPmUMHyIQQwFZCj/MAh8nE2R4XNCSx1ZMyVuyxHX2Q7oTYkPImnTtk85 @@ -234,7 +234,7 @@ xJmFKfQvVt3pIntTLllpqZn1w2r5nVppGH/sibF8BF//HtjTiTl/OF18Wx1WfwIAAP//z1UgVLwDAAA= "/defs-config.json": { local: "defs-config.json", size: 2236, - modtime: 1485388791, + modtime: 0, compressed: ` H4sIAAAJbogA/+RVzY7TMBC+5yksw7Gwd6673JCKVAEHhCo3Ge/OEnvMeIKI0L47TrZ0888qpac9VG0m /n7m89j9nSmlC4g5YxAkr98pfQMWPTZPUQXDgnlVGlZCahvAX5MXgx5YpV8Wb9UuQI4Wc9PiN4+EJ4ZE @@ -250,7 +250,7 @@ jNdz5yFrPg/ZnwAAAP//3oH4m7wIAAA= "/defs-image.json": { local: "defs-image.json", size: 2916, - modtime: 1485388791, + modtime: 0, compressed: ` H4sIAAAJbogA/8SWTU/bTBDH7/kU+xj0cMiLaVUhNUJIVbn0xIGeigIa1uN4qL3r7m6gIfJ3767t+D3Q lKg9wc6u//P/zc443owY8wLUXFFqSApvzrxLDEmQW2mWgjLEVzEoZiS7SlF8lsIACVTsSwJLZNcpcgqJ @@ -270,7 +270,7 @@ wPY1u7t/TOu/YLV/T63trA92OFtW7I1mZo82Q9HlhzNVib7VXIjgKn7YktWqO+31R7RIOTimr4I1J3II "/defs.json": { local: "defs.json", size: 3193, - modtime: 1485388791, + modtime: 0, compressed: ` H4sIAAAJbogA/7RWTXPaMBC98ys8tEfa2PIX9NYp/cghAzOZnjo9uGYBtSCpstxpmuG/VzLGWPZiMKWH JPau9r23T6tYzwPHGS4gSyUVinI2fOMMp7CkjJq3zMkzWDhqLXm+WvNc6UdwZgLYO85UQhlI51FASpc0 @@ -289,7 +289,7 @@ MrVJbn8cB+ZnN/gbAAD//0JyEpx5DAAA "/image-layout-schema.json": { local: "image-layout-schema.json", size: 414, - modtime: 1485388791, + modtime: 0, compressed: ` H4sIAAAJbogA/2yPsU7EMAyG9z6FFRhpUySmW286CekGJBbEEFpfmxNNQuIinVDfHSduYbhbWvmPP3/2 TwWgekxdtIGsd2oH6hjQ7b0jYx1GOExmQHg2Fz8TvHQjTkY9ZOo+ScHESBR2Wp+Td7WkjY+D7qM5Ud0+ @@ -302,7 +302,7 @@ ngEAAA== "/image-manifest-schema.json": { local: "image-manifest-schema.json", size: 921, - modtime: 1485389045, + modtime: 0, compressed: ` H4sIAAAJbogA/5ySMU/rMBSF9/yKq7RjU7/39KauTB0QA4gFMZjkJrlVbQfbRVSo/51ru6Y1ZUAdc+xz 7ndP/FEB1B261tLkyeh6BfXdhPrGaC9Jo4W1kgPCrdTUo/NwP2FLPbUy3l4E+9y1IyoZrKP300qIjTO6 @@ -317,7 +317,7 @@ AP//UcoRdpkDAAA= "/manifest-list-schema.json": { local: "manifest-list-schema.json", size: 873, - modtime: 1485389045, + modtime: 0, compressed: ` H4sIAAAJbogA/6SSv0/7MBDF9/wVp/Q7flMjxNQVFiQQA4gFMZjk0lzV2OHORVSo/zv+EZdEZUDqUqnP fu8+7+KvAqBsUGqmwZE15QrKhwHNtTVOk0GG216vEe61oRbFwR35n8cBa2qp1tHyP2T8k7rDXgd/59yw