From 5bb37dff49a726c64b333c689bbc11960aaf444d Mon Sep 17 00:00:00 2001 From: Jerome Petazzoni Date: Fri, 18 May 2018 09:38:30 -0500 Subject: [PATCH] Parametrize git repo and slides URLs We have two extra variables in the slides: @@GITREPO@@ (current value: github.com/jpetazzo/container.training) @@SLIDES@@ (current value: http://container.training/) These variables are set with gitrepo and slides in the YAML files. (Just like the chat variable.) Supercedes #256 --- slides/common/about-slides.md | 6 +++--- slides/common/prereqs.md | 6 +++--- slides/common/sampleapp.md | 10 +++++----- slides/common/title.md | 4 ++-- slides/intro-fullday.yml | 4 ++++ slides/intro-selfpaced.yml | 4 ++++ slides/intro/intro.md | 2 +- slides/kube-fullday.yml | 4 ++++ slides/kube-halfday.yml | 4 ++++ slides/kube-selfpaced.yml | 4 ++++ slides/kube/intro.md | 2 +- slides/kube/setup-k8s.md | 2 +- slides/markmaker.py | 2 ++ slides/swarm-fullday.yml | 4 ++++ slides/swarm-halfday.yml | 4 ++++ slides/swarm-selfpaced.yml | 4 ++++ slides/swarm-video.yml | 4 ++++ slides/swarm/encryptionatrest.md | 2 +- slides/swarm/intro.md | 2 +- slides/swarm/logging.md | 4 ++-- slides/swarm/machine.md | 2 +- slides/swarm/operatingswarm.md | 2 +- 22 files changed, 60 insertions(+), 22 deletions(-) diff --git a/slides/common/about-slides.md b/slides/common/about-slides.md index 5856fb34..d5ee02a8 100644 --- a/slides/common/about-slides.md +++ b/slides/common/about-slides.md @@ -2,7 +2,7 @@ - All the content is available in a public GitHub repository: - https://github.com/jpetazzo/container.training + https://@@GITREPO@@ - You can get updated "builds" of the slides there: @@ -10,7 +10,7 @@ @@ -23,7 +23,7 @@ diff --git a/slides/common/prereqs.md b/slides/common/prereqs.md index 9eec2b3c..5bf1bc57 100644 --- a/slides/common/prereqs.md +++ b/slides/common/prereqs.md @@ -48,11 +48,11 @@ Misattributed to Benjamin Franklin - This is the stuff you're supposed to do! -- Go to [container.training](http://container.training/) to view these slides +- Go to @@SLIDES@@ to view these slides - Join the chat room: @@CHAT@@ - + ] @@ -222,7 +222,7 @@ If anything goes wrong — ask for help! Small setup effort; small cost; flexible environments - Create a bunch of clusters for you and your friends - ([instructions](https://github.com/jpetazzo/container.training/tree/master/prepare-vms)) + ([instructions](https://@@GITREPO@@/tree/master/prepare-vms)) Bigger setup effort; ideal for group training diff --git a/slides/common/sampleapp.md b/slides/common/sampleapp.md index a6cc03af..0e76edef 100644 --- a/slides/common/sampleapp.md +++ b/slides/common/sampleapp.md @@ -16,7 +16,7 @@ fi - Clone the repository on `node1`: ```bash - git clone git://github.com/jpetazzo/container.training + git clone git://@@GITREPO@@ ``` ] @@ -56,16 +56,16 @@ and displays aggregated logs. ## More detail on our sample application - Visit the GitHub repository with all the materials of this workshop: -
https://github.com/jpetazzo/container.training +
https://@@GITREPO@@ - The application is in the [dockercoins]( - https://github.com/jpetazzo/container.training/tree/master/dockercoins) + https://@@GITREPO@@/tree/master/dockercoins) subdirectory - Let's look at the general layout of the source code: there is a Compose file [docker-compose.yml]( - https://github.com/jpetazzo/container.training/blob/master/dockercoins/docker-compose.yml) ... + https://@@GITREPO@@/blob/master/dockercoins/docker-compose.yml) ... ... and 4 other services, each in its own directory: @@ -124,7 +124,7 @@ def hash_bytes(data): ``` (Full source code available [here]( -https://github.com/jpetazzo/container.training/blob/8279a3bce9398f7c1a53bdd95187c53eda4e6435/dockercoins/worker/worker.py#L17 +https://@@GITREPO@@/blob/8279a3bce9398f7c1a53bdd95187c53eda4e6435/dockercoins/worker/worker.py#L17 )) --- diff --git a/slides/common/title.md b/slides/common/title.md index 1d7755d4..007e01a7 100644 --- a/slides/common/title.md +++ b/slides/common/title.md @@ -17,5 +17,5 @@ class: title, in-person *Don't stream videos or download big files during the workshop.*
*Thank you!* -**Slides: http://container.training/** -] \ No newline at end of file +**Slides: @@SLIDES@@** +] diff --git a/slides/intro-fullday.yml b/slides/intro-fullday.yml index 80e365e9..8aebbc93 100644 --- a/slides/intro-fullday.yml +++ b/slides/intro-fullday.yml @@ -6,6 +6,10 @@ title: | chat: "[Slack](https://dockercommunity.slack.com/messages/C7GKACWDV)" #chat: "[Gitter](https://gitter.im/jpetazzo/workshop-yyyymmdd-city)" +gitrepo: github.com/jpetazzo/container.training + +slides: http://container.training/ + exclude: - self-paced diff --git a/slides/intro-selfpaced.yml b/slides/intro-selfpaced.yml index 883184f5..5637cdc8 100644 --- a/slides/intro-selfpaced.yml +++ b/slides/intro-selfpaced.yml @@ -6,6 +6,10 @@ title: | chat: "[Slack](https://dockercommunity.slack.com/messages/C7GKACWDV)" #chat: "[Gitter](https://gitter.im/jpetazzo/workshop-yyyymmdd-city)" +gitrepo: github.com/jpetazzo/container.training + +slides: http://container.training/ + exclude: - in-person diff --git a/slides/intro/intro.md b/slides/intro/intro.md index 16a4e0c8..b6c1ee76 100644 --- a/slides/intro/intro.md +++ b/slides/intro/intro.md @@ -2,7 +2,7 @@ - This was initially written to support in-person, instructor-led workshops and tutorials -- These materials are maintained by [Jérôme Petazzoni](https://twitter.com/jpetazzo) and [multiple contributors](https://github.com/jpetazzo/container.training/graphs/contributors) +- These materials are maintained by [Jérôme Petazzoni](https://twitter.com/jpetazzo) and [multiple contributors](https://@@GITREPO@@/graphs/contributors) - You can also follow along on your own, at your own pace diff --git a/slides/kube-fullday.yml b/slides/kube-fullday.yml index 2ba0d8d9..92d76fab 100644 --- a/slides/kube-fullday.yml +++ b/slides/kube-fullday.yml @@ -6,6 +6,10 @@ title: | #chat: "[Gitter](https://gitter.im/jpetazzo/workshop-yyyymmdd-city)" chat: "In person!" +gitrepo: github.com/jpetazzo/container.training + +slides: http://container.training/ + exclude: - self-paced diff --git a/slides/kube-halfday.yml b/slides/kube-halfday.yml index 13e9b1fc..1741762f 100644 --- a/slides/kube-halfday.yml +++ b/slides/kube-halfday.yml @@ -5,6 +5,10 @@ title: | #chat: "[Gitter](https://gitter.im/jpetazzo/training-20180413-paris)" chat: "In person!" +gitrepo: github.com/jpetazzo/container.training + +slides: http://container.training/ + exclude: - self-paced diff --git a/slides/kube-selfpaced.yml b/slides/kube-selfpaced.yml index 9989a7c0..88b23c5e 100644 --- a/slides/kube-selfpaced.yml +++ b/slides/kube-selfpaced.yml @@ -5,6 +5,10 @@ title: | chat: "[Slack](https://dockercommunity.slack.com/messages/C7GKACWDV)" #chat: "[Gitter](https://gitter.im/jpetazzo/workshop-yyyymmdd-city)" +gitrepo: github.com/jpetazzo/container.training + +slides: http://container.training/ + exclude: - in-person diff --git a/slides/kube/intro.md b/slides/kube/intro.md index a0090371..451177dc 100644 --- a/slides/kube/intro.md +++ b/slides/kube/intro.md @@ -3,7 +3,7 @@ - This was initially written by [Jérôme Petazzoni](https://twitter.com/jpetazzo) to support in-person, instructor-led workshops and tutorials -- Credit is also due to [multiple contributors](https://github.com/jpetazzo/container.training/graphs/contributors) — thank you! +- Credit is also due to [multiple contributors](https://@@GITREPO@@/graphs/contributors) — thank you! - You can also follow along on your own, at your own pace diff --git a/slides/kube/setup-k8s.md b/slides/kube/setup-k8s.md index c397a393..b53e94a0 100644 --- a/slides/kube/setup-k8s.md +++ b/slides/kube/setup-k8s.md @@ -20,7 +20,7 @@ 6. Copy the configuration file generated by `kubeadm init` -- Check the [prepare VMs README](https://github.com/jpetazzo/container.training/blob/master/prepare-vms/README.md) for more details +- Check the [prepare VMs README](https://@@GITREPO@@/blob/master/prepare-vms/README.md) for more details --- diff --git a/slides/markmaker.py b/slides/markmaker.py index a29ba38a..a01fbe02 100755 --- a/slides/markmaker.py +++ b/slides/markmaker.py @@ -114,6 +114,8 @@ def generatefromyaml(manifest, filename): html = html.replace("@@MARKDOWN@@", markdown) html = html.replace("@@EXCLUDE@@", exclude) html = html.replace("@@CHAT@@", manifest["chat"]) + html = html.replace("@@GITREPO@@", manifest["gitrepo"]) + html = html.replace("@@SLIDES@@", manifest["slides"]) html = html.replace("@@TITLE@@", manifest["title"].replace("\n", " ")) return html diff --git a/slides/swarm-fullday.yml b/slides/swarm-fullday.yml index 2d273bd0..4ba793b6 100644 --- a/slides/swarm-fullday.yml +++ b/slides/swarm-fullday.yml @@ -5,6 +5,10 @@ title: | chat: "[Slack](https://dockercommunity.slack.com/messages/C7GKACWDV)" #chat: "[Gitter](https://gitter.im/jpetazzo/workshop-yyyymmdd-city)" +gitrepo: github.com/jpetazzo/container.training + +slides: http://container.training/ + exclude: - self-paced - snap diff --git a/slides/swarm-halfday.yml b/slides/swarm-halfday.yml index c1c23575..39acc72b 100644 --- a/slides/swarm-halfday.yml +++ b/slides/swarm-halfday.yml @@ -5,6 +5,10 @@ title: | chat: "[Slack](https://dockercommunity.slack.com/messages/C7GKACWDV)" #chat: "[Gitter](https://gitter.im/jpetazzo/workshop-yyyymmdd-city)" +gitrepo: github.com/jpetazzo/container.training + +slides: http://container.training/ + exclude: - self-paced - snap diff --git a/slides/swarm-selfpaced.yml b/slides/swarm-selfpaced.yml index f78de79c..89b6146f 100644 --- a/slides/swarm-selfpaced.yml +++ b/slides/swarm-selfpaced.yml @@ -4,6 +4,10 @@ title: | chat: "[Slack](https://dockercommunity.slack.com/messages/C7GKACWDV)" +gitrepo: github.com/jpetazzo/container.training + +slides: http://container.training/ + exclude: - in-person - btp-auto diff --git a/slides/swarm-video.yml b/slides/swarm-video.yml index 47deb73c..3274d60a 100644 --- a/slides/swarm-video.yml +++ b/slides/swarm-video.yml @@ -4,6 +4,10 @@ title: | chat: "[Slack](https://dockercommunity.slack.com/messages/C7GKACWDV)" +gitrepo: github.com/jpetazzo/container.training + +slides: http://container.training/ + exclude: - in-person - btp-auto diff --git a/slides/swarm/encryptionatrest.md b/slides/swarm/encryptionatrest.md index 7caf20c6..115b228c 100644 --- a/slides/swarm/encryptionatrest.md +++ b/slides/swarm/encryptionatrest.md @@ -49,7 +49,7 @@ This will display the unlock key. Copy-paste it somewhere safe. ] Note: if you are doing the workshop on your own, using nodes -that you [provisioned yourself](https://github.com/jpetazzo/container.training/tree/master/prepare-machine) or with [Play-With-Docker](http://play-with-docker.com/), you might have to use a different method to restart the Engine. +that you [provisioned yourself](https://@@GITREPO@@/tree/master/prepare-machine) or with [Play-With-Docker](http://play-with-docker.com/), you might have to use a different method to restart the Engine. --- diff --git a/slides/swarm/intro.md b/slides/swarm/intro.md index 6db88c16..db236139 100644 --- a/slides/swarm/intro.md +++ b/slides/swarm/intro.md @@ -3,7 +3,7 @@ - This was initially written by [Jérôme Petazzoni](https://twitter.com/jpetazzo) to support in-person, instructor-led workshops and tutorials -- Over time, [multiple contributors](https://github.com/jpetazzo/container.training/graphs/contributors) also helped to improve these materials — thank you! +- Over time, [multiple contributors](https://@@GITREPO@@/graphs/contributors) also helped to improve these materials — thank you! - You can also follow along on your own, at your own pace diff --git a/slides/swarm/logging.md b/slides/swarm/logging.md index d21894a4..ab8ee265 100644 --- a/slides/swarm/logging.md +++ b/slides/swarm/logging.md @@ -113,7 +113,7 @@ class: elk-manual - We could author a custom image bundling this configuration -- We can also pass the [configuration](https://github.com/jpetazzo/container.training/blob/master/elk/logstash.conf) on the command line +- We can also pass the [configuration](https://@@GITREPO@@/blob/master/elk/logstash.conf) on the command line .exercise[ @@ -195,7 +195,7 @@ class: elk-auto Note: the *build* and *push* steps are not strictly necessary, but they don't hurt! Let's have a look at the [Compose file]( -https://github.com/jpetazzo/container.training/blob/master/stacks/elk.yml). +https://@@GITREPO@@/blob/master/stacks/elk.yml). --- diff --git a/slides/swarm/machine.md b/slides/swarm/machine.md index 0a9d6a11..3820bcfb 100644 --- a/slides/swarm/machine.md +++ b/slides/swarm/machine.md @@ -169,7 +169,7 @@ class: in-person This should tell us that we are talking to `node3`. Note: it can be useful to use a [custom shell prompt]( -https://github.com/jpetazzo/container.training/blob/master/prepare-vms/scripts/postprep.rc#L68) +https://@@GITREPO@@/blob/master/prepare-vms/scripts/postprep.rc#L68) reflecting the `DOCKER_HOST` variable. --- diff --git a/slides/swarm/operatingswarm.md b/slides/swarm/operatingswarm.md index 9d7c5a68..12deb4eb 100644 --- a/slides/swarm/operatingswarm.md +++ b/slides/swarm/operatingswarm.md @@ -33,7 +33,7 @@ TOKEN=$(docker swarm join-token -q manager) for N in $(seq 2 5); do DOCKER_HOST=tcp://node$N:2375 docker swarm join --token $TOKEN node1:2377 done -git clone git://github.com/jpetazzo/container.training +git clone git://@@GITREPO@@ cd container.training/stacks docker stack deploy --compose-file registry.yml registry docker-compose -f dockercoins.yml build