diff --git a/course/chapters/chapter-1-source-control-git/README.md b/course/chapters/chapter-1-source-control-git/README.md index 7e0a03c..ffcb8c8 100644 --- a/course/chapters/chapter-1-source-control-git/README.md +++ b/course/chapters/chapter-1-source-control-git/README.md @@ -55,7 +55,7 @@ It is software that helps us deal with software development and engineering. If your harddrive crashes, or you lose your laptop, all your work would be lost.
diff --git a/course/content/source-control/github/README.md b/course/content/source-control/github/README.md new file mode 100644 index 0000000..b90aa70 --- /dev/null +++ b/course/content/source-control/github/README.md @@ -0,0 +1,171 @@ +# Introduction to Github: Hosted Source Control + +## πŸ’‘ Preface + +This module is part of a course on DevOps.
+Checkout the [course introduction](../../../README.md) for more information
+This module is part of [chapter 1](../../../chapters/chapter-1-source-control-git/README.md) + + πŸ“’ Important note: I would highly recommend to checkout module 1 and 2 for an introduction to GIT and VSCode before starting this module + +## What is Github + +Think of Github as a "GIT" in the cloud.
+A remote git server that runs on a server managed by a provider
+Just like you may have the ability to edit documents directly in the cloud instead of running the applications directly on your computer.
+ +Github is an online hosted source control service
+ +So we "stage" and "commit" files to our local GIT repository, we have been using commands like `git add` and `git commit`, we will now look at an additional command like `git push` and concepts of `origin` and `upstreams` and the origin is the GIT server we are pushing to.
+ +Benefits: + +* You project is not hosted on your machine which could fail +* Multiple people working on the same projects + * You can work from multiple devices +* Security features + * access + * auditing +* Review process for changes + +## Create Github Account + +Let's head over to [github.com](https://github.com/) and Sign up.
+ +## Create our first repository + +On the [github.com](https://github.com/), top menu, you will find a `+` button where you can create a new repository
+Create a new repository called `my-website`
+Be sure to mark it as `Private` so only you can view it.
+Once our repository is created, we can navigate it in the Github UI, and we can also make changes using the browser.
+ +## Using GIT with Github + +On the repository page, you will find a `<> Code` button, where we can grab the URL of the repo
+Note that this URL has a `.git` extension
+ +Now back to the command line, but this time instead of using a command line terminal, we can use VSCode, as we have done in the previous module.
+Let's fire up VSCode, enter the terminal and use the command line to make sure we are in our GIT folder
+ + +Then we run `git clone ` +In my case its `https://github.com/marcel-dempers/my-website.git` + +## Git configuration + +In our first module on GIT, we learnt about the `git config` command and have taken a look at the `.git` hidden folder that is part of every repository.
+Inside this `.git` folder, is a `config` file which contains configuration of the repository.
+You have a global config that covers your entire account, as well as the config files per repositories
+ +In this module, we'll configure this repository to use our new Github account specifically with the `git config` command and the `--local` flag + +``` +git config --local user.name "your-username" +git config --local user.email "your-email" +``` + +## Making changes + +### commits +I want to show you that you can perform changes using the Github UI.
+For example, we have a readme file we can change and commit directly using the browser
+ +### history + +We can use the browser to see history of our repository, who made the changes as well as what changes were made
+ +### using GIT and Github + +Although we can make direct changes in the UI, most of the time its better to make changes on your local machine
+In our VSCode, let's go ahead and make some changes and follow the GIT process as we have done before, but this time we will push the changes up to Github.
+ +* `git add` to stage changes +* `git commit` to commit our staged change +* `git push origin master` to push our changes up to the origin + + note: In Git, "origin" is a shorthand name for the remote repository that a project was originally cloned from. + +Notice we get an error. This is because our local repository main branch is out of sync, because we do not have the latest changes we made to the readme file
+ +* `git pull` to get the latest changes + +Now we should be able to push again.
+And in Github, we can see the change history + +### branching + +Now in GIT, we covered branching, and we created a branch in the first module, using the `git checkout -b` command.
+Let's do that again and revise our newly learnt skills + +``` +git checkout -b github-skills +``` + +We can make our changes and follow the `git add` , `git commit` & `git push origin github-skills` to push these changes + +### Pull requests + +Now in Github, we can see the new branch, we can check the history on that branch and we can raise what's called a `Pull request` to propose to merge these changes into our main branch
+ +Pull requests gives us the opportunity to review the changes
+We can raise a pull request using the Github UI
+The Github UI provides a way for people to review, leave feedback, maybe request additional changes, and to approve the pull request
+Once merged, the feature branch can be deleted.
+ +Now back to our terminal we can switch back to our main branch using `git checkout master`. +And pull the latest changes `git pull origin master` + +By now, you should start to get comfortable with the GIT commands, and I would encourage you to build muscle memory with these commands and try to make additional changes to your website code. You can also use the README file as practise + +Learn to repeat: +* `git status` +* `git add` +* `git commit` +* `git push origin master` +* `git pull origin master` + + +### Issues + +In Github, we can track tasks or work items by creating "Issues"
+The issues page can be used for various types of work items. They could be actual issues like problems with software, bugs etc. Or improvements and suggestions, or just a to-do list of tasks you would like to complete for this repository.
+ +* We can assign an issue to people. +* We can label issues. +* We can track issues by adding them to Github Projects. +* We can also link issues to a pull request that will fix or complete the issue if it's merged. + +### Actions + +Github actions is all about automation
+Creating a Github action will create a YAML file in your repository that allows you to setup some automation task
+ +Actions will run based on triggers
+ +This is very useful in DevOps because as you may know, DevOps is all about automation. Automation activities generally involve trigger points.
+Like "when this happens, run this pipeline"
+For example: "when code is pushed to a repository, then:" + +* trigger a build pipeline +* trigger tests +* trigger a deployment + +For DevOps, automation will service a wide variety of technical aspects, such as patching and updating a server, deploying software automatically, send monitoring alerts and more
+ +### Projects + +Github Projects is a page where we can manage Github issues we saw earlier and we can manage project timelines, roadmaps and kanban style boards to manage work item tasks for our repositories
+ +## VSCode integration + +Now it's worth showing you that VSCode also has integration to GIT. +You can create a branch, checkout different branches, stage and commit changes as well as pull and push
+ +## Settings + +Repository settings allow us to : + +* Manage collaborators, by adding people or teams to our repository. +* Branch protection, allowing us to configure rules when people push to branches, like enforcing review processes +* Github Actions, for running pipeline workflows on our repository + - we will take a look at this in our automation guides diff --git a/course/course-diagram.svg b/course/course-diagram.svg index db516fe..5e9fc5d 100644 --- a/course/course-diagram.svg +++ b/course/course-diagram.svg @@ -1,2 +1,2 @@ -


