This project contains the source code of a website with the archived latest 2.2 Magento developer documentation. The website to view the website https://commerce-docs.github.io/devdocs-archive/2.2/.
For local builds, you need to install Ruby 2.4 or later.
To check the Ruby version on your environment, run in your terminal:
ruby -v
Clone or download the repository. The first time you are at the devdocs
directory, run:
bundle install
Once you have completed preparing your environment, you can build locally and review the site in your browser.
rake is a native Ruby tool that helps to automate tasks.
-
Run the rake task that installs all required dependencies and starts the Jekyll server:
rake preview
-
Press
Ctrl+C
in the serve terminal to stop the server.
If rake fails on your environment, generate the preview using jekyll.
The website is deployed using the GitHub Pages service. The builds are pushed to the 2.2 directory at the gh-pages branch.
To build and deploy the website, run:
rake build_and_deploy
The command performs the following actions:
- Clears the _site directory.
- Builds the website with the base URL
devdocs-archive/2.2
. - Remembers the number of commit that's been built to use later in a commit message for reference.
- Checkouts the gh-pages branch.
- Copies the content of the _site directory to the 2.2 directory. The _site directory is ignored by git that makes the build from the archived-docs-v2.2 available in the gh-pages branch.
- Adds and commits the changes with the message that has reference to the commit of the built source code (see item 3 in this list).
- Pushes the commit to the remote repository.
- Checkouts back to the source code branch.