mirror of
https://github.com/marcel-dempers/docker-development-youtube-series.git
synced 2025-06-06 17:01:30 +00:00
add course overview, first chapter and module content
This commit is contained in:
parent
a1fcfc975f
commit
44ad6dd53a
60
course/chapters/chapter-1-source-control-git/README.md
Normal file
60
course/chapters/chapter-1-source-control-git/README.md
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
# Chapter-1 : Source Control and GIT
|
||||||
|
|
||||||
|
Back to [Course Introduction](../../course.md)
|
||||||
|
|
||||||
|
### 🎬 [Module 1: Introduction to GIT: Source Control](../../content/source-control/git/README.md)
|
||||||
|
|
||||||
|
[GIT](https://en.wikipedia.org/wiki/Git) is the foundation of DevOps, Programming & Software Engineering </br>
|
||||||
|
This is because it is a source code distributed version control system. </br>
|
||||||
|
In DevOps, you will deal with code, command line, documentation, scripts, automation, intrastructure-as-code and more. </br>
|
||||||
|
Generally, all of this involves writing files and storing them.
|
||||||
|
GIT is the system you use to store these files. </br>
|
||||||
|
|
||||||
|
In this module we'll take a read through [GIT](https://en.wikipedia.org/wiki/Git) to understand where it started and why it is so successful and widely used in software engineering. </br>
|
||||||
|
|
||||||
|
#### In this module
|
||||||
|
|
||||||
|
* What is GIT
|
||||||
|
* Installing GIT
|
||||||
|
* Command line
|
||||||
|
* Create your first GIT repository
|
||||||
|
* Branching
|
||||||
|
* Commits
|
||||||
|
* Merging branches
|
||||||
|
* GUI Tools for GIT
|
||||||
|
* VSCode
|
||||||
|
|
||||||
|
|
||||||
|
### 🚧🎬 [Module 2: Introduction to IDEs: Visual Studio Code]()
|
||||||
|
|
||||||
|
When working on source code using GIT, you will want to work on files and directories. </br>
|
||||||
|
This includes configuration files, code files, scripts and so on. </br>
|
||||||
|
To get a nice overview of all our files and folders, as well as have access to `git` and command line, we'll use an IDE. </br>
|
||||||
|
An [IDE](https://en.wikipedia.org/wiki/Integrated_development_environment) is an integrated development environment. </br>
|
||||||
|
It is software that helps us deal with software development and engineering. </br>
|
||||||
|
|
||||||
|
#### In this module:
|
||||||
|
|
||||||
|
* What is VSCode
|
||||||
|
* Directory and File management
|
||||||
|
* Editing files
|
||||||
|
* Command line terminals
|
||||||
|
* Extensions
|
||||||
|
* Themes
|
||||||
|
* GIT features
|
||||||
|
|
||||||
|
|
||||||
|
### 🚧🎬 [Module 3: Introduction to Github: Hosted Source Control]()
|
||||||
|
|
||||||
|
Storing source code in a Git repository on a local machine carries a risk of data loss. </br>
|
||||||
|
If your harddrive crashes, or you lose your laptop, all your work would be lost. </br>
|
||||||
|
Therefore it's always recommended to use a hosted source control provider like Github, BitBucket, Gitlab and others. </br>
|
||||||
|
|
||||||
|
It also makes collaboration possible, when you have a team of people working on the same project </br>
|
||||||
|
|
||||||
|
#### In this module
|
||||||
|
|
||||||
|
* We create a Github account
|
||||||
|
* Overview of Github source control
|
||||||
|
* Integrating our repository with Github
|
||||||
|
* Working with our repository
|
329
course/content/source-control/git/README.md
Normal file
329
course/content/source-control/git/README.md
Normal file
@ -0,0 +1,329 @@
|
|||||||
|
# 🎬 Introduction to GIT: Source Control
|
||||||
|
|
||||||
|
## 💡 Preface
|
||||||
|
|
||||||
|
This module is part of a course on DevOps. </br>
|
||||||
|
Checkout the [course introduction](../../../course.md) for more information </br>
|
||||||
|
This module is part of [chapter 1](../../../chapters/chapter-1-source-control-git/README.md)
|
||||||
|
|
||||||
|
## What is GIT
|
||||||
|
|
||||||
|
[Git](https://git-scm.com/) is a free and open source distributed version control system. </br>
|
||||||
|
|
||||||
|
As engineers, we will often work on files, such as code, scripts, configuration as well as documents etc. </br>
|
||||||
|
Our daily workflow may involve:
|
||||||
|
* Create files
|
||||||
|
* Edit files
|
||||||
|
* Delete files
|
||||||
|
* Review changes
|
||||||
|
* Repeat
|
||||||
|
|
||||||
|
This will require a mechanism of tracking history of changes in these files and allowing teams of people to work on the same files without overriding each others changes. </br>
|
||||||
|
|
||||||
|
## Installing GIT
|
||||||
|
|
||||||
|
We can download `git` for any operating system and follow the prompts to install. </br>
|
||||||
|
|
||||||
|
## Using GIT and Command line
|
||||||
|
|
||||||
|
During this course, I will highlight the importance of using command line as a DevOps engineer or SRE. </br>
|
||||||
|
For many development & IT professions, as well as in DevOps there are GUI tools available that have high user friendliness. </br>
|
||||||
|
These GUI tools make life easier in many ways and we will come across many such tools in this course. </br>
|
||||||
|
</hr>
|
||||||
|
|
||||||
|
For most IT proffesions, especially for software developers, they start with GUI tools first, such as Integrated Development Environments or IDE's </br>
|
||||||
|
IDE's are code editors and allows programmers to write, build, run and test code. </br>
|
||||||
|
Almost like an accountant using Excel spreadsheets or Word documents </br>
|
||||||
|
Many of these functions stop entirely, when there are no GUI tools available and developers become unproductive. </br>
|
||||||
|
The accountant stops, when Excel no longer works. </br>
|
||||||
|
|
||||||
|
In DevOps, most tooling are built from the commandline up. </br>
|
||||||
|
So although there are GUI tools available for use, when these tools are not available, DevOps engineers can still
|
||||||
|
continue to be productive by continueing to use the commandline instead. </br>
|
||||||
|
|
||||||
|
For example, if you are on a Linux server and it ran out of disk space. </br>
|
||||||
|
There are no GUI tools on the server other than a shell terminal. </br>
|
||||||
|
In this scenario, you are forced to use the command line, so its very important to be effecient in its use.
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
To install GIT , head over to [git-scm.com](https://git-scm.com/downloads) download page and follow the installation instructions for your distribution. </br>
|
||||||
|
|
||||||
|
Linux:
|
||||||
|
```
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y software-properties-common
|
||||||
|
|
||||||
|
sudo add-apt-repository ppa:git-core/ppa; sudo apt update; sudo apt -y install git
|
||||||
|
```
|
||||||
|
|
||||||
|
## GIT Command line
|
||||||
|
|
||||||
|
Once GIT has been installed, in the command line, type `git`
|
||||||
|
```
|
||||||
|
git
|
||||||
|
|
||||||
|
usage: git [--version] [--help] [-C <path>] [-c <name>=<value>]
|
||||||
|
[--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
|
||||||
|
[-p | --paginate | -P | --no-pager] [--no-replace-objects] [--bare]
|
||||||
|
[--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
|
||||||
|
<command> [<args>]
|
||||||
|
<and more...>
|
||||||
|
```
|
||||||
|
|
||||||
|
## Configure GIT
|
||||||
|
|
||||||
|
We firstly have to tell GIT who we are. </br>
|
||||||
|
For this we set a username and an email. </br>
|
||||||
|
This is very important especially when we are planning to host our repository on Github or another source control provider </br>
|
||||||
|
|
||||||
|
Remember the command `git help -a` which shows us all the available commands ? </br>
|
||||||
|
The one we want to start off with is `git config` </br>
|
||||||
|
note: `git config -a` Also has a `-a` to view all options </br>
|
||||||
|
|
||||||
|
We can configure GIT either globally, so which account to use for all repositories by using the `--global` flag, or only for a single repository by using the `--local` flag :
|
||||||
|
|
||||||
|
```
|
||||||
|
git config --global user.name "devops-guy"
|
||||||
|
git config --global user.email "devops-guy@test.com"
|
||||||
|
```
|
||||||
|
|
||||||
|
After running these commands you should see a `.gitconfig` file created in your user directory. </br>
|
||||||
|
|
||||||
|
```
|
||||||
|
cat $HOME/.gitconfig
|
||||||
|
```
|
||||||
|
|
||||||
|
If we try this command using `--local` we get an error stating that we can only run this inside a GIT repository </br>
|
||||||
|
|
||||||
|
|
||||||
|
## Create your first GIT repository
|
||||||
|
|
||||||
|
To turn a folder into a GIT repo its very simple. We simply run command:
|
||||||
|
|
||||||
|
```
|
||||||
|
# create a folder for our GIT repo called my-website
|
||||||
|
mkdir my-website
|
||||||
|
|
||||||
|
# change directory into our new folder
|
||||||
|
cd my-website
|
||||||
|
|
||||||
|
git init
|
||||||
|
```
|
||||||
|
Now our folder has been turned into a GIT repository
|
||||||
|
|
||||||
|
You can also let GIT create the folder and repository for your:
|
||||||
|
|
||||||
|
```
|
||||||
|
git init my-website
|
||||||
|
```
|
||||||
|
|
||||||
|
## ADD & Commit our first file
|
||||||
|
|
||||||
|
To add a file to our repository, we can simply create a new file. </br>
|
||||||
|
Let's create a home page for our new website called `home.html`:
|
||||||
|
|
||||||
|
```
|
||||||
|
touch home.html
|
||||||
|
```
|
||||||
|
|
||||||
|
Now GIT automatically detects changes and this file is actually not part of the repository yet. </br>
|
||||||
|
To see changes incoming, we can run:
|
||||||
|
|
||||||
|
```
|
||||||
|
git status
|
||||||
|
```
|
||||||
|
|
||||||
|
We'll see one "Untracked file" </br>
|
||||||
|
To add this changes to GIT, we need to stage the file. </br>
|
||||||
|
We do this by using the `git add` command:
|
||||||
|
|
||||||
|
```
|
||||||
|
git add <filename>
|
||||||
|
#or
|
||||||
|
git add -A
|
||||||
|
```
|
||||||
|
|
||||||
|
Now the file becomes green and is ready to commit. </br>
|
||||||
|
We can commit it by running the `git commit` command.
|
||||||
|
|
||||||
|
```
|
||||||
|
git commit -m "new homepage for our website"
|
||||||
|
```
|
||||||
|
|
||||||
|
Now our file has been committed, and `git status` now shows no changes to commit.
|
||||||
|
|
||||||
|
## Making changes
|
||||||
|
|
||||||
|
At the moment, our `home.html` file is empty.So lets go ahead and add some content to it, and commit changes.
|
||||||
|
|
||||||
|
Let's paste the following HTML into this file and save it:
|
||||||
|
|
||||||
|
```
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>My Personal Website</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<header>
|
||||||
|
<h1>My Portfolio</h1>
|
||||||
|
</header>
|
||||||
|
<section>
|
||||||
|
<h2>About Me</h2>
|
||||||
|
<p>Some information about me...</p>
|
||||||
|
</section>
|
||||||
|
<section>
|
||||||
|
<h2>My Skills</h2>
|
||||||
|
<ul>
|
||||||
|
<li>Skill 1</li>
|
||||||
|
<li>Skill 2</li>
|
||||||
|
<li>Skill 3</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
<section>
|
||||||
|
<h2>My Projects</h2>
|
||||||
|
<ul>
|
||||||
|
<li><a href="#">Project 1</a></li>
|
||||||
|
<li><a href="#">Project 2</a></li>
|
||||||
|
<li><a href="#">Project 3</a></li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
<footer>
|
||||||
|
<p>Contact information: <a href="mailto:someone@example.com">someone@example.com</a>.</p>
|
||||||
|
</footer>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
```
|
||||||
|
|
||||||
|
To make the changes, again, we have to stage it first:
|
||||||
|
|
||||||
|
```
|
||||||
|
git status
|
||||||
|
git add home.html
|
||||||
|
git commit -m "add HTML to our personal website"
|
||||||
|
```
|
||||||
|
|
||||||
|
## Branching
|
||||||
|
|
||||||
|
One big benefit of GIT is branching. </br>
|
||||||
|
GIT uses a default branch called `master`. </br>
|
||||||
|
All the work we have done up to now, was done on the `master` branch </br>
|
||||||
|
|
||||||
|
Many times, when working on projects, you may not be ready to commit changes to the repository's main branch yet. </br>
|
||||||
|
Perhaps your changes need further improvement or you are simply not done, but you want to commit your work without impacting others that also may be working on the repository. </br>
|
||||||
|
|
||||||
|
In this case , we would create a feature branch, then `git add` our changes to stage it against the feature branch, then `git commit` the changes there until we are ready to merge to `master`
|
||||||
|
|
||||||
|
|
||||||
|
```
|
||||||
|
┌──────────┐
|
||||||
|
│ │
|
||||||
|
┌──►│ FEATURE ├──┐
|
||||||
|
│ │ │ │
|
||||||
|
│ └──────────┘ │
|
||||||
|
│ │
|
||||||
|
┌────┴─────┐ ┌─────▼────┐
|
||||||
|
│ │ │ │
|
||||||
|
│ MASTER │ │ MASTER │
|
||||||
|
│ │ │ │
|
||||||
|
└──────────┘ └──────────┘
|
||||||
|
```
|
||||||
|
|
||||||
|
To create a new branch, we will use the `git checkout` command, and the `-b` flag to set a branch name. </br>
|
||||||
|
Let's update our website HTML to set some new skills we are working on by using GIT's branching strategy:
|
||||||
|
|
||||||
|
```
|
||||||
|
# lets create a branch called "skills"
|
||||||
|
|
||||||
|
git checkout -b skills
|
||||||
|
git status
|
||||||
|
```
|
||||||
|
|
||||||
|
Let's update our skills to set our first skill to source control:
|
||||||
|
|
||||||
|
```
|
||||||
|
#change
|
||||||
|
<li>Skill 1</li>
|
||||||
|
#to
|
||||||
|
<li>Source Version Control: GIT</li>
|
||||||
|
```
|
||||||
|
|
||||||
|
Now we commit the changes just like we did before. The more we do this, the more comfortable we will become with the comand line, especially as we go further along in this course. </br>
|
||||||
|
|
||||||
|
```
|
||||||
|
git add -A
|
||||||
|
git status
|
||||||
|
git commit -m "set our first skill"
|
||||||
|
```
|
||||||
|
|
||||||
|
## Merging Branches
|
||||||
|
|
||||||
|
To merge branches, we need to make sure we have both branches. In our case, we do have `master` and the `skills` branch.
|
||||||
|
|
||||||
|
Now for interest sake, let's checkout master. Notice when we `cat home.html` to see the content, the content still has our old skill. </br>
|
||||||
|
This is because our changes are on the `skills` branch </br>
|
||||||
|
|
||||||
|
To merge our `skills` branch into `master` we need to be on the `master` branch.
|
||||||
|
|
||||||
|
```
|
||||||
|
git merge skills
|
||||||
|
git status
|
||||||
|
cat home.html
|
||||||
|
```
|
||||||
|
Now we can see our master branch has our skill. So technically we can delete the skills branch now </br>
|
||||||
|
|
||||||
|
To delete the branch:
|
||||||
|
```
|
||||||
|
#see all branches
|
||||||
|
git branch
|
||||||
|
|
||||||
|
#delete an old branch
|
||||||
|
git branch -d skills
|
||||||
|
```
|
||||||
|
|
||||||
|
Remember that `git branch -h` will give us "help" if we need to look at the syntax </br>
|
||||||
|
|
||||||
|
## Cloning repositories
|
||||||
|
|
||||||
|
GIT allows us to clone repositories from hosted GIT servers, like Github, Bitbucket, Gitlab and more. </br>
|
||||||
|
|
||||||
|
It's important to store your code on a hosted GIT repository as it reduces the changes of us losing our work. </br>
|
||||||
|
|
||||||
|
You can host your own GIT server too </br>
|
||||||
|
In this video, we'll be using Github and I'll show you how to clone the repo that contains all this source code and many other tutorials. </br>
|
||||||
|
|
||||||
|
Note that you dont need a Github account to clone repositories as this repo is public.
|
||||||
|
|
||||||
|
```
|
||||||
|
#make sure we are in our respositories folder
|
||||||
|
|
||||||
|
cd gitrepos
|
||||||
|
|
||||||
|
git clone https://github.com/marcel-dempers/docker-development-youtube-series.git
|
||||||
|
|
||||||
|
#show folders and files
|
||||||
|
ls
|
||||||
|
|
||||||
|
cd docker-development-youtube-series
|
||||||
|
ls
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
## UI Tools for GIT
|
||||||
|
|
||||||
|
So far in this guide we've mostly looked at basic tools to edit folder and files as well as a basic terminal for command line work. </br>
|
||||||
|
I have done so on purpose so viewers enjoy familiarity and helps understand the course content at play. </br>
|
||||||
|
|
||||||
|
During our entire course, we will focus primarily on command line as I've outlined the importance of it. </br>
|
||||||
|
However for creating folders, editing files and having a terminal all-in-one its very important to start using whats called an IDE. </br>
|
||||||
|
An IDE is an Integrated Development Environment. </br>
|
||||||
|
Or in simple terms, its a file editor with a built-in terminal, so we can do everything we have done today, but all in one place. </br>
|
||||||
|
|
||||||
|
I will give you some home work to go and install [Visual Studio Code](https://code.visualstudio.com/) </br>
|
||||||
|
|
||||||
|
I will demonstrate in this guide, that VSCode has:
|
||||||
|
|
||||||
|
* Built-in terminal, so we can run `git` commands without leaving the IDE
|
||||||
|
* GIT extension, so we can perform `git add` + `git commit`, all without leaving the IDE
|
||||||
|
* We can create files, manage folders, all without leaving the IDE.
|
2
course/course-diagram.svg
Normal file
2
course/course-diagram.svg
Normal file
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 999 KiB |
74
course/course.md
Normal file
74
course/course.md
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
# 🎓 The Ultimate DevOps Course (early access 🚧)
|
||||||
|
|
||||||
|
This course is my ultimate guide to DevOps engineering for beginners </br>
|
||||||
|
|
||||||
|
<i>🚧 This course is currently under early access and undergoing constant review and updates</i>
|
||||||
|
|
||||||
|
## 🚀 Introduction
|
||||||
|
|
||||||
|
In my many years working in the field, I have noticed a range of challenges and problems that people face when trying to join the DevOps space </br>
|
||||||
|
|
||||||
|
## 🔴The challenges - <i>where to start ?</i>
|
||||||
|
|
||||||
|
<b>DevOps has its challenges:</b>
|
||||||
|
* There is no simple starting point to start learning about DevOps
|
||||||
|
* DevOps requires a very broad range of skills that can be very overwhelming for new people to learn
|
||||||
|
* DevOps is often treated as "Dev" and "Ops" which means you need understanding of two broad fields
|
||||||
|
* DevOps technologies are littered with buzz words, such as cloud, AI, machine learning, CI/CD, scalability, immutable infrastructure, automation, security and it never ends
|
||||||
|
|
||||||
|
<b>Qualifications have its challenges:</b>
|
||||||
|
|
||||||
|
* Universities or Colleges offer IT degrees or courses, which often only cover traditional & "legacy" IT knowledge.
|
||||||
|
* They do not cover real world challenges faced when working with the cloud, or working with popular open source technologies or modern challenges that businesses face these days
|
||||||
|
* These technologies are often evolving at a rapid pace and traditional Universities cannot keep up with these.
|
||||||
|
|
||||||
|
<b>Cloud certifications have its challenges:</b>
|
||||||
|
* Cloud certifications often only focus on a specific cloud provider which can build bias
|
||||||
|
* Often only solve really specific problems, and miss real world problems
|
||||||
|
* Develop very narrow focussed problem solving skill
|
||||||
|
* Miss out on powerful open source skils
|
||||||
|
* Vendor locking
|
||||||
|
|
||||||
|
## 🎯 The solution
|
||||||
|
|
||||||
|
This course provides a practical hands-on roadmap into the world of DevOps and sets you up with all the fundamentals required for success. </br>
|
||||||
|
|
||||||
|
You will create your own personal website during this course which you can use as a marketing tool for your career to demonstrate all your newly learnt skills</br>
|
||||||
|
|
||||||
|
During this course you will apply a wide range of DevOps principals and use modern technologies in a real world hands-on manner to create yourself a personal website. </br>
|
||||||
|
|
||||||
|
You will build the ultimate foundation and be equiped to make more informed discisions on what you want to focus on next in your career. </br>
|
||||||
|
|
||||||
|
## 🛠 System Requirements
|
||||||
|
|
||||||
|
* <b>Operating System:</b> Windows (Pro and Enterprise ), Linux or MacOS
|
||||||
|
* <i>note: You'll need Pro or Enterprise Windows to support Virtualization</i>
|
||||||
|
|
||||||
|
## 📖 Table of Contents
|
||||||
|
|
||||||
|
* [Chapter 1: Source Control & GIT](./chapters/chapter-1-source-control-git/README.md)
|
||||||
|
* 🚧[Chapter 2: Operating Systems](./chapters/chapter-2-operating-systems/README.md)
|
||||||
|
* 🚧[Chapter 3: Monitoring](./chapters/chapter-3-monitoring/README.md)
|
||||||
|
* 🚧[Chapter 4: Web Servers](./chapters/chapter-4-web-servers/README.md)
|
||||||
|
* 🚧[Chapter 4.1: Web Server Monitoring](./chapters/chapter-4.1-web-server-monitoring/README.md)
|
||||||
|
* 🚧[Chapter 5: CI/CD Pipelines](./chapters/chapter-5-ci-cd-pipelines/README.md)
|
||||||
|
* 🚧[Chapter 6: Containers & Docker](./chapters/chapter-6-docker/README.md)
|
||||||
|
* 🚧[Chapter 7: Docker Compose ](./chapters/chapter-7-docker-compose/README.md)
|
||||||
|
* 🚧[Chapter 8: Infrastructure as Code ](./chapters/chapter-8-infra-as-code/README.md)
|
||||||
|
* 🚧[Chapter 9: Introduction to Cloud ](./chapters/chapter-9-intro-to-cloud/README.md)
|
||||||
|
|
||||||
|
## 📖 Where to find the full course
|
||||||
|
|
||||||
|
The Youtube series will cover the course content so you can benefit from the course roadmap for free. </br>
|
||||||
|
However, the YouTube videos are in shorter, edited, summarised form. So although you may benefit from the content, if you are a beginner, you may prefer the long form content where I elaborate, provider more in-depth explanations and cover more examples </br>
|
||||||
|
|
||||||
|
If you are a beginner, I highly recommend you checkout the full course on your favourite platform below:
|
||||||
|
|
||||||
|
* 🚧Coming soon [Udemy ]()
|
||||||
|
* 🚧Coming soon [Teachables ]()
|
||||||
|
* 🚧Coming soon [Youtube Membership ]()
|
||||||
|
* 🚧Coming soon [Patreon ]()
|
||||||
|
|
||||||
|
## Explore the Course
|
||||||
|
|
||||||
|

|
Loading…
x
Reference in New Issue
Block a user