- module: intro to GIT
- module: intro to IDEs and VSCode
- module: intro to GIT...
START HERE
START HERE
Course Introduction
Course Introduction

Chapter-1

Source controlΒ & GIT

Chapter-1...
Intro to GIT
Source Control
Intro to GIT...
1
1
Intro to Github
HostedSource Control
Intro to Github...
3
3
Intro to IDEs
VSCode
Intro to IDEs...
2
2


- module: intro to OS
- module: intro to servers & VMs
- module: intro to linux & command line
- module: intro to OS...

Chapter-2

Operating Systems

Chapter-2...
Intro toΒ 
Operating Systems for DevOps
Intro to...
Intro toΒ 
Servers &
Virtualisation
Intro to...
Intro toΒ 
Linux
Intro to...
Intro toΒ 
Command Line
Intro to...
Bash Scripting
for Beginners
Bash Scripting...


- module: intro to linux monitoring
- module: monitoring dashboards
- module: intro to linux monitoring...

Chapter-3

Monitoring

Chapter-3...
Intro toΒ 
Linux Monitoring
Intro to...
Introduction toΒ 
Grafana
Introduction to...
Introduction toΒ 
Prometheus
Introduction to...
-Β HTTP and status codes
- DNSΒ 
- SSL
Β  Β  - TCP \ UDP , portsΒ 
Β  Β  - Testing network accessΒ 
Β  Β  - Testing port is open
- Scripting (bash)Β Β \ automation
-Β HTTP and status codes...

Chapter-4

Web Servers

Chapter-4...
Intro to Web Servers
Intro to Web Ser...
Creating Web Servers with NGINX
Creating Web Ser...
The Basics of HTML and Web
The Basics of HT...
Create your own personal website
Create your own...
Get free SSL certificates
Get free SSL cer...
- Web Server Logs
- Web Server Metrics
- Web Server Logs...

Chapter-4.1

Web Server

Monitoring

Chapter-4.1...
Monitoring Logs
with Grafana Loki
Monitoring Logs...
Monitoring Logs
with fluentd
Monitoring Logs...
- What are CI/CD
- What is a pipeline
- Automation
- Deployments
- What are CI/CD...

Chapter-5

CI / CD Pipelines

Chapter-5...
Setup a basic CI/CD pipeline
Setup a basic C...
What is CI/CD
What is CI/CD
Automate Website Deployments
Automate Websi...
-Β what are containers and why they exist
- challenges with our web server
- how docker solves it,
- create docker fileΒ 
- run container scriptΒ 
-Β what are containers and why they exist...

Chapter-6

Docker & Containers

Chapter-6...
Intro to Docker
Intro to Doc...
Migrate our Website to Docker
Migrate our We...
-Β benefits of compose
- no script needed
- can easily start and build container with short command
-Β  can run many containers
- less scripts
-Β benefits of compose...

