Skip to content

Commit

Permalink
ci(check links) check for broken links (Kong#1342)
Browse files Browse the repository at this point in the history
* chore(ci) setup a link-checker to run via travis-ci

* fix(ci) debug why this doesn't work on travis-ci

* fix(ci) adjust travis-ci permissions

* chore(ci) travis-c permissions

* chore(dependency) add the broken link checker dependency

* merge master

* add broken link checker

* Add check-link test to README

* remove docker-test

* Delete .env

* update travis.yml

* update travis.yml

* remove check-link command
  • Loading branch information
hutchic authored and levfishbluefish committed Sep 17, 2019
1 parent 91dbbe2 commit 87b688a
Show file tree
Hide file tree
Showing 8 changed files with 948 additions and 252 deletions.
26 changes: 7 additions & 19 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,12 @@
language: node_js
node_js:
- "8"

dist: xenial
sudo: false

language: generic
notifications:
email: false

cache:
bundler: true
yarn: true

before_install:
- rvm install 2.3.3
- npm install -g yarn
env:
- NODE_OPTIONS=--max_old_space_size=8192
install:
- bundle install
- yarn
before_script:
- npm test
script:
- gulp build
- docker-compose build
- touch Gemfile.lock
- mkdir node_modules
- chmod -R 777 .
11 changes: 3 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
# This should mirror the jekyll version in the Gemfile
FROM jekyll/jekyll:3.8.6

WORKDIR /srv/jekyll

RUN apk add --update autoconf automake file build-base nasm musl libpng-dev zlib-dev

COPY entrypoint.sh /entrypoint.sh

RUN npm install -g yarn && npm install -g gulp
WORKDIR /srv/jekyll
COPY Makefile /srv/jekyll
RUN make install-prerequisites

RUN chmod -R 777 /usr/lib/node_modules \
&& chmod 777 /entrypoint.sh \
&& usermod -a -G root jekyll

ENTRYPOINT ["/entrypoint.sh"]

EXPOSE 3000 3001
26 changes: 25 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,2 +1,26 @@
install-prerequisites:
npm install -g yarn
npm install -g gulp

install:
npm install
bundle install
yarn --ignore-engines
yarn upgrade

run: install
gulp

develop:
docker-compose up --build
docker-compose up

test: install
npm test

docker-test:
COMMAND="make test" docker-compose up

check-links:
docker-compose up -d
while [ `curl -s -o /dev/null -w ''%{http_code}'' localhost:3000` != 200 ]; do echo "waiting"; docker-compose logs --tail=2 jekyll; sleep 20; done
docker-compose exec jekyll yarn blc http://localhost:3000 -efr --exclude careers --exclude hub
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ This repository is the source code for [Kong](https://github.com/Kong/kong)'s do
make develop
```

### Testing Links With Docker

>
```
make check-links
```

## Develop Locally Without Docker

### Prerequisites
Expand Down Expand Up @@ -46,8 +53,8 @@ npm run deploy

## Search

We are using Algolia [docsearch](https://www.algolia.com/docsearch) for our CE
documentation search. The algolia index is maintained by Algolia through their
We are using Algolia [docsearch](https://www.algolia.com/docsearch) for our
documentation search. The algolia index for Kong is maintained by Algolia through their
docsearch service. Their [scraper](https://github.com/algolia/docsearch-scraper)
runs every 24 hours. The config used by the scraper is open source for
docs.konghq.com and can be found [here](https://github.com/algolia/docsearch-configs/blob/master/configs/getkong.json).
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: '3.4'
services:
jekyll:
build: .
user: jekyll
command: ${COMMAND:-make run}
volumes:
- .:/srv/jekyll
ports:
Expand Down
2 changes: 0 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/bin/bash

npm install -g yarn
npm install -g gulp
bundle install
yarn --ignore-engines
gulp clean
Expand Down
Loading

0 comments on commit 87b688a

Please sign in to comment.