Episode V – The Last DevOps

This is the last part of a DevOps related topics series:

I’ll be talking about the previous blogposts, if you want to read them here they are:

Bring balance to DevOps culture, image from this medium post

So… DevOps?

Though the 3 previous parts, we practiced our Continuos Integration. We built and test (and did some kind of monitoring) to a central repository after “automated” builds tests are run.

“Continuous Integration doesn’t get rid of bugs, but it does make them dramatically easier to find and remove.”

Martin Fowler, another guru of software as Kent Beck

So I learned that DevOps is helpful for finding errors quicker than waiting until the end. Sometimes you don’t know the failures that might happen outside the local environment.

The Goats

Cheating a bit with Jenkins

Jenkins is a good option if you want to build at a bigger scale. This is an open source automatization server written in Java, advantages of using it:

  • Continuous integration an delivery
  • “Easy” installation and configuration
  • Has hundreds of plugins
  • Extensible and Distributed.

I know that a lot of companies use Jenkins because it makes the DevOps practices a lot easier, since it has a lot of flexibility.

But not everything is color pink. One of its advantages can be a double edge sword, the fact that is OpenSource. Therefore some issues might take longer to fix. Also the migration from an old instance to the newest is a big pain (real work-life situation).

Excise Task

By this day, I had this question twice in my Testing course exam, “What’s the deal with excise tasks?”

Excise is all the extra stuff we have to do, what it costs, or the time spent on the project. For example, buying licenses, researching, money used on testing. These tasks consume a lot of our time. I believe this is natural, that excise tasks take more time that actual revenue.

Off topic – Exam week

This post won’t have the minimum quality I would expect for my regular blogposts. But what would you expect from a post I’m writing a Friday Night/Saturday morning at 1:20am?

Taken from neatoday

I just finished all my hard exams and started to felt weird for doing nothing, so writing a post for this blog was a partial terrible? solution. I’m 100% sure this will change tomorrow morning after waking up for the first time in 6 days of sleeping ULTRA late. I didn’t left things until the end this time, but the fact that I’m a graduate candidate makes everything worse. It’s like being the guy who will kick the last penalty in a final of the FIFA world cup. A mistake can decide of whether I graduate or not.

Image taken from here

CENEVAL exam, student loans documentation, and exams week merge into a short period of time. But I have faced this kind of stress at least once every single semester during the 5 years of college and every time I have survive. I thank all my friends and family that have supported me to become the person I’m today. A person who can write a blogpost of DevOps and only speak about it for 1/3 part.

I learn basics of DevOps and realized that 90% of the time doing the code was trying to figure out why it didn’t work, therefore it was excise.

Don’t you know it’s gonna be alright?

The Beatles -Revolution

Episode IV – JUnit Awakens

Welcome back to a series of blogposts about how to set up a little server in a Linux Virtual Machine, in this post we will lean JUnit and status

if you are not familiar to the topic you can go to the first, second or third part of the series

JUnit via command line

Set up (again?)

First be sure you have Java in the machine (We did this in the last part)

Lovely Ubuntu LTS Interface

Be sure you can compile Java files

I created a class so we can see everything is working fine

Download Junit archive

Download latest version of JUnit jar file from http://www.junit.org, the easiest way in Ubuntu TLS is the wget command. (link in image description)

So type: wget https://github.com/downloads/junit-team/junit/junit-4.10.jar

Create actual tests

My Hello class was pretty much useless. So I take the example from the JUnit Team. And I created two files (these are literally copy-pasted from their repo: https://github.com/junit-team/junit4

Compile!

We have to do the command javac -cp .:junit-4.XX.jar:hamcrest-core-1.3.jar Calc^CatorTest.java (remove the XX for your version)

In my case since I have the junit-4.10.jar, I put 10

Run the test

Enter the command:

java -cp .:junit-4.10.jar:hamcrest-core-1.3.jar org.junit.runner.JUnitCore CalculatorTest

Oh lala, JUnit is running at Ubuntu LTS!

Setup status page

It’s time to do some testing with our cron jobs. First I’ll power up my server.

Remember node command doesn’t exist in our environment, instead it’s nodejs.

So then I implemented a logger in my JUnit tes for the CalculatorTest.java, based on this post of stack overflow

Logger in my test

And I also created a file watcher in my serve so when it detects that my file with the error output it writes “Build” in my readme

npm install node-watch
So sadly it just change the file when it pass, but it doesn’t push it for some reason 😦

I had a very bad time with this easy example. So I don’t wanna know about the professional DevOps (DevOperators?)

Readme Test

How could you update the README page on your repository to reflect the build status using this setup?

Episode III – The Return of DevOps (SSH & Git)

Welcome back to a series of blogposts about how to set up a little server in a Linux Virtual Machine, in this post we will lean about Github and SSH

if you are not familiar to the topic you can go to the first or second part of the series

Ensure that you have your GitHub account.

Before you start you should have a Github account.

You can follow me @kevintroko (for some reason)

Ensure that you have a repository created for testing.

If you followed the last part we had a web server created in node, we will use this. This will be our root.

Setup your GitHub two-factor authentication.

This part is a step forward process and Github explain it 100 times better than me, but I’ll explain it anyways in case you don’t want to move to another site. It’s really nothing from the other world, is more just following a series of steps:

Go tho the git setting and click in the security tab


Click the enable two factor button

Follow the steps in the site

⚠️ ⚠️ DONT FORGET TO SAVE YOUR RECOVERY CODES ⚠️⚠️

They send you a mai anyways

You are ready

Github SSH keys Setup

This is a little bit harder than the last step, the Github team explain it as well (though some commands don’t work the same for ubuntu)

ssh-keygen -t rsa -b 4096 will create a SSH key with a 4096 encryption
ssh-keygen -t rsa -b 4096 -C “put your own email”
They will ask you for the passphrase
Enter your pass phrase from the last step
It will generate the next output
eval the ssh agent
The GitHub page recommend to get the RSA key like this, but ubuntu won’t recognize natively this command, you can just cat the file instead

Ensure that you can do a git clone (use ssh) to your server from your repository.

Clone the repo with ssh as ssh://git@github.com/<your username>/<repo name>.git
Node running

Be sure to create a token because then it will not allow you to push the new data

Episode II – DevOps Strikes Back

Welcome to a series of blogposts about how to set up a little server in a Linux Virtual Machine, if you are not familiar to the topic you can a little more about in here (which is the first part of the series)

Install a Linux distribution

For this task, I chose the Ubuntu 18.04.1 LTS which runs in Virtual Box. This is the same I use for other courses (maybe this is not a good idea). If you would like to download the same Linux distribution, you can install this “old” mini iso from ubuntu.

Lovely ubuntu running in my VM

Other Linux distributions (thanks to @ken_bauer for the links) :

Install support for your development environment.

The next step you can choose the language you like the most, but for this project I will use Java. Here is a very well explained tutorial in case you want to install Java in your Linux system

Java download process example
Java in action

Next step will be to set up the Github for pushing into a git repository

git in action, this is very important for the future steps

Setup web deployment.

I decided to use Node.js as my option for the web development. Be careful because for the Linux 18.04.1 LTS the typical node command has to be instead nodejs as seen in the next example

Node js server running on local host port 8080

Setup your 

This is the trickiest part, I’d recommend to first read the first test use of Cron in case you have never used it before, in other case, then just set it up for your desired functionalities

The background may seem different because I used the ITerm with ssh access to my VM