Skip to main content

Git and Github

This is the first post in a series focusing on implementing a CI/CD pipeline.

The reason we are starting with Git and Github is because you need to have your foundation of source control set before you can set up build tools or continuous integration tools.

A few reflections I have gathered over the past weeks conducting research. First off, everyone working in IT Operations or Software Development needs to watch this video: https://www.youtube.com/watch?v=ecIWPzGEbFc

Sometimes learning about the past allows on to understand the present. As an example, when I first looked at Gradle I was extremely confused. However, when you trace back its genealogy to Apache Ant and then even further back to GNU Make, you can start to understand the landscape of the plethora of tools we have at our disposal in the present. You start to understand how tools have different wrappers around them and fundamentally what they are intended to do. If you are a new Systems Admin, I encourage you to compile Python 3 from source code. This will force you to use the make command and teach you about dependencies etc.

Now on to Git.

Sign up for a Github account. I used a throw away account for training purposes. You can always create an official account when you are ready.

Next on your server complete the following steps:

yum install git

// Verify Installation
git --version

// Add Username and Email information

git config --global user.name "syspleb"
git config --global user.email syspleb@domain.com

// Generate SSH Key

ssh-keygen -t rsa -b 4096

Copy your *Public key* to your Github account by going to Settings and then SSH and GPG keys.
Never, I mean NEVER share, email, discuss, or whisper your private SSH key to anyone. It stays on your server, period.


When you now go to Git clone a Repository: Click the green clone button and make sure you select SSH instead of HTTPS.

If you have set up everything correctly it should look like this:

git clone git@github.com:syspleb/cicd-pipeline-train-schedule-git.git
remote: Enumerating objects: 27, done.
remote: Total 27 (delta 0), reused 0 (delta 0), pack-reused 27
Receiving objects: 100% (27/27), 11.89 KiB | 0 bytes/s, done.
Resolving deltas: 100% (2/2), done.

Some other noteworthy git commands are as follows:


Status: git status

Stage Files: git add -A

Commit: git commit -m "Describe the Change"

Push to Github Repo: git push

Comments

Popular posts from this blog

Veeam Free Linux Agent Install on Centos 7

If you are a junior admin that works with Vmware or Azure, learning Veeam backups can elevate your skills and value. This post will walk through the steps of setting up the free Linux backup agent on a Centos 7 virtual machine. Step 1: Lay the Foundation https://helpcenter.veeam.com/docs/agentforlinux/userguide/system_requirements.html?ver=30 https://helpcenter.veeam.com/docs/agentforlinux/userguide/installation_process.html?ver=30#dep Run uname -r and take note of the kernel version. Make sure you yum install kernel-devel which matches your kernel version In order to install libudev dependency I used yum install systemd-devel For libfuse dependency I used yum install fuse-libs yum install syslinux yum install epel-release yum update -y or yum makecache yum install dkms (If you cant find this package check your epel realease) *Do Not Skip Dependencies* unless they do not apply to your operating system. Footnotes will guide you in the document

Repo Ready

In order to set up your Base Channel you will need some gpg key information from the server. I used the following commands to acquire this information: [root@sw ~]# cd /etc/pki/rpm-gpg/ [root@sw rpm-gpg]# gpg --with-fingerprint RPM-GPG-KEY-CentOS-7 In order to set up the repository for the base channel I used: http://www.gtlib.gatech.edu/pub/centos/7.6.1810/os/x86_64/ Lastly, trying to sync repositories and packages can be extremely taxing on system resources; especially if done via the web GUI. I think this is because it also kicks off some java process as well as the sync. As a work around, close the web GUI completely, and use the following command via CLI: spacewalk-repo-sync -c Insert-Channel-Label Overall I would prefer leaner server provisioning software. My future projects will have less to do with deployments and have more focus on web operations. List of future interest: Nginx Haproxy Varnish Python Jenkins

Groovy Gradle Version 5.3.1

Gradle is an open-source build automation tool focused on flexibility and performance. It has a mature offering of libraries,plugins, and testing. Gradle build scripts are written using a Groovy or Kotlin DSL. Although this post focuses on installation, I also wanted to provide some links for extra value: Plugins can be found @ https://plugins.gradle.org/ Netflix's Glisten is an ease of use Groovy library for building JVM applications with Amazon Simple Workflow Service (SWF) check out https://github.com/Netflix/glisten Lastly, Gradle auto completion can be found @ https://github.com/gradle/gradle-completion Installing Gradle Version 5.3.1 yum makecache yum install unzip yum install bzip2 yum remove java yum install java-1.8.0-openjdk // Confirm Intalled correctly java -version wget https://services.gradle.org/distributions/gradle-5.3.1-bin.zip -P /tmp/ mkdir /opt/gradle unzip -d /opt/gradle /tmp/gradle-5.3.1-bin.zip rm /tmp/gradle-5.3.1-bin.zip vim /etc/pro