Skip to content

Commit

Permalink
Update make commands, configs, and build files to reflect new naming
Browse files Browse the repository at this point in the history
- "managed" -> "cockroachcloud"
- "standard" -> "cockroachdb"

This should work for the PR-based TeamCity configs for Docs,
GitHub CI and Nightly. However, I'm not clear on how things work
post-merge now. The TC config for that doesn't reference Netlify,
where our docs are now hosted. Have to investigate further to
understand what, if anything, needs to change for building the live
site.
  • Loading branch information
jseldess authored and maddyblue committed Oct 14, 2019
1 parent 8860a0d commit ab2ce55
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 35 deletions.
12 changes: 6 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Once you're ready to contribute:
6. Use Jekyll to [build a version of the site locally](#build-and-test-the-docs-locally) so you can view your changes in a browser:
```
make standard
make cockroachdb
```
7. [Push your local branch to your remote fork](https://help.github.com/articles/pushing-to-a-remote/).
Expand Down Expand Up @@ -105,11 +105,11 @@ Once you've installed Jekyll and have a local clone of the docs repository, you
1. From the root directory of your clone, :
- To build the CockroachDB docs, run `make standard`.
- To build the CockroachDB docs, run `make cockroachdb`.
- To build the Managed CockroachDB docs, run `make managed`.
- To build the CockroachCloud docs, run `make cockroachcloud`.
2. Point your browser to `http://127.0.0.1:4000/docs/` for CockroachDB docs or `http://127.0.0.1:40001` for Managed CockroachDB docs, and manually check your changes.
2. Point your browser to `http://127.0.0.1:4000/docs/` for CockroachDB docs or `http://127.0.0.1:40001` for CockroachCloud docs, and manually check your changes.
- If the page you want to test isn't listed in the sidebar, just point to it directly, for example, `http://127.0.0.1:4000/docs/new-page.html`.
Expand All @@ -124,7 +124,7 @@ Once you've installed Jekyll and have a local clone of the docs repository, you
### Pages
We provide documentation for each major version of CockroachDB. The pages for each version are found in a directory named for the version. For example, docs for CockroachDB v2.0 are in the `v2.0` directory, whereas docs for CockroachDB v2.1 are in the `v2.1` directory.
We provide documentation for each major version of CockroachDB. The pages for each version are found in a directory named for the version. For example, docs for CockroachDB v19.1 are in the `v19.1` directory, whereas docs for CockroachDB v19.2 are in the `v19.2` directory.
Within each version directory, each page must be an `.md` file written in the redcarpet dialect of Markdown. File names should be lowercase with a dash between words, and should be brief but descriptive.
Expand Down Expand Up @@ -152,7 +152,7 @@ Field | Description | Default
------|-------------|--------
`toc` | Adds an auto-generated table of contents to the right of the page body (on standard screens) or at the top of the page (on smaller screens). | `true`
`toc_not_nested` | Limits a page's TOC to h2 headers only. | `false`
`build_for` | Whether to include a page only in CockroachDB docs (`[standard]`), only in Managed CockroachDB docs (`[managed]`), or in both outputs (`[standard, managed]`). | `[standard]`
`build_for` | Whether to include a page only in CockroachDB docs (`[cockroachdb]`), only in CockroachCloud docs (`[cockroachcloud]`), or in both outputs (`[cockroachdb, cockroachcloud]`). | `[cockroachdb]`
`allowed_hashes` | Specifies a list of allowed hashes that do not correspond to a section heading on the page. | Nothing
`asciicast` | Adds code required to play asciicasts on the page. See [Asciicasts](#asciicasts) for more details. | `false`
`feedback` | Adds "Yes/No" feedback buttons at the bottom of the page. See [Feedback Widget](#feedback-widget) for more details. | `true`
Expand Down
25 changes: 14 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,22 +42,25 @@ extra-config := $(if $(JEKYLLCONFIG),$(comma)$(JEKYLLCONFIG))

jekyll-action := build

.PHONY: standard-build
standard-build: bootstrap
bundle exec jekyll $(jekyll-action) --incremental --config _config_base.yml,_config_standard.yml$(extra-config) $(JEKYLLFLAGS)
.PHONY: cockroachdb-build
cockroachdb-build: bootstrap
bundle exec jekyll $(jekyll-action) --incremental --config _config_base.yml,_config_cockroachdb.yml$(extra-config) $(JEKYLLFLAGS)

.PHONY: cockroachdb
cockroachdb: jekyll-action := serve --port 4000
cockroachdb: bootstrap
bundle exec jekyll $(jekyll-action) --incremental --config _config_base.yml,_config_cockroachdb.yml,_config_cockroachdb_local.yml$(extra-config) $(JEKYLLFLAGS)

.PHONY: standard
standard: jekyll-action := serve --port 4000
standard: bootstrap
bundle exec jekyll $(jekyll-action) --incremental --config _config_base.yml,_config_standard.yml,_config_standard_local.yml$(extra-config) $(JEKYLLFLAGS)
standard: cockroachdb

.PHONY: managed-build
managed-build: bootstrap
.PHONY: cockroachcloud-build
cockroachcloud-build: bootstrap
bundle exec jekyll $(jekyll-action) --incremental --config _config_base.yml,_config_cockroachcloud.yml$(extra-config) $(JEKYLLFLAGS)

.PHONY: managed
managed: jekyll-action := serve --port 4001
managed: managed-build
.PHONY: cockroachcloud
cockroachcloud: jekyll-action := serve --port 4001
cockroachcloud: cockroachcloud-build

.PHONY: test
test: bootstrap
Expand Down
File renamed without changes.
File renamed without changes.
16 changes: 8 additions & 8 deletions _plugins/versions.rb
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# This plugin manages docs versioning based on the following conventions. Docs
# for each non-patch release of CockroachDB--that is, each release of
# CockroachDB that has its own release branch in the cockroachdb/cockroach
# repository--are expected to be stored in in a top-level directory named after
# that version. For example, docs for CockroachDB v1.1 are expected to be stored
# in a directory named `v1.1`. Docs which do not logically belong to one
# repository--are expected to be stored in a top-level directory named after
# that version. For example, docs for CockroachDB v19.1 are expected to be stored
# in a directory named `v19.1`. Docs which do not logically belong to one
# version, like release notes, are instead stored at the root of the repository.
#
# The name mappings under the `version` key in config.yml are used to build
# additional aliased versions. (At the time of writing, we named a `stable` and
# `edge` version.) These are implemented as directory symlinks. For example, if
# `stable: v1.0` is specified, a symlink `stable -> v1.0` will be written to the
# additional aliased versions (currently a `stable` and `dev` version).
# These are implemented as directory symlinks. For example, if `stable: v19.1`
# is specified, a symlink `stable -> v19.1` will be written to the
# build directory. The `stable` mapping is special and must exist, as
# `docs/FOO.html` will be automatically redirected to `docs/stable/FOO.html` for
# every FOO.md in the stable directory. Other name mappings are optional and can
Expand All @@ -23,8 +23,8 @@
# `release_info` — a hash with information about the latest release
# `versions` — a list of versions in which this page exists
# This list powers the version switcher. Each entry in the list has a
# human-friendly `name`, like "v1.0 (Stable)", a raw `version`, like
# "v1.0", and a `url` to the page in that version.
# human-friendly `name`, like "v19.1 (Stable)", a raw `version`, like
# "v19.1", and a `url` to the page in that version.
# `sidebar_data` — the name of the file containing the page's sidebar data
# Non-versioned pages use the `STABLE_VERSION`'s sidebar data.
# `canonical` — the relative URL of the stable version of the page, if any
Expand Down
2 changes: 1 addition & 1 deletion ci/publish
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ run() {
touch "$root/../bootstrap"
touch "$root/../vendor"

run make standard-build managed-build
run make cockroachdb-build cockroachcloud-build
18 changes: 9 additions & 9 deletions ci/pull-request
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@ baseurl=$BUILD_VCS_NUMBER
touch bootstrap
touch vendor

# Step 1. Build the standard docs.
cat > _config_prod.yml <<EOF
# Step 1. Build the CockroachDB docs.
cat > _config_prod_cockroachdb.yml <<EOF
url: http://cockroach-docs-review.s3-website-us-east-1.amazonaws.com
baseurl: /$baseurl
destination: _site/$baseurl
EOF
run make standard-build JEKYLLCONFIG=_config_prod.yml
run make cockroachdb-build JEKYLLCONFIG=_config_prod_cockroachdb.yml

# Step 2. Build the managed service docs.
cat > _config_prod_managed.yml <<EOF
# Step 2. Build the CockroachCloud docs.
cat > _config_prod_cockroachcloud.yml <<EOF
url: http://cockroach-docs-review.s3-website-us-east-1.amazonaws.com
baseurl: /$baseurl/managed
destination: _site/$baseurl/managed
baseurl: /$baseurl/cockroachcloud
destination: _site/$baseurl/cockroachcloud
EOF
run make managed-build JEKYLLCONFIG=_config_prod_managed.yml
run make cockroachcloud-build JEKYLLCONFIG=_config_prod_cockroachcloud.yml

# Step 3. Upload the docs to S3.
run aws s3 cp --recursive --quiet --region=us-east-1 ./_site s3://cockroach-docs-review
Expand Down Expand Up @@ -78,7 +78,7 @@ curl \
"https://api.github.com/repos/cockroachdb/docs/issues/$BUILD_BRANCH/comments"

# Step 5. Run vale, but don't fail the build if it reports errors.
run vale --no-wrap v2.1 || true
run vale --no-wrap v19.2 || true

# Step 6. Run htmltest, but skip checking external links to speed things up.
run htmltest --skip-external

0 comments on commit ab2ce55

Please sign in to comment.