- Install NPM/Node.js
- Install Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" - Install
python3.7andpip3: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 initin order to intialize yourgcloudenvironment and link to the appropriate project:
gcloud initNOTE: if you don't have read and publish access to the GCS bucket and project, you won't be able to proceed any further.
Coming Soon!
- Navigate to the
sitedirectory
cd site- Install Node dependencies:
npm i- Install
crcmod:
pip3 install -U crcmodThis is a VERY important tool for
gsutil. Withoutcrcmod, Google is not able to verify object integrity. For more details please refer to this doc: CRC32 and Installing crcmod
- Use
claat exportin the /sauce-schools/codelabs directory
- Option 1: Manually move exported file into ../site/codelabs.
- Option 2: change the
idin the markdown file to export to the correct dir. OldModule5_SeleniumJs.mdNew../site/codelabs/Module5_SeleniumJava
After the export, back out and go to the site directory:
cd ..
cd site
- Build the website using
gulp.js. You must specify thecodelabs-dir, otherwise you may not see your modules in the site: (Note that you must commit first)
npx gulp dist --codelabs-dir=codelabs- Test the site locally with
gulp serve:
npx gulp serve:dist- Publish the
viewsdirectory (the frontend stuff) withpublish:staging:views:
npx gulp publish:staging:views --staging-bucket=$GCS_STAGING_BUCKET- Publish the
codelabsdirectory withpublish: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 initdidn't properly run or you don't have access to the GCS_STAGING_BUCKET.- you're running the incorrect version of
python3. Runpython3 --versionto verfiy you're runningPython 3.7.X.