The start of Spark! Tech Resources
Ruby, gems and bundler are very conservative about upgrades.
We are now using pages-gem
and just-the-docs
as our only gem dependencies and, hopefully, it will upgrade more nicely.
The github pages site will update automatically on every commit to main.
The jekyll config is managed in /_config.prod.yml
as you can see in the GitHub Workflow.
The use of a non-standard file is to support a need for a separate config (in the standard place) for dev.
By far the easiest mechanism to make changes.
- Click on the big green "<> Code" button, click to the 2nd tab (Codespaces), click the "+" sign.
- Once it is done warming up, you should be able to open a terminal and run
./launch.sh
. - However, if you get an error about dependencies, run
bundle update
then run./launch.sh
. - Copy the url to your codespace which will look something like
https://obscure-dollop-qsdadASD.github.dev/
- Open a new browser window or tab and paste the url.
- Before hitting enter, modify it to be
https://obscure-dollop-qsdadASD-4000.app.github.dev/
(NOTE: you are adding-4000.app
kind of in the middle).
You should now be able to hit enter and see your changes.
If anyone has any bright ideas about how to make this a launch configuration I would love to include it.
- Install
docker
orpodman
andmake
. - Find the URI for the repo under the big green "<> Code" button.
git clone
the repo somewhere.- Open the folder in VS Code.
- In a terminal run
make build
ormake build-podman
as appropriate. - run
make run
ormake run-podman
. - You should be able to go to a browser and goto http://localhost:4000 and see the site.
- Make a new branch for your changes
- You should not use a fork, as then the preview automation won't work
- Once you are pretty happy with your code, create a PR from your branch (after you pushed to GitHub) and add
WIP
to the begining of the name of the PR. Go to your PR and you should see a link to preview of the site (it can take awhile). When you think everything is correct, delete theWIP
from the name of the PR and tag some reviewers.
- Hypothesis is that jekyll is not playing well with containers, possible due to the fact that it predates the modern adoption of containers.
- To get around its shortcomings for now, please follow the steps below
- In all of these steps be sure to change
docker
-->podman
if you are using it instead. Make sure you are running docker (or podman) when doing this.
docker rm -f bu-spark
: remove the old image to avoid errorsmake -n run
: outputs what the command would have been if you ranmake run
, which is not working- Copy everything from
buspark
to the end: this is the path which is relative to your computer docker run -it --entrypoint /bin/bash --name < paste copied part here >
: this will run an interative version of the command, allowing us to interact manually with the container- Run a few lines from
./launch.sh
: We will manually run parts of the launch script for codespaces (they work for localhost too)bundle check || bundle install
: install dependenciesbundle exec jekyll build
: build jekyll site which helps us create static HTML and CSS filesbundle exec jekyll serve --host 0.0.0.0 --livereload --baseurl=""
: host the site locally with hot reload
docker rm -f bu-spark
make -n run
docker run -it --entrypoint /bin/bash --name < paste copied part here >
bundle check || bundle install
bundle exec jekyll build
bundle exec jekyll serve --host 0.0.0.0 --livereload --baseurl=""