Skip to content

Commit 9890676

Browse files
authored
Merge branch 'inno-devops-labs:master' into master
2 parents d3639ae + bf1e711 commit 9890676

File tree

2 files changed

+202
-0
lines changed

2 files changed

+202
-0
lines changed

lab3.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# Version Control
2+
3+
In this lab, you will learn about version control systems and their importance in collaborative software development. You will specifically focus on Git, one of the most widely used version control systems. Follow the tasks below to complete the lab assignment.
4+
5+
## Task 1: Understanding Version Control Systems
6+
7+
**Objective**: Understand how Git stores data.
8+
9+
1. **Create and Explore a Repository**:
10+
- Use the current repository and make a few commits.
11+
- Use `git cat-file` to inspect the contents of blobs, trees, and commits.
12+
13+
```sh
14+
# Example commands to inspect contents
15+
git cat-file -p <blob_hash>
16+
git cat-file -p <tree_hash>
17+
git cat-file -p <commit_hash>
18+
```
19+
20+
- Create a `submission3.md` file.
21+
- Provide the output in the `submission3.md` file.
22+
23+
## Task 2: Practice with Git Reset Command
24+
25+
**Objective**: Practice using different ways to use the `git reset` command.
26+
27+
1. **Create a New Branch**:
28+
- Create a new branch named "git-reset-practice" in your Git repository.
29+
30+
```sh
31+
git checkout -b git-reset-practice
32+
```
33+
34+
2. **Explore Advanced Reset and Reflog Usage**:
35+
- Create a series of commits.
36+
37+
```sh
38+
echo "First commit" > file.txt
39+
git add file.txt
40+
git commit -m "First commit"
41+
42+
echo "Second commit" >> file.txt
43+
git add file.txt
44+
git commit -m "Second commit"
45+
46+
echo "Third commit" >> file.txt
47+
git add file.txt
48+
git commit -m "Third commit"
49+
```
50+
51+
- Use `git reset --hard` and `git reset --soft` to navigate the commit history.
52+
53+
```sh
54+
git reset --soft HEAD~1
55+
git reset --hard HEAD~1
56+
```
57+
58+
- Use `git reflog` to recover commits after a reset.
59+
60+
```sh
61+
git reflog
62+
git reset --hard <reflog_hash>
63+
```
64+
65+
3. **Documentation**:
66+
- Document the steps taken and push the final state to GitHub.
67+
- Document your practice in the `submission3.md` file and include the following details:
68+
- Steps you took to perform the Git reset operations.
69+
- Explain the reset and reflog process in the `submission3.md`.
70+
- Examples and outputs of the commands executed.
71+
72+
## Additional Resources
73+
74+
- [Git Documentation](https://git-scm.com/doc)
75+
- [Pro Git Book](https://git-scm.com/book/en/v2)
76+
77+
### Guidelines
78+
79+
- Use proper Markdown formatting for documentation files.
80+
- Organize files with appropriate naming conventions.
81+
- Create a Pull Request to the main branch of the repository with your completed lab assignment.
82+
83+
> Note: Actively explore and document your findings to gain hands-on experience with Git.

lab4.md

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
# Software Distribution
2+
3+
In this lab, you will explore software distribution strategies and best practices. You will gain insights into the different approaches used to distribute software and understand the importance of effective software distribution in the development lifecycle. Follow the tasks below to complete the lab assignment.
4+
5+
## Task 1: Configure and Use a Local Package Repository
6+
7+
**Objective**: Set up a local package repository and use it to install packages.
8+
9+
1. **Create a Local Repository**:
10+
- Create a directory to hold your repository and place some `.deb` files in it.
11+
12+
```sh
13+
mkdir -p ~/local-apt-repo
14+
cp /path/to/package.deb ~/local-apt-repo/
15+
```
16+
17+
2. **Generate the Package Index**:
18+
- Use `dpkg-scanpackages` to create a `Packages` file. Compress this file into a `Packages.gz` archive.
19+
20+
```sh
21+
dpkg-scanpackages ~/local-apt-repo /dev/null | gzip -9c > ~/local-apt-repo/Packages.gz
22+
```
23+
24+
3. **Add the Local Repository to Your Sources List**:
25+
- Add the repository to your `sources.list`.
26+
27+
```sh
28+
echo "deb [trusted=yes] file:/home/yourusername/local-apt-repo ./" | sudo tee /etc/apt/sources.list.d/local-apt-repo.list
29+
sudo apt update
30+
```
31+
32+
4. **Verify the Contents of the Packages.gz File:**:
33+
- Check that the Packages.gz file contains the correct paths and metadata for your .deb files, **it must be relative path like `./your_package.deb`**. Also you can see the package name there. Then check the repository of your package, make sure it's local one.
34+
35+
```sh
36+
zcat Packages.gz
37+
apt policy your-package-name
38+
```
39+
40+
5. **Install a Package from the Local Repository**:
41+
- Install a package using `apt` from your local repository.
42+
43+
```sh
44+
sudo apt install your-package-name
45+
```
46+
47+
6. **Document the Process**:
48+
- Create a `submission4.md` file.
49+
- Provide step-by-step documentation of your setup and installation process in the `submission4.md` file.
50+
51+
## Task 2: Simulate Package Installation and Identify Dependencies
52+
53+
**Objective**: Use `apt` to simulate package installation and identify dependencies without actually installing the packages.
54+
55+
1. **Choose a Package to Simulate**:
56+
- Select a package to simulate its installation.
57+
58+
```sh
59+
apt-cache showpkg your-package-name
60+
```
61+
62+
2. **Simulate the Installation**:
63+
- Use the `-s` flag to simulate the installation.
64+
65+
```sh
66+
sudo apt-get install -s your-package-name
67+
```
68+
69+
3. **Analyze the Output**:
70+
- Identify the dependencies and the packages that would be installed.
71+
- Document the findings in the `submission4.md` file, including which dependencies are required and their versions.
72+
73+
## Task 3: Hold and Unhold Package Versions
74+
75+
**Objective**: Prevent a package from being upgraded and then allow it to be upgraded again.
76+
77+
1. **Install a Package**:
78+
- Install a package that is commonly updated.
79+
80+
```sh
81+
sudo apt install your-package-name
82+
```
83+
84+
2. **Hold the Package**:
85+
- Use `apt-mark` to hold the package.
86+
87+
```sh
88+
sudo apt-mark hold your-package-name
89+
```
90+
91+
3. **Verify the Hold Status**:
92+
- Check the status of held packages.
93+
94+
```sh
95+
apt-mark showhold
96+
```
97+
98+
4. **Unhold the Package**:
99+
- Use `apt-mark` to unhold the package.
100+
101+
```sh
102+
sudo apt-mark unhold your-package-name
103+
```
104+
105+
5. **Documentation**:
106+
- Document the steps taken to hold and unhold the package, including any verification commands in the `submission4.md` file.
107+
108+
## Additional Resources
109+
110+
- [Apt Documentation](https://manpages.debian.org/buster/apt/apt.8.en.html)
111+
- [Debian Package Management](https://www.debian.org/doc/manuals/debian-faq/pkg-basics.en.html)
112+
113+
### Guidelines
114+
115+
- Use proper Markdown formatting for documentation files.
116+
- Organize files with appropriate naming conventions.
117+
- Create a Pull Request to the main branch of the repository with your completed lab assignment.
118+
119+
> Note: Actively explore and document your findings to gain hands-on experience with `apt` and software distribution strategies.

0 commit comments

Comments
 (0)