Skip to content

Latest commit

 

History

History
81 lines (70 loc) · 2.6 KB

File metadata and controls

81 lines (70 loc) · 2.6 KB

Sauce School Publishing Guide

Prerequisites

Mac Users:

  • Install NPM/Node.js
  • Install Homebrew
    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
  • Install python3.7 and pip3:
    brew install python@3.7 && /
    echo 'export PATH="/usr/local/opt/python@3.7/bin:$PATH"' >> ~/.zshrc && /
    export LDFLAGS="-L/usr/local/opt/python@3.7/lib"
  • Install gsutil, Google Cloud Storage's CLI utility:
curl https://sdk.cloud.google.com | bash
  • Restart your shell:
exec -l $SHELL
  • Run gcloud init in order to intialize your gcloud environment and link to the appropriate project:
gcloud init

NOTE: if you don't have read and publish access to the GCS bucket and project, you won't be able to proceed any further.

Windows Users:

Coming Soon!

Publishing the Site

  1. Navigate to the site directory
cd site
  1. Install Node dependencies:
npm i
  1. Install crcmod:
pip3 install -U crcmod

This is a VERY important tool for gsutil. Without crcmod, Google is not able to verify object integrity. For more details please refer to this doc: CRC32 and Installing crcmod

  1. Use claat export in the /sauce-schools/codelabs directory
  • Option 1: Manually move exported file into ../site/codelabs.
  • Option 2: change the id in the markdown file to export to the correct dir. Old Module5_SeleniumJs.md New ../site/codelabs/Module5_SeleniumJava

After the export, back out and go to the site directory:

cd ..
cd site
  1. Build the website using gulp.js. You must specify the codelabs-dir, otherwise you may not see your modules in the site: (Note that you must commit first)
npx gulp dist --codelabs-dir=codelabs
  1. Test the site locally with gulp serve:
npx gulp serve:dist
  1. Publish the views directory (the frontend stuff) with publish:staging:views:
npx gulp publish:staging:views --staging-bucket=$GCS_STAGING_BUCKET
  1. Publish the codelabs directory with publish:staging:codelabs:
npx gulp publish:staging:codelabs --staging-bucket=$GCS_STAGING_BUCKET

⚠️ if you receive errors during this fnal step, it's most likely due to:

  • gsutil init didn't properly run or you don't have access to the GCS_STAGING_BUCKET.
  • you're running the incorrect version of python3. Run python3 --version to verfiy you're running Python 3.7.X.