DEV Community

Cover image for Becoming DevOps
Rhaqim
Rhaqim

Posted on

Becoming DevOps

I have no clue what I'm doing
I got a job a few months ago as a Golang Developer and I was ecstatic to finally work on a project that uses Go. For the past 3 years, I worked with Python and Node and had self-taught Go. I was eager to work on production-level code and not just my personal projects (of which I had built a lot), so when the opportunity came, I jumped at it. Due to some circumstances, I had to work on the project alone and I was left to manage a lot of the codebase, not just backend alone now but also frontend. The most troubling part, however, had to do with deployments.

All deployments were done manually, which meant that changes were slow and dependent on a developer. I had never really handled anything related to DevOps, but I knew there had to be an easier way to do this. But first, I needed to understand how the deployment even worked.

Given access to the server, I had no idea where to start or even what I was looking for. There was tech I had never worked with before like an Nginx server and podman which is similar to Docker (the only technology I am familiar with) and can work in tandem with it. There was a lot of work to be done and I lot I didn't understand so I got creative.

Noob DevOps
From my previous job, the developers were kind enough to explain how a lot of stuff on servers work, so I learned about SSH and I encourage everyone to learn about it as well. I knew security was a priority and gaining access to a server securely was possible with SSH.

Now that I was in the server though, I had no idea where to go next. I did remember there was a command called history that would show me a lot of the previous commands that had been typed, and I figured piecing them together would help me build a mental map of what was going on. Through history, I could recreate the manual deployments for a lot of the services. I read up on Podman and realized a lot of the commands were very similar to Docker, so that saved me a lot of time.

Nginx was a different beast entirely. I had never worked with it before; I had heard about it and was scared of it. I thought it was some mythical technology that only high-tech wizards could use. I was wrong, of course. It was set up already, so I didn't have to worry about that part, but I did need to understand the configurations and how sites-available links to sites-enabled. By the way, you can do this by running the command:

   sudo ln -s /etc/nginx/sites-available/meme /etc/nginx/sites-enabled/meme
Enter fullscreen mode Exit fullscreen mode

This took me way longer than I would like to admit to figure out.

I figured out the syntax like server, location, alias (this one is really important), and then I set up my own service just to see that I could. It ended up being very important later on.

Once I got everything I wanted, I put them together in a bash script and tested that they all worked correctly. After a lot of trial and error, I got a working version. However, I still needed to SSH into the server to run these scripts for any change I made.

By the Power of Github Actions
A small job I did 2 years ago required me to use Github actions for a Slack channel, my manager at the time wasn't great so it didn't leave me with a great experience but I remembered how easy it was to setup and run. I read the documentation again and then went to work.

  • First I found a workflow that catered to what I was trying to do
  • Next I adjusted the YAML script, I configured them to run on the branches I wanted
  • I setup the secrets the workflow needed, they can be found in the settings on your repo
  • Lots and lots of tests After many a rotation on the axis I finally had what I wanted, now whenever I pushed new code to the configured branches I can rest assured that the code would be deployed.

Now my transformation was complete the noob had become slightly less noob

salt bae meme sprinklin dev ops terminology like docker multi build

It was fun
Looking back, it was an exhilarating and educational experience. I transitioned from feeling completely lost to setting up a streamlined deployment process. I went from being a complete novice in DevOps to automating my deployments with GitHub Actions. The journey taught me a lot about perseverance, the importance of continual learning, and the satisfaction of overcoming technical challenges. While there were many frustrating moments, the triumphs made it all worthwhile.

Top comments (0)