forked from micro-ROS/micro-ROS.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcibuild
More file actions
executable file
·23 lines (20 loc) · 974 Bytes
/
cibuild
File metadata and controls
executable file
·23 lines (20 loc) · 974 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env bash
set -e # halt script on error
# Get the list of added files compared to the origin/master (origin/master is the deployed branch)
# New files will not be deployed at the moment of this check so htmlproofer should ignore those links refering them.
ADDED_FILES=$(git diff --name-only --diff-filter=A origin/master)
if grep -q "_docs" <<< $ADDED_FILES; then
ADDITIONS=${ADDITIONS:+$ADDITIONS }micro-ros.github.io//docs
ADDITIONS=${ADDITIONS:+$ADDITIONS }micro-ros.github.io/blob/master/_docs
else if grep -q "_posts" <<< $ADDED_FILES; then
ADDITIONS=${ADDITIONS:+$ADDITIONS,}micro-ros.github.io//blog
fi
fi
IGNORE_HREFS=${IGNORE_HREFS:+$IGNORE_HREFS,}$(ruby -e "puts %w{
vimeo.com
${ADDITIONS}
}.map{|h| \"/#{h}/\"}.join(\",\")"
)
echo "Ignoring urls: " $IGNORE_HREFS
bundle exec jekyll build
bundle exec htmlproofer --check_html --check-favicon --assume-extension --empty-alt-ignore --only-4xx --url-ignore $IGNORE_HREFS $@ ./_site