Chapter-7

Docker Compose

Chapter-7...
Intro to Docker Compose
Intro to Docker...
Creating a Compose file
Creating a C...
- what is infrastructure as code ?
- IaC Tools
- Terraform
- Cloud Init
- Automation
- what is infrastructure as code ?...

Chapter-8

Infrastructure as Code

Chapter-8...
- What is the cloud
- Virtual Machines in the Cloud
- Examples
- Migrate our servers to Cloud
- What is the cloud...

Chapter-9

Introduction to Cloud

Chapter-9...
Intro to IaC
Intro to IaC
Intro to Cloud Init
Intro to Cloud...
Intro to Terraform
Intro to Terr...
🚧 under construction
🚧 under construction
✍🏽 pre-production
✍🏽 pre-production
%3CmxGraphModel%3E%3Croot%3E%3CmxCell%20id%3D%220%22%2F%3E%3CmxCell%20id%3D%221%22%20parent%3D%220%22%2F%3E%3CmxCell%20id%3D%222%22%20value%3D%22%F0%9F%8E%AC%22%20style%3D%22text%3Bhtml%3D1%3Balign%3Dcenter%3BverticalAlign%3Dmiddle%3Bresizable%3D0%3Bpoints%3D%5B%5D%3Bautosize%3D1%3BstrokeColor%3Dnone%3BfillColor%3Dnone%3BfontSize%3D28%3BfontColor%3D%2300FFFF%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%3CmxGeometry%20x%3D%22-1960%22%20y%3D%22295%22%20width%3D%2260%22%20height%3D%2250%22%20as%3D%22geometry%22%2F%3E%3C%2FmxCell%3E%3C%2Froot%3E%3C%2FmxGraphModel%3EΒ 
πŸš€Β ready
%3CmxGraphMo...
πŸš€
πŸš€
✍🏽
✍🏽
🎦
🎦
🚧
🚧
🚧
🚧
🚧
🚧
✍🏽
✍🏽
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
1
1
2
2
3
3
4
4
5
5
✍🏽
✍🏽
🎦 production
🎦 production
🎦
🎦
%3CmxGraphModel%3E%3Croot%3E%3CmxCell%20id%3D%220%22%2F%3E%3CmxCell%20id%3D%221%22%20parent%3D%220%22%2F%3E%3CmxCell%20id%3D%222%22%20value%3D%22%F0%9F%8E%AC%22%20style%3D%22text%3Bhtml%3D1%3Balign%3Dcenter%3BverticalAlign%3Dmiddle%3Bresizable%3D0%3Bpoints%3D%5B%5D%3Bautosize%3D1%3BstrokeColor%3Dnone%3BfillColor%3Dnone%3BfontSize%3D28%3BfontColor%3D%2300FFFF%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%3CmxGeometry%20x%3D%22-1960%22%20y%3D%22295%22%20width%3D%2260%22%20height%3D%2250%22%20as%3D%22geometry%22%2F%3E%3C%2FmxCell%3E%3C%2Froot%3E%3C%2FmxGraphModel%3EΒ βœ…Β published
%3CmxGraphModel...
✍🏽
✍🏽
0
0
1
1
2
2
3
3
4
4
4.1
4...
5
5
6
6
7
7
8
8
9
9
Text is not SVG - cannot display
\ No newline at end of file +


- module: intro to GIT
- module: intro to IDEs and VSCode
- module: intro to GIT...
START HERE
START HERE
Course Introduction
Course Introduction

Chapter-1

Source controlΒ & GIT

Chapter-1...
Intro to GIT
Source Control
Intro to GIT...
1
1
Intro to Github
HostedSource Control
Intro to Github...
3
3
Intro to IDEs
VSCode
Intro to IDEs...
2
2


- module: intro to OS
- module: intro to servers & VMs
- module: intro to linux & command line
- module: intro to OS...

Chapter-2

Operating Systems

Chapter-2...
Intro toΒ 
Operating Systems for DevOps
Intro to...
Intro toΒ 
Servers &
Virtualisation
Intro to...
Intro toΒ 
Linux
Intro to...
Intro toΒ 
Command Line
Intro to...
Bash Scripting
for Beginners
Bash Scripting...


- module: intro to linux monitoring
- module: monitoring dashboards
- module: intro to linux monitoring...

Chapter-3

Monitoring

Chapter-3...
Intro toΒ 
Linux Monitoring
Intro to...
Introduction toΒ 
Grafana
Introduction to...
Introduction toΒ 
Prometheus
Introduction to...
-Β HTTP and status codes
- DNSΒ 
- SSL
Β  Β  - TCP \ UDP , portsΒ 
Β  Β  - Testing network accessΒ 
Β  Β  - Testing port is open
- Scripting (bash)Β Β \ automation
-Β HTTP and status codes...

