Skip to content

Prep for agency collaboration #61

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@ _site
vendor
.bundle
.DS_Store
_data/catalog/destinations.yml
_data/catalog/sources.yml
.env
.env
17 changes: 15 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ docs:
echo "Running segment docs at http://localhost:4000/docsv2/" && \
docker run -p 4000:80 segment-docs:latest


.PHONY: build
build:
echo "Building site for ${JEKYLL_ENV}"
Expand All @@ -21,6 +20,17 @@ build:
make catalog && \
JEKYLL_ENV=${JEKYLL_ENV} bundle exec jekyll build

.PHONY: docker-serve
make docker-serve:
echo "Building site for ${JEKYLL_ENV}"
docker run -it \
--volume="$(PWD):/srv/jekyll" \
jekyll/jekyll \
bundle package && \
make clean && \
make deps && \
JEKYLL_ENV=${JEKYLL_ENV} bundle exec jekyll serve --trace --incremental -H 0.0.0.0 -V

# Helper commands...

.PHONY: nav
Expand Down Expand Up @@ -54,8 +64,11 @@ deps:
.PHONY: dev
dev:
make clean && \
bundle exec jekyll serve --incremental -H 0.0.0.0 -V
bundle exec jekyll serve --trace --incremental -H 0.0.0.0 -V

.PHONE: trace
trace:
bundle exec jekyll build --trace

# Docker-based commands...

Expand Down
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@

You can make a limited range of edits from the Github site, but this system works best if you clone it locally so you can run test builds.

# Setup instructions
# Local development with docker, without platform-api
Run `make docker-serve`

# Local development with ruby on local machine
1. First, clone the repo to your local machine.
2. From the command-line, run `make env` to run the Ruby bundler and install the stuff you need to run the repo.
**Tip**: If you ever need to do this again, you can run `make deps`.
Expand All @@ -16,8 +19,9 @@ Use the local build process to preview local changes. If you're doing a release,

- `docs`: locally builds the docs and serves the static content via a Docker container running nginx
- `build`: Builds the site docs. Used by CI to publish the docs to staging and production
- `docker-serve`: Uses docker to build the docs locally, without needing to refresh the catalog from the platform-api
- `nav`: Rebuilds the entire nav datafile based on the current doc structure. This is destructive and should not be used unless absolutely necessary.
- `catalog`: Pulls in the latest catalog data from the Platform API and saves it in the respective data files. Requires an API key saved in .env
- `catalog`: Pulls in the latest catalog data from the Platform API and saves it in the respective data files. Requires an API key to be passed in env via PLATFORM_API_TOKEN
- `env`: for when you're first getting set up: installs bundler, and installs the deps for the repo.
- `seed`: copies all example data files out of the `_templates` directory and puts them in the `_data` directory. Useful if you don't have a way to setup an API key.
- `clean`: runs `jekyll clean` locally
Expand Down
Loading