To update the lessons available on the public-facing wptrainingteam.github.io, follow these steps.
To manually update the lessons to the current HEAD of their submodule repos, run the following commands once you have cloned the repository:
git submodule init
git submodule sync
git submodule update --remote
Several repositories within the organization are not lesson plans. These should not be included on this site. To omit a repo from this site, add its clone URL to a new line in omitted-repos.manifest.
When you clone this repository using git clone https://github.com/wptrainingteam/wptrainingteam.github.io.git your local copy will not initially include the lesson plan submodules. You will only have pointers to a specific commit of each lesson plan repository, until you either run the command git submodule init or run the update-lessons.sh script.
The submodules are set to track the head of the "Master" branch of each repository, but in order for them to track, they must be merged with the current remote origin.
When updates have been made to lesson plans, or a new lesson plan repository has been added to the project, it is time to update this repository.
- Fork this repository.
- Clone your fork.
$ git clone https://github.com/<yourusername>/wptrainingteam.github.io.git
- Checkout the
devbranch.
$ git checkout -b dev
- Change to the
.toolsdirectory.
$ cd wptrainingteam.github.io/.tools
- Run the script.
$ ./update-lessons.sh
- The script will:
- Fetch a list of all repositories within the wptrainingteam organization.
- Compare this list to omitted-repos.manifest and place all the others into lesson-plans.manifest
- Attempt to add each lesson plan as a submodule within the
lesson-plandirectory.- If the lesson plan is not new, an message prints and the script moves on.
- Initialize and synchronize all submodules.
- Update and merge all submodules from the remote master.
- Populate
lesson-plan/README.mdwith links to each lesson plan and slides.
- Stage all updates.
$ git add --all
- Commit your changes.
$ git commit -m "Update to current lesson plans."
- Push your changes.
$ git push
- Submit a pull request back to the wptrainingteam organization.
When new lesson plans are added, the manifest.json file that drives the imports to WordPress.org needs to be updated. The script in .tools will parse the lesson-plans.manifest file and create the manifest.json file. Execute it by running it as a script:
~/wptrainingteam.github.io/.tools/ $ ./update-manifest.sh