-
Notifications
You must be signed in to change notification settings - Fork 378
Version the CSI protobuf #74
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
Merged
jieyu
merged 1 commit into
container-storage-interface:master
from
akutz:feature/csi.proto
Aug 11, 2017
Merged
Changes from all commits
Commits
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 hidden or 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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
csi.proto | ||
csi.pb.go | ||
/csi.proto.tmp | ||
.DS_Store |
This file contains hidden or 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 |
---|---|---|
@@ -1,26 +1,38 @@ | ||
go_import_path: github.com/container-storage-interface/spec | ||
# Setting "sudo" to false forces Travis-CI to use its | ||
# container-based build infrastructure, which has shorter | ||
# queue times. | ||
sudo: false | ||
|
||
language: go | ||
# Use the newer Travis-CI build templates based on the | ||
# Debian Linux distribution "Trusty" release. | ||
dist: trusty | ||
|
||
go: | ||
- 1.8.x | ||
# Selecting C as the language keeps the container to a | ||
# minimum footprint. | ||
language: c | ||
|
||
before_install: | ||
- gem install gist | ||
- curl -LO https://github.com/google/protobuf/releases/download/v3.3.0/protoc-3.3.0-linux-x86_64.zip | ||
- unzip protoc-3.3.0-linux-x86_64.zip | ||
- chmod +x bin/protoc | ||
- export PATH="$(pwd)/bin:$PATH" | ||
jobs: | ||
include: | ||
|
||
install: | ||
- go get -u github.com/golang/protobuf/proto | ||
- go get -u github.com/golang/protobuf/protoc-gen-go | ||
- go get -u google.golang.org/grpc | ||
- CSI_SPEC_FILE=spec.md make csi.proto | ||
# The test stage validates that the protobuf file was updated | ||
# correctly prior to being committed. | ||
- stage: test | ||
script: make | ||
|
||
script: | ||
- make csi.pb.go | ||
# The lang stages validate the specification using | ||
# language-specific bindings. | ||
|
||
after_success: | ||
- printf "%s" "$GITHUB_API_TOKEN" > "${HOME}/.gist" | ||
- gist -d "https://travis-ci.org/container-storage-interface/spec/jobs/${TRAVIS_BUILD_ID}" *.{proto,go} | ||
# Lang stage: Cxx | ||
- stage: lang | ||
script: make -C lib/cxx | ||
|
||
# Lang stage: Go | ||
- stage: lang | ||
language: go | ||
go: 1.8.3 | ||
go_import_path: github.com/container-storage-interface/spec | ||
install: | ||
- make -C lib/go protoc | ||
- make -C lib/go protoc-gen-go | ||
script: | ||
- make -C lib/go |
This file contains hidden or 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 hidden or 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 |
---|---|---|
@@ -1,8 +1,46 @@ | ||
all: build | ||
|
||
include csi.mk | ||
CSI_SPEC := spec.md | ||
CSI_PROTO := csi.proto | ||
|
||
build: $(CSI_PROTO) $(CSI_GOSRC) | ||
# This is the target for building the temporary CSI protobuf file. | ||
# | ||
# The temporary file is not versioned, and thus will always be | ||
# built on Travis-CI. | ||
$(CSI_PROTO).tmp: $(CSI_SPEC) | ||
cat $? | \ | ||
sed -n -e '/```protobuf$$/,/```$$/ p' | \ | ||
sed -e 's@^```.*$$@////////@g' > $@ | ||
|
||
# This is the target for building the CSI protobuf file. | ||
# | ||
# This target depends on its temp file, which is not versioned. | ||
# Therefore when built on Travis-CI the temp file will always | ||
# be built and trigger this target. On Travis-CI the temp file | ||
# is compared with the real file, and if they differ the build | ||
# will fail. | ||
# | ||
# Locally the temp file is simply copied over the real file. | ||
$(CSI_PROTO): $(CSI_PROTO).tmp | ||
ifeq (true,$(TRAVIS)) | ||
diff "$@" "$?" | ||
else | ||
diff "$@" "$?" > /dev/null 2>&1 || cp -f "$?" "$@" | ||
endif | ||
|
||
build: $(CSI_PROTO) | ||
|
||
# If this is not running on Travis-CI then for sake of convenience | ||
# go ahead and update the language bindings as well. | ||
ifneq (true,$(TRAVIS)) | ||
build: | ||
$(MAKE) -C lib/go | ||
$(MAKE) -C lib/cxx | ||
endif | ||
|
||
clean: | ||
rm -f $(CSI_PROTO) $(CSI_GOSRC) | ||
|
||
clobber: clean | ||
rm -f $(CSI_PROTO) $(CSI_PROTO).tmp | ||
|
||
.PHONY: clean clobber |
This file contains hidden or 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 was deleted.
Oops, something went wrong.
Oops, something went wrong.
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.
Why not build library as well in CI? We need to capture library build error on CI as well, right?
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.
Hi @jieyu,
Because I don't want the default target in the root Makefile to do recursive Make.