Skip to content

Latest commit

 

History

History

README.md

Tools

To update the lessons available on the public-facing wptrainingteam.github.io, follow these steps.

Update existing lesson plans to latest master branch

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

Omit Non-Lesson Repositories

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.

About Git Submodules

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.

The update-lessons.sh Script

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.

  1. Fork this repository.
  2. Clone your fork.
$ git clone https://github.com/<yourusername>/wptrainingteam.github.io.git
  1. Checkout the dev branch.
$ git checkout -b dev
  1. Change to the .tools directory.
$ cd wptrainingteam.github.io/.tools
  1. Run the script.
$ ./update-lessons.sh
  1. 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-plan directory.
    • 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.md with links to each lesson plan and slides.
  1. Stage all updates.
$ git add --all
  1. Commit your changes.
$ git commit -m "Update to current lesson plans."
  1. Push your changes.
$ git push
  1. Submit a pull request back to the wptrainingteam organization.

The WordPress.org Lesson Plan Manifest

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