Skip to content

Commit a7cbabb

Browse files
authored
Merge pull request #73 from cmckee786/patching
feat: add scripts and workflow examples
2 parents 7aa3816 + d1ecf5f commit a7cbabb

File tree

4 files changed

+86
-31
lines changed

4 files changed

+86
-31
lines changed

src/assets/images/workflow.png

39.1 KB
Loading

src/contributing.md

Lines changed: 40 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
</p>
99
</div>
1010

11-
The Professional Linux Users Group (ProLUG) has a set of requirements and
12-
guidelines to contribute to this project. Below are a set of steps to ensure
11+
The Professional Linux Users Group (ProLUG) provides a set of requirements
12+
and guidelines to contribute to this project. Below are steps to ensure
1313
contributors are adhering to those guidelines and fostering a productive
1414
version control environment.
1515

@@ -32,20 +32,23 @@ version control environment.
3232

3333
---
3434

35-
To be an effective contributor, understanding Git, whether through the command
36-
line or an external tool, will be an important part of contributing. To this
37-
effect, it is important that any individual who contributes to this project have
38-
a proficient and working understanding of committing, merging, and other
39-
fundamental Git workflows.
35+
To be an effective contributor, understanding [Git](https://git-scm.com/), whether
36+
through the command line or an external tool, will be an important part of contributing.
37+
To this effect it is important that any individual who contributes to this project have
38+
a working understanding of committing, merging, and other fundamental Git workflows.
39+
40+
For clarity this project utilizes GitHub for remote repositories and CI/CD testing
41+
pipeline workflows. Git and GitHub are two separate entities where GitHub provides
42+
the hosting services and Git provides the version control.
4043

4144
Prospective contributors are directed to several resources should they feel their
42-
competency with Git falls short:
45+
competency with Git or GitHub falls short:
4346

4447
Git documentation:
4548

4649
- <https://git-scm.com/doc>
4750

48-
Git video tutorials:
51+
Git and GitHub video tutorials:
4952

5053
- [The Primeagen's Boot.dev Full Git Course (4hr)](https://www.youtube.com/watch?v=rH3zE7VlIMs)
5154
- [Fireship's How to use Git and Github (12m)](https://youtu.be/HkdAHXoRtos)
@@ -57,26 +60,33 @@ Git video tutorials:
5760

5861
Contributors who elect to contribute through the command line will need
5962
to verify their identities before their commits can be accepted. **This step
60-
is not required if contributors will be making changes via GitHub.com itself**
61-
as by logging in and contributing to workflows GitHub will inherently verify
62-
actions made by such accounts as they reside within the GitHub ecosystem.
63+
is not required if contributors will be submitting changes via GitHub.com itself**
64+
since users will have verified their identities with GitHub's own verification
65+
process.
66+
67+
**To reiterate, individuals contributing via command line will need to sign their
68+
commits through SSH**. Signing GitHub commits helps ProLUG validate incoming commits
69+
from trusted contributors that reside outside the GitHub ecosystem. It can be quite
70+
trivial to impersonate users on GitHub and it is in the best interest of the project
71+
and contributors to observe this security practice.
72+
73+
It should also be noted that GitHub supplies tools like [GitHub CLI](https://cli.github.com/)
74+
that abstract away the process of signing and verifying commits from the command line.
75+
GitHub provides a `gh auth login` function to facilitate the procedure which contributors
76+
can employ without the necessary changes suggested below.
6377

64-
**Individuals contributing via command line will need to sign their commits through
65-
SSH**. Signing GitHub commits helps ProLUG validate incoming commits from trusted
66-
contributors that reside outside the GitHub ecosystem. It can be quite trivial
67-
to impersonate users on GitHub and it is in the best interest of those involved
68-
to observe this security practice.
78+
To Sign your Git Commits with SSH:
6979

7080
Generate an SSH key pair if you don't have one:
7181

7282
```bash
7383
ssh-keygen -t ed25519
7484
```
7585

76-
Add SSH public key ('.pub' suffix) to github as "Signing Key".
86+
Add SSH public key ('.pub' suffix) to GitHub as "Signing Key".
7787
<img src="./assets/images/addkey.png"></img>
7888

79-
\* GitHub.com -> Profile -> Settings -> GPG and SSH Keys -> Add SSH Key -> Dropdown -> Signing Key
89+
\* GitHub.com -> Profile -> Settings -> GPG and SSH Keys -> Add SSH Key -> Drop down -> Signing Key
8090

8191
Below is a bash script that will attempt to configure signing
8292
Git commits on a localhost:
@@ -190,14 +200,14 @@ Make changes to the `u1ws.md`.
190200
### Git Rebasing
191201

192202
<div class="warning">
193-
<strong>FIRST AND FOREMOST, ONLY REBASE IN LOCAL RESPOSITORIES, NEVER REBASE
203+
<strong>FIRST AND FOREMOST, ONLY REBASE IN LOCAL REPOSITORIES, NEVER REBASE
194204
A PUBLIC BRANCH OR REPOSITORY UNLESS YOU FULLY UNDERSTAND THE CONSEQUENCES.
195205
YOU HAVE BEEN WARNED.</strong>
196206
</div>
197207

198208
Proper implementation of rebasing can leave a clean, and easily readable
199-
commit history for all concerned parties. The Git documentation does a succinct
200-
job in explaining its utility and how it **could potentially ruin a project**.
209+
commit history for all concerned parties. The Git documentation provides a
210+
succinct explanation of its utility and how it **could potentially ruin a project**.
201211

202212
Rebasing also plays a role in facilitating any commit reverts that may need
203213
to be made in the future. More on that will follow.
@@ -221,12 +231,13 @@ remotely:
221231

222232
<img src="./assets/images/squashing.png"></img>
223233

224-
Squashing commits (a form of rebasing) can improve readability, but its primary
225-
utility, especially for larger projects, may be in addressing an event where
234+
Squashing commits can improve readability, but its primary utility,
235+
especially for larger projects, may be in addressing an event where
226236
rolling back several commits due to a bug or test can be done with a single
227237
commit revert.
228238

229-
freeCodeCamp has a [great write-up on this procedure](https://www.freecodecamp.org/news/git-squash-commits/). When done appropriately this can greatly facilitate the development process.
239+
freeCodeCamp has a [great write-up on this procedure](https://www.freecodecamp.org/news/git-squash-commits/).
240+
When done appropriately this can greatly facilitate the development process.
230241
Contributors are strongly encouraged to begin exploring these types of workflows
231242
if they never have.
232243

@@ -239,7 +250,7 @@ if they never have.
239250
Another useful practice is to employ "stashing" uncommitted files in
240251
a local repository. This is useful in many contexts including stashing
241252
local changes to resolve recently introduced remote vs. local repo conflicts,
242-
or quickly switching workingspaces.
253+
or quickly switching working spaces.
243254

244255
Stashing effectively unstages any changes made in the local repo and
245256
saves them to be applied later. This can further help facilitate a rebase
@@ -265,8 +276,9 @@ git push origin unit1-worksheet
265276

266277
### Comment your Changes
267278

268-
Before creating a pull request, make a comment on the issue containing your changes.
269-
We're doing this since the GitHub organization feature is paid and we are doing this for free, so there is only one person who is able to merge pull requests at the moment.
279+
Before creating a pull request, make a comment on the issue containing your changes.
280+
We're doing this since the GitHub organization feature is paid and we are doing this
281+
for free, so there is only one person who is able to merge pull requests at the moment.
270282

271283
### Create a Pull Request
272284

src/development.md

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,49 @@ Getting started with Ansible:
6767

6868
### Bash Script
6969

70-
Export and execute this script to your Rocky Linux machine/container.
70+
Many of these commands assume a root user.
71+
72+
Export and execute this script to your machine/container.
73+
74+
<div class=warning>
75+
76+
Dependencies can total over ~500MB compressed and 2GB unpackaged or more.
77+
78+
Debian containers/machines will require building many of these packages from
79+
source as Debian has a far slower package version adoption rate for stability
80+
thus not recommended for deploying mdBook.
81+
82+
</div>
83+
84+
These scripts will take up to 10 minutes to download the necessary dependencies
85+
and compile mdBook depending on the machine/container's capabilities.
86+
87+
Tested with Rocky 9 and Ubuntu 24.04 Containers.
88+
89+
APT frontends:
7190

7291
```bash
73-
{Placeholder}
92+
#!/bin/bash env
93+
apt update
94+
apt install apache2 git gcc rustc-1.80 cargo-1.80
95+
cargo-1.80 install mdbook
96+
systemctl enable apache2 && systemctl start apache2
97+
cd && git clone https://github.com/ProfessionalLinuxUsersGroup/lac
98+
cd ~/lac && ~/.cargo/bin/mdbook build -d /var/www/html
99+
systemctl restart apache2
100+
```
101+
102+
DNF frontends:
103+
104+
```bash
105+
#!/bin/bash env
106+
dnf update
107+
dnf install -y httpd git gcc rust
108+
/usr/bin/cargo install mdbook
109+
systemctl enable httpd && systemctl start httpd
110+
cd && git clone https://github.com/ProfessionalLinuxUsersGroup/lac
111+
cd ~/lac && ~/.cargo/bin/mdbook build -d /var/www/html
112+
systemctl restart httpd
74113
```
75114

76115
#### From here you can use such commands from your localhost to implement changes:
@@ -93,3 +132,7 @@ From there you should be able to see any changes you have made are reflected.
93132
scp {working directory}/{targeted document} {TARGET_IP}:/root/lac/src/{targeted document}
94133
ssh {TARGET_IP} "cd ~/lac && ~/.cargo/bin/mdbook build -d /var/www/html && systemctl restart httpd"
95134
```
135+
136+
An example of the workflow after making changes:
137+
138+
<img src="./assets/images/workflow.png"></img>

src/u1ws.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Specifically, this unit and worksheet aim to cover concepts such as the command
2121
commands and syntax, command line tools, Vim (visual editor improved), the Linux Kernel, and much more.
2222

2323
Students are strongly encouraged to learn from these units and apply what they learn. Applying what you
24-
learn offers no better teach. Again welcome, and good luck in your studies.
24+
learn offers no better teacher. Again welcome, and good luck in your studies.
2525

2626
### Resources / Important Links
2727

0 commit comments

Comments
 (0)