Chapter-4

Web Servers

Chapter-4...
Intro to Web Servers
Intro to Web Ser...
Creating Web Servers with NGINX
Creating Web Ser...
The Basics of HTML and Web
The Basics of HT...
Create your own personal website
Create your own...
Get free SSL certificates
Get free SSL cer...
- Web Server Logs
- Web Server Metrics
- Web Server Logs...

Chapter-4.1

Web Server

Monitoring

Chapter-4.1...
Monitoring Logs
with Grafana Loki
Monitoring Logs...
Monitoring Logs
with fluentd
Monitoring Logs...
- What are CI/CD
- What is a pipeline
- Automation
- Deployments
- What are CI/CD...

Chapter-5

CI / CD Pipelines

Chapter-5...
Setup a basic CI/CD pipeline
Setup a basic C...
What is CI/CD
What is CI/CD
Automate Website Deployments
Automate Websi...
-Β what are containers and why they exist
- challenges with our web server
- how docker solves it,
- create docker fileΒ 
- run container scriptΒ 
-Β what are containers and why they exist...

Chapter-6

Docker & Containers

Chapter-6...
Intro to Docker
Intro to Doc...
Migrate our Website to Docker
Migrate our We...
-Β benefits of compose
- no script needed
- can easily start and build container with short command
-Β  can run many containers
- less scripts
-Β benefits of compose...

Chapter-7

Docker Compose

Chapter-7...
Intro to Docker Compose
Intro to Docker...
Creating a Compose file
Creating a C...
- what is infrastructure as code ?
- IaC Tools
- Terraform
- Cloud Init
- Automation
- what is infrastructure as code ?...

Chapter-8

Infrastructure as Code

Chapter-8...
- What is the cloud
- Virtual Machines in the Cloud
- Examples
- Migrate our servers to Cloud
- What is the cloud...

Chapter-9

Introduction to Cloud

Chapter-9...
Intro to IaC
Intro to IaC
Intro to Cloud Init
Intro to Cloud...
Intro to Terraform
Intro to Terr...
🚧 under construction
🚧 under construction
✍🏽 pre-production
✍🏽 pre-production
%3CmxGraphModel%3E%3Croot%3E%3CmxCell%20id%3D%220%22%2F%3E%3CmxCell%20id%3D%221%22%20parent%3D%220%22%2F%3E%3CmxCell%20id%3D%222%22%20value%3D%22%F0%9F%8E%AC%22%20style%3D%22text%3Bhtml%3D1%3Balign%3Dcenter%3BverticalAlign%3Dmiddle%3Bresizable%3D0%3Bpoints%3D%5B%5D%3Bautosize%3D1%3BstrokeColor%3Dnone%3BfillColor%3Dnone%3BfontSize%3D28%3BfontColor%3D%2300FFFF%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%3CmxGeometry%20x%3D%22-1960%22%20y%3D%22295%22%20width%3D%2260%22%20height%3D%2250%22%20as%3D%22geometry%22%2F%3E%3C%2FmxCell%3E%3C%2Froot%3E%3C%2FmxGraphModel%3EΒ 
πŸš€Β ready
%3CmxGraphMo...
πŸš€
πŸš€
✍🏽
✍🏽
🚧
🚧
🚧
🚧
🚧
🚧
✍🏽
✍🏽
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
1
1
2
2
3
3
4
4
5
5
✍🏽
✍🏽
🎦 production
🎦 production
🎦
🎦
%3CmxGraphModel%3E%3Croot%3E%3CmxCell%20id%3D%220%22%2F%3E%3CmxCell%20id%3D%221%22%20parent%3D%220%22%2F%3E%3CmxCell%20id%3D%222%22%20value%3D%22%F0%9F%8E%AC%22%20style%3D%22text%3Bhtml%3D1%3Balign%3Dcenter%3BverticalAlign%3Dmiddle%3Bresizable%3D0%3Bpoints%3D%5B%5D%3Bautosize%3D1%3BstrokeColor%3Dnone%3BfillColor%3Dnone%3BfontSize%3D28%3BfontColor%3D%2300FFFF%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%3CmxGeometry%20x%3D%22-1960%22%20y%3D%22295%22%20width%3D%2260%22%20height%3D%2250%22%20as%3D%22geometry%22%2F%3E%3C%2FmxCell%3E%3C%2Froot%3E%3C%2FmxGraphModel%3EΒ βœ…Β published
%3CmxGraphModel...
✍🏽
✍🏽
0
0
1
1
2
2
3
3
4
4
4.1
4...
5
5
6
6
7
7
8
8
9
9
πŸš€
πŸš€
Text is not SVG - cannot display
\ No newline at end of file