How Do You Find the Port Number That GitLab’s Web UI Uses from the Back-end of a Linux Server?

Problem scenario
You have an existing GitLab set up on a Linux server. You have access to the back-end. You want to find the port number to connect to. How do you do this?

Solution
First find the external IP address (e.g., curl icanhazip)

Second, install nmap (e.g., sudo yum -y install nmap or sudo apt-get -y install nmap).

Three run this command (but replace x.x.x.x with the IP address found in the first step above):
nmap -Pn x.x.x.x | grep open

 » Read more..

How Do You Troubleshoot Triggers in a CI/CD Pipeline That Are Not Functioning?

Problem scenario
You are using Bitbucket and Jenkins. You have configured triggers to happen on certain events. The events have happened, but you see no corresponding action, no alerts or error messages and nothing in any relevant log. What should you do?

Possible solution #1
In Bitbucket, log in. Go to the relevant repository. Then go to Settings -Workflow -Hooks. Enable the “Post-Receive Web Hooks.” If this is disabled,

 » Read more..

When You Have Two Branches in a Git Repo, How Can You Reconcile the Differences When You Merge Them?

Problem scenario
When you have created a branch of a Git repo, and there have been changes made to the master branch and this second branch you created, what are your options?

Possible Solution #1. You can merge the two branches (e.g., with a pull request). One branch will prevail if there are any conflicts. You can select which branch to prevail with GitLab,

 » Read more..

How Do You Change the Indentation of the GUI-Rendering of a File in Bitbucket?

Problem scenario
You are using a web browser and some items in a list are indenting where you do not want them indented. How do you make them line up with the other items in the list without indentation?

Solution
Bitbucket’s rendering of a text file does an auto-indent for natural numbers (with no sub-numbering scheme). If you have this in a file,

 » Read more..

How Do You Get Bitbucket to Render Text in a Regular Size when There Are Hashtag (or Hashmarks, “#”)?

Problem scenario
Bitbucket’s GUI renders Bash code with large text on lines with a “#” hash sign (aka tic-tac-toe sign, number sign, or hash symbol). How do you get the lines to be the same size in Bitbucket GUI rendering?

Solution
Usually the hash sign “#” is a comment (for many programming languages). If you have a space after the hash sign like this “# comments here” (instead of “#comments here”),

 » Read more..

How Do You Write an Ansible Playbook to Retrieve Files from a Directory Relative to where the .YAML File Is?

Problem scenario
You want to refer to files in a subdirectory of the parent directory that houses your Ansible playbook. You have Git repositories with .yaml files and subdirectories. You want the Git repo to be transferred to a variety of different servers. The absolute path to the directory where the files are will vary. How do you have a variable or relative path reference in the playbook so as long as the directory structure is in place,

 » Read more..

What Is The Difference between git merge and git rebase?

Question
What is the difference between git merge and git rebase?

Answer
git merge takes code from one branch and copies it into another branch. One branch will prevail to the extent there are conflicts. (The details of the syntax are beyond the scope of this solution. The git merge operation can be done in a GUI (e.g., via BitBucket).) The published source code would usually change.

 » Read more..

What Is Knowledge of Branching Strategies in the Context of a Build/Release Engineer or DevOps Engineer Job Description?

Problem scenario
You are preparing for an interview for a job where a requirement is “knowledge of branching strategies.” What could you discuss to assure them that you have knowledge of branching strategies?

Solution
Some companies have big development teams whereas others have small teams. The internal dynamics may dictate whether or not you will create a branch of a source code repository or not.

 » Read more..

How Do You Create an Organization in GitHub?

Problem scenario
You want to create an organization in GitHub.

Solution
1. Log into GitHub.
2. Go here: https://github.com/organizations/new

 » Read more..

How Do You Change The Port That GitLab Listens on?

Problem scenario
By default GitLab runs on port 8080.  You want to run something else on the server with GitLab.  How do you change the port that GitLab uses?

Solution
1.  Edit the /etc/gitlab/gitlab.rb file.

Find the stanzas with for the “external_url”.

Change it from this:  http://x.x.x.x/

to this:  http://x.x.x.x:555

(where x.x.x.x is either the external IP address or FQDN of the gitlab server and 555 is the desired non-standard port number that you want GitLab to listen on).

 » Read more..