Setting up a local authoring envireonment
Fedora Server documentation is at: https://pagure.io/fedora-server/.
It includes the content as well as various scripts to build and preview the site locally. The directory structure is predefined by the docs Content Management System (Andorra) and must not be changed.
It has 2 permanent branches: „main“ for the published content and „stg“ for planning, development, and discussion. Temporarily, additional branches may also be present.
For up- and download you can use either https or ssh. For people with FAS account ssh may be more convenient.
The workflow folllow the Fedora docs project „[https://docs.fedoraproject.org/en-US/fedora-docs/contributing/git/ Git for docs writers]“. Each contributor should create a fork of the repository for themselves. Contributions are uploaded to the fork and then transferred to the authoritative version via a pull request. This opens up the possibility for others to comment and initiate a broader discussion.
Create a local subdirectory where the files of the documentation should be stored, and make it to your default. We use fedora-server-docs in your home throughout this guide
[…]$ mkdir ~/fedora-server-docs […]$ cd ~/fedora-server-docs
Still in your default working directory, clone fedora-server repository + […]$ git clone https://email@example.com/fedora-server.git -o upstream + Git will copy the complete server repo including all branches, specifically „main“ and „stg“ mentioned above, into a local repo on your local workstation (into .git/ located in your default directory). + Git does „tag“ the cloned repo as remote repo „upstream“. + At the same time it checks out the default branch „''main''“ into your ''working directory'' (i.e. ~/fedora-server-docs in the above example). Therefore, when the operation terminates, you will find in your current default directory, which is now your ''working directory'', some files, e.g. README.md, build.sh and preview.sh and a directory docs. The latter contains the content. + If you leave off „./“ at the end, git creates another directory in your default directory with the name of the repository, i.e. fedora-server. And this directory is then the "working directory" to the repository. This can be useful if you want to keep track of different fedora docs projects in one directory.
In your browser go to https://pagure.io/fedora-server/, log in and create a Fork. Once you have done it, the button will read View fork. Switch to your fork and click on Clone and you will see 2 addresses you can use to clone (copy) the content to your local default directory
Still in your default working directory, add the forked Repo to your remote repos.
[…]$ git remote add origin ssh://firstname.lastname@example.org/forks/[MY_FAS]/fedora-server.git
You can use https as well. For users with a FAS account ssh is usually the better choice.
You have now 2 remote repos defined. Check:
[…]$ git remote -v origin ssh://email@example.com/forks/[MY_FAS]/fedora-server.git (fetch) origin ssh://firstname.lastname@example.org/forks/[MY_FAS]/fedora-server.git (push) upstream https://email@example.com/fedora-server.git (fetch) upstream https://firstname.lastname@example.org/fedora-server.git (push)
In your workflow you will update your local version to the latest versions of the server repository by „pulling“ the content from „upstream“ and upload your modifications and additions by „pushing“ it to origin, i.e. to your fork. You will than create a „pull requuest“, i.e. pick up your modifications and additions from your fork and integrate it into the generic repository („origin“). This enables co-writers to review our work and comment on it.
In your working directory create the built und preview
[…]$ ./build.sh && ./preview.sh
6, Back to your browser enter the local preview address': localhost:8080 * You should see a local preview of the current Server documentation
Check, if you are on the branch to intend to work on
[…]$ git branch main * stg
If not, switch to the branch you want to use.
[…]$ git checkout [stg|main]
Git will adjust and modify the content of your working directory accordingly!
Before your begin to work update your working directory […]$ git commit -m „<YOUR COMMIT MESSAGE>“
Update preview and check: […]$ ./build.sh && ./preview.sh
Preview in your browser using the address 'localhost:8080
Repeat step 4 & 5 as required.
Commit your work locally and then push it into your fork „origin“.
[…]$ git status
Add files to commit stage as appropriate
[…]$ git add <FILENAME>
Commit locally […]$ git commit -m „<YOUR COMMIT MESSAGE>“
Transfer to your fork of fedora server repository
[…]$ git push origin [main|stg]
In your browser open https://pagure.io/fedora-server, login, switch to your fork, and create a pull request.
Want to help? Learn how to contribute to Fedora Docs ›