We ❤️ Pull Requests for fixing or adding content. Thanks for your contribution!
For small changes, you can simply use the "Edit" button to update the Markdown file or any of the dialog, and start the pull request process easily. You can use the preview tab in GitHub to make sure that it is properly formatted before committing. Once the pull request is placed, review the results of the pipeline and correct any mistake that is reported.
If you plan to contribute often or have a larger change to make, it is best to setup an environment for contribution. This is what the rest of this page is about.
This guide provides steps to setup a dedicated environment for DevOps Dojo development. It includes Git and Katacoda related instructions.
Before you get started make sure to perform the one time setup:
Steps below illustrate how to work on a new DevOps Dojo feature.
See Katacoda and branches
section for more details why the development is done directly on fork's master
.
-
Fetch latest changes from main repository:
git fetch upstream
-
Reset your fork's
master
branch to match exactly upstreammaster
:git checkout master git reset --hard upstream/master git push --force
IMPORTANT: Do it only once, when you start working on new feature as the above commands will overwrite completely your
master
content. -
Hack, hack, hack, and commit your changes to Git:
# hack, hack, hack git add ... git commit ... git push
-
Your changes should be visible in Katacoda at https://katacoda.com/<your_katacoda_user>
-
To continue development of your feature:
# hack, hack, hack git add ... git commit ... git push
-
Open a new Pull Request to the main repository using your
master
branch
Katacoda only works with master
branch. Therefore you will use your fork's
master
branch to preview your work in Katacoda. To make the Pull Requests
and merges easier, at the beginning of each feature development we will reset
your master
to match exactly the master
of the main repository.
If you have reasons to not reset your fork's master
branch, you can use
feature branches, and then merge their content to your master
and create
Pull Requests out of the feature branch:
git fetch upstream
git checkout -b feature-X upstream/master
# hack, hack, hack
git add ...
git commit ...
git checkout master
git merge feature-X
git push
# changes now visible in Katacoda
git checkout feature-X
git push -u origin feature-X
# you can now open a Pull Request to the main repository using feature-X branch
# finally once all done - delete the branch
git branch -d feature-X
git push --delete feature-X
DevOps Dojo development is managed with one repository:
- https://github.com/dxc-technology/online-devops-dojo - contains Katacoda implementations of the scenarios as well as the GitHub app.
To prepare your dedicated GitHub repository:
-
Fork in GitHub https://github.com/dxc-technology/online-devops-dojo
-
Clone your forked repository (e.g., https://github.com/jdoe1000/online-devops-dojo ) to your workstation.
-
Set your remotes as follows:
cd online-devops-dojo git remote add upstream git@github.com:dxc-technology/online-devops-dojo.git git remote set-url upstream --push DISABLED
Running
git remote -v
should give something similar to:origin git@github.com:jdoe1000/online-devops-dojo.git (fetch) origin git@github.com:jdoe1000/online-devops-dojo.git (push) upstream git@github.com:dxc-technology/online-devops-dojo.git (fetch) upstream DISABLED (push)
The use of
upstream --push DISABLED
is just a practice preventing those withwrite
access to the main repository from accidentally pushing changes there.
https://katacoda.com is lab environment used by Online DevOps Dojo that allows students to have dedicated environments for their class right in the browser.
- Sign up for new account on https://katacoda.com
- If that is your first visit, go to Claim Your Profile page and provide your
username and name. Make sure to
SAVE
and then abort GitHub configuration as it does not allow to configure a non-public repository. - Go to Your Profile page and then click on Settings icon in the middle of the page
- Set Private Git Repository to
Yes
- Set Git Scenario Repository to the address of your fork (e.g., https://github.com/jdoe1000/online-devops-dojo )
- Make sure to click on
SAVE
button - Do not close this window as we will need the values from Git Deploy Key and Git Webhook Secret
We now need to configure GitHub repository hook so that Katacoda is notified each time you push updates to your repository.
- Open new browser window and go to your fork's URL (e.g., https://github.com/jdoe1000/online-devops-dojo )
- Open the repository Settings page tab and then Deploy keys (left navigation)
- Click on Add deploy key button and use the following information to set it up:
- Title:
katacoda.com
- Key: paste the Git Deploy Key value from your Katacoda settings page
- Allow write access: leave unchecked
- Title:
- Click on Add deploy key button
- Click on Webhooks (left navigation)
- Click on Add webhook button and use the following information to set it up:
- Payload URL: https://editor.katacoda.com/scenarios/updated
- Content type:
application/json
- Secret: paste the Git Webhook Secret value from your Katacoda settings page
- Which events ...:
Just the push event
- Click on Add webhook button to create it
If all the setup is done correctly you should be able to access your Katacoda environment at:
https://katacoda.com/<your_katacoda_user>