Skip to content

Commit

Permalink
Ensure only href-checker runs on docs only commit (#1693)
Browse files Browse the repository at this point in the history
* Seperates href-checker into `make verify-docs` command.

* Updates Travis script to only run full build on changes to
  non-markdown or docs/ files.

The href-checker still runs via `make verify-docs` for all Travis
builds.
  • Loading branch information
cgmcintyr authored and kibbles-n-bytes committed Feb 21, 2018
1 parent 4ea44c4 commit 7d155e5
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 5 deletions.
20 changes: 19 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,28 @@ stages:
- test
- name: deploy
if: type != pull_request
before_install:
- |
if [[ -z "$TRAVIS_COMMIT_RANGE" ]]; then
# Builds triggered by initial commit of a new branch.
DOCS_ONLY=0
else
DOCS_REGEX='(OWNERS|LICENSE)|(\.md$)|(^docs/)'
[[ -z "$(git diff --name-only $TRAVIS_COMMIT_RANGE | grep -vE $DOCS_REGEX)" ]]
DOCS_ONLY=$?
fi
jobs:
include:
# Test
- script: make verify build build-integration build-e2e test images svcat
- script:
- |
if (( $DOCS_ONLY == 0 )); then
echo "Running verify-docs"
make verify-docs
else
echo "Running full build"
make verify build build-integration build-e2e test images svcat
fi
# Deploy
- stage: deploy
deploy:
Expand Down
10 changes: 6 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@ $(BINDIR)/e2e.test: .init

# Util targets
##############
.PHONY: verify verify-generated verify-client-gen
verify: .init .generate_files verify-generated verify-client-gen verify-vendor
.PHONY: verify verify-generated verify-client-gen verify-docs
verify: .init .generate_files verify-generated verify-client-gen verify-docs verify-vendor
@echo Running gofmt:
@$(DOCKER_CMD) gofmt -l -s $(TOP_TEST_DIRS) $(TOP_SRC_DIRS)>.out 2>&1||true
@[ ! -s .out ] || \
Expand All @@ -204,13 +204,15 @@ verify: .init .generate_files verify-generated verify-client-gen verify-vendor
@[ ! -s .out ] || (cat .out && rm .out && false)
@rm .out
@#
@echo Running href checker$(SKIP_COMMENT):
@$(DOCKER_CMD) verify-links.sh -s .pkg -t $(SKIP_HTTP) .
@echo Running errexit checker:
@$(DOCKER_CMD) build/verify-errexit.sh
@echo Running tag verification:
@$(DOCKER_CMD) build/verify-tags.sh

verify-docs: .init
@echo Running href checker$(SKIP_COMMENT):
@$(DOCKER_CMD) verify-links.sh -s .pkg -t $(SKIP_HTTP) .

verify-generated: .init .generate_files
$(DOCKER_CMD) $(BUILD_DIR)/update-apiserver-gen.sh --verify-only

Expand Down

0 comments on commit 7d155e5

Please sign in to comment.