Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Develop with Docker and build with 2.0
This adds support for developing locally with docker-compose. Readme files have been update and references to Vagrant removed. Initial support for building and testing using CircleCI 2.0 is included and 1.0 config has been removed.
- Loading branch information
Showing
14 changed files
with
119 additions
and
193 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
@@ -0,0 +1,57 @@ | ||
version: 2 | ||
jobs: | ||
build: | ||
docker: | ||
- image: circleci/ruby:2.3.3 | ||
working_directory: ~/circleci-docs | ||
environment: | ||
- JEKYLL_ENV=production | ||
- NOKOGIRI_USE_SYSTEM_LIBRARIES=true | ||
- JOB_RESULTS_PATH=run-results | ||
steps: | ||
- checkout | ||
- restore_cache: | ||
key: circleci-docs-{{ .Branch }}-{{ checksum "Gemfile.lock" }} | ||
- run: | ||
name: Install essential packages for awscli | ||
command: sudo apt-get update && sudo apt-get install python-dev | ||
- run: | ||
name: Install awscli | ||
command: wget https://bootstrap.pypa.io/get-pip.py && sudo python get-pip.py && pip install --upgrade --user awscli | ||
- run: | ||
name: Install Ruby dependencies | ||
command: bundle check --path=vendor/bundle || bundle install --path=vendor/bundle --jobs=4 --retry=3 | ||
- save_cache: | ||
key: circleci-docs-{{ .Branch }}-{{ checksum "Gemfile.lock" }} | ||
paths: | ||
- "vendor/bundle" | ||
- run: | ||
name: Create results directory | ||
command: mkdir -p $JOB_RESULTS_PATH | ||
- run: | ||
name: Expose version files | ||
command: | | ||
# cp jekyll/_data/trusty/versions.json jekyll/environments/trusty.json | ||
cp jekyll/_data/trusty/versions-ubuntu-14_04-XXL.json jekyll/environments/ubuntu-14.04-XXL.json | ||
cp jekyll/_data/trusty/versions-ubuntu-14.04-XL.json jekyll/environments/ubuntu-14.04-XL.json | ||
cp jekyll/_data/trusty/versions-ubuntu-14.04-XL.json jekyll/environments/ubuntu-14.04-XXL-upstart.json | ||
- run: | ||
name: Build the Jekyll site | ||
command: bundle exec jekyll build --config jekyll/_config.yml,jekyll/_config_production.yml --source jekyll --destination jekyll/_site/docs/ 2>&1 | tee $JOB_RESULTS_PATH/build-results.txt | ||
- run: | ||
name: Test with HTMLproofer | ||
command: bundle exec htmlproofer jekyll/_site --allow-hash-href --check-favicon --check-html --disable-external --empty-alt-ignore | tee $JOB_RESULTS_PATH/htmlproofer-results.txt | ||
- store_artifacts: | ||
path: jekyll/_site/docs/ | ||
destination: circleci-docs | ||
- store_artifacts: | ||
path: run-results/ | ||
destination: run-results | ||
- deploy: | ||
name: Deploy to S3 if tests pass and branch is Master | ||
command: | | ||
if [ "${CIRCLE_BRANCH}" == "master" ]; then | ||
aws s3 sync jekyll/_site/docs s3://circle-production-static-site/docs/ --delete | ||
else | ||
echo "Not master branch so not deploying" | ||
fi |
This file contains 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,4 +1,6 @@ | ||
_site/ | ||
run-results/ | ||
jekyll/environments/ | ||
.sass-cache/ | ||
.jekyll-metadata | ||
.vagrant/ | ||
|
This file contains 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 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,6 +1,6 @@ | ||
source 'https://rubygems.org' | ||
|
||
ruby '2.3.1' | ||
ruby '2.3.3' | ||
|
||
gem 'jekyll' | ||
gem 'html-proofer' | ||
gem 'jekyll', "~> 3.4.0" | ||
gem 'html-proofer', "~> 3.6.0" |
This file contains 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.
This file was deleted.
Oops, something went wrong.
This file contains 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 |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# 1. Local Development with Docker (recommended) | ||
|
||
The recommended way to work on the CircleCI docs locally is to use Docker. | ||
|
||
1. Install Docker for you platform: <https://docs.docker.com/engine/installation/> | ||
2. Clone the CircleCI docs repo: `git clone https://github.com/circleci/circleci-docs.git` | ||
3. `cd` into the directory where you cloned the docs | ||
4. run `docker-compose up` | ||
5. The docs site will now be running on <http://localhost:4000/docs/> | ||
|
||
**Note:** If you want to submit a pull request to update the docs, you'll need to [make a fork](https://github.com/circleci/circleci-docs#fork-destination-box) of this repo and clone your version in step 2 above. Then when you push your changes to your fork you can submit a pull request to us. | ||
|
||
## Editing and Contributing | ||
|
||
Now that you have a working local environment, please follow our [Contributing Guide](CONTRIBUTING.md) to make and submit changes. | ||
|
||
# 2. Local Development with Ruby and Bundler (alternative to Docker) | ||
|
||
If you already have a stable Ruby environment (currently Ruby 2.3.3) and feel comfortable installing dependencies, install Jekyll by following [this guide](https://jekyllrb.com/docs/installation/). | ||
|
||
Check out the [Gemfile](Gemfile) for the Ruby version we're currently using. We recommend [RVM](https://rvm.io/) for managing multiple Ruby versions. | ||
|
||
We also use a gem called [HTMLProofer](https://github.com/gjtorikian/html-proofer) to test links, images, and HTML. The docs site will need a passing build to be deployed, so use HTMLProofer to test everything before you push changes to GitHub. | ||
|
||
You're welcome to use [Bundler](http://bundler.io/) to install these gems. | ||
|
||
## First Run | ||
|
||
To get a local copy of our docs, run the following commands: | ||
|
||
```bash | ||
git clone https://github.com/circleci/circleci-docs.git | ||
cd circleci-docs/jekyll | ||
jekyll serve -Iw | ||
``` | ||
|
||
Jekyll will build the site and start a web server, which can be viewed in your browser at <http://localhost:4000/docs/>. `-w` tells Jekyll to watch for changes and rebuild, while `-I` enables an incremental rebuild to keep things efficient. | ||
|
||
For more info on how to use Jekyll, check out [their docs](https://jekyllrb.com/docs/usage/). | ||
|
||
## Editing and Contributing | ||
|
||
Now that you have a working local environment, please follow our [Contributing Guide](CONTRIBUTING.md) to make and submit changes. |
This file contains 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.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains 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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
jekyll: | ||
image: jekyll/jekyll:3.4 | ||
command: jekyll serve --watch --incremental | ||
ports: | ||
- 4000:4000 | ||
volumes: | ||
- ./jekyll:/srv/jekyll |