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).
…
Continue reading “How Do You Change The Port That GitLab Listens on?”
Problem scenario
You try to test an Integration, specifically a Webhook, in GitLab. The URL is for Jenkins. You get “Execution expired.” What could be wrong?
Possible solution #1
See if the GitLab’s IP address or hostname changed. If the external_url stanza in /etc/gitlab/gitlab.rb uses an old IP address or FQDN, then that may need to be updated. You may need to run “sudo gitlab-ctl reconfigure” again.
…
Continue reading “How Do You Troubleshoot a GitLab Webhook Failing Because of “Execution expired”?”
Problem scenario
You are trying to configure GitLab to work with Jenkins (so the two are integrated to enable CI, continual integration, in your environment). When you test a connection of an integration webhook from GitLab to reach out to Jenkins you receive this error:
“Hook executed successfully but returned HTTP 403… No valid crumb was included in the request.”
What should you do?
Solution
Possible solution #1
Warning: This is not a recommended practice.
…
Problem scenario
A GitLab webhook (aka integration) fails. It used to work as an integration mechanism with Jenkins. The GitLab error message says:
“500 <!DOCTYPE html> … at org.jenkinsci.main.modules.instance_identity.InstanceIdentity.get(InstanceIdentity.java:133)”
Solution
Go to the Jenkins server and reinstall the GitLab plugins.
…
Updated and re-tested on 9/24/19
Problem scenario
You read about what Jenkinsfiles are. Coveros.com defines them as ‘Jenkinsfiles, using a domain specific language based on the Groovy programming language, are persistent files that model delivery pipelines “as code”, containing the complete set of encoded steps (steps, nodes, and stages) necessary to define the entire application life-cycle.’
You want to use a Scripted Pipeline in Jenkins (via a Jenkinsfile).
…
Continue reading “How Do You Use a Jenkins Pipeline with a Scripted Syntax?”
Problem scenario
You have two Linux servers (server A and server B). You have a Git repository on server A. You are logged into server B as jdoe. You cloned a Git repository from server A (with a “git clone git@gitlabFQDN:/path/to/nameOfRepo.git” command). You added some files and used “git commit” on server B. From server B you run this command as the Linux user jdoe: git push origin master
You get this problem:
remote: GitLab: You are not allowed to upload code for this project.
…
Problem scenario
You read about what Jenkinsfiles are. Coveros.com defines them as “Jenkinsfiles, using a domain specific language based on the Groovy programming language, are persistent files that model delivery pipelines “as code”, containing the complete set of encoded steps (steps, nodes, and stages) necessary to define the entire application life-cycle.”
How do you use a Jenkinsfile with Declarative pipeline syntax?
Solution
Overview
A Declarative pipeline syntax has four mandatory sections with each of these reserved words: agent,
…
Problem scenario
You have a Git repository that is protected in a GitLab project. You want to allow developers to upload code directly to the master branch (not alternative branches). What do you do?
Solution
It may be more advisable to work with a branch of a git repository. This is a basic solution for testing or those instances when you want to work directly with the master branch.
…
Continue reading “How Do You Unprotect a Git Repository That Is in a GitLab Project?”
Problem scenario
In a Jenkins job there is a “Source Code Management” section. You checked Git and entered credentials. You entered the same username twice (or more). Now you want to delete some of those users to be able to know which (unique) password is being used. What should you do?
Solution
It isn’t always easy to find where the credentials for your Git repository are stored.
…