-
Notifications
You must be signed in to change notification settings - Fork 13
Publishing instructions for CMP standalone site
After you've built and tested the CMP site locally on your own machine, you probably want to publish your changes! We do this in two phases: first, publish to the internal http://prospector server for testing, and then publish to http://congestion.sfcta.org.
- Instructions for publishing Prospector internally are at:
Publishing to http://congestion.sfcta.org
The external CMP site is hosted as a separate Github repository using Github Pages. The basic steps are as follows:
-
Clone and/or pull from https://github.com/sfcta/cmp
git clone git@github.com:sfcta/cmp.git ; cd cmp
-
Switch to
gh-pages
branch:git checkout gh-pages
-
Copy (recursively) the built warehouse/prospector site from your local machine (assuming you're using Git Bash; or just use Windows Explorer):
cp -r ~/my-warehouse-repo/prospector/build/* .
-
Delete lots of extraneous folders that are part of warehouse but aren't part of the CMP site:
rm -rf autolos cmp-v0 safety tnc viz-template walkskims
-
Copy the standalone site HTML to the root index:
cp standalone/index.html .
-
The site is now "allegedly" ready for publishing, but because mistakes often happen, as one final test I always push to a fake site on Surge before going live. Just to be sure. I recommend you do the same!
surge -d test-cmp-site.surge.sh .
-
If it all looks good, great! Add, commit and push! After a minute or so, Github will update the site at http://congestion.sfcta.org
git commit -a -m "latest release comment"
git push # first time use 'git push origin gh-pages'
-
Don't forget to delete your surge test site:
surge teardown test-cmp-site.surge.sh
Seems like a lot of steps, but after you've cloned and pushed once it just boils down to this one script:
cd ~/my-cmp-repo
cp -r ~/my-warehouse-repo/prospector/build/* .
rm -rf autolos cmp-v0 safety tnc viz-template walkskims
cp standalone/index.html .
# test on surge
surge -d my-fake-cmp-site.surge.sh .
# then go live
git commit -a -m "latest release comment"
git push
Get Started
- Back-End Setup
- Setting up your development environment
- Building Prospector locally
- Publishing your changes
Other Useful Links
- Recipes for typical tasks
- Glossary
- Publishing instructions for CMP standalone site
- Deploying a new release GitHub Pages and Prospector
Platform Considerations
Background Information