Questions tagged as ['gitlab']
In the after_sctipt section, if the script section fails or success, still it runs as I keep allow_failure: true But, how to check in after_script that whether script section failed/success so that I can pass the same in some api call in the after_script

I have a GitLab Runner installed on a Ubuntu server. It uses 'docker' executor.
I want every CI job which executes on this runner to use the same Ruby gems cache, to prevent downloading from rubygems.org the same version several times in a row.
There seems to be two solutions:
Use
cache:
instruction in.gitlab-ci.yml
. I don't like that because I would have per-project cache instead of single cache ...
The server which I deploied Gerrit's OS is Ubuntu 18.04.05
, and my Gitlab server's IP address is 192.168.0.167
. I tried using replication
plugin to push gerrit project to local Gitlab server. My gerrit_site/etc/replication.config
file likes below:
[remote "test_project"]
url = git@192.168.0.167:testuser/test_project.git
push = +refs/heads/*:refs/heads/*
push = ...
As part of automation in gitlab ci.
I am running a terraform template and creating a linux machine.
After that, I need to run few commands on the remote machine. I am running those using the ssh remote command. But at the end, even if it is failure, it is showing as successful.
Please let me know how to setup this kind of environment. Installing any tool as a step is also feasible

I am running a gitlab runner and I want each job to put itself into its own cgroup.
I can set the gitlab bash subprocess to the right cgroup, but its children don't inherit the cgroup.
This is how I'm doing it:
$ /usr/bin/ps -opid,cgroup $PPID $$
PID CGROUP
43547 11:blkio:/user.slice,9:devices:/user.slice,7:pids:/user.slice,6:memory:/user.slice,2:cpuacct,cpu:/user.slice,1:name=systemd:/user.slice/use ...
With below pipeline job, I am getting syntax error.
Found errors in your .gitlab-ci.yml:
jobs:test-artifact:script config should be a string or a nested array of strings up to 10 levels deep
You can also test your .gitlab-ci.yml in CI Lint
Some one suggested to keep the : part in double quotes but it is already part of it.
test-artifact:
stage: build
allow_failure: false
needs: ...
I hope somebody can help me.
Well, I'm building a server (CentOS) with Gitlab, Gitlab-Runner, docker, and Kubernetes to CI/CD.
GitLab information
Version: 14.10.2
Revision: 07d12f3fd11
Directory: /opt/gitlab/embedded/service/gitlab-rails
DB Adapter: PostgreSQL
DB Version: 12.7
Gitlab-Runner
Version: 14.10.1
Docker
Version: 20.10.15
Kubernetes
# kubectl v ...

Previously in my helm chart, I had the snippet below...
minio:
replicas: 1
persistence:
enabled: true
existingClaim: minio
#size: 10Gi
serviceType: LoadBalancer
Because I do have an existing PVC that I intend to use with Minio. It worked fine, up until a couple months ago, when GitLab changed their chart format up.
Now, it shows that I can set minio.persistence.volumeName
to use an e ...

We have created a wrapper executable for our product with python setup tools.
with aws machine, it is running and even in docker container.
But when I run the same command in gitlab runner with same docker image, I am getting error as below.
But when I run the same command in gitlab runner, I am getting error as below.
HTTPConnectionPool(host='169.254.169.254', port=80): Max retries exceeded with url: ...
I want to run amazon linux commands as part of gitlab pipeline.
So, trying to use docker image as runner, amazonlinux:latest
So, connected to docker container and ran below command.
yum -yq install aws-cli
It installed aws-cli
Then, configured aws cli.
aws configure set region $AWS_REGION
aws configure set aws_access_key_id $AWS_ACCESS_KEY
aws configure set aws_secret_access_key $AWS_SECRET_KEY
aws con ...

I have a gitlab runner configured in the aws ec2 instance.
For any aws deployments, we simply added the role to the ec2 instance.
But, our gitlab runner is configured in one aws account. And we need to apply aws terraform templates on a different account(not IAM, complete different root account).
How to give gitlab runner permission to this different aws account

I'm having a problem where putty's key forwarding (via pageant) to my gitlab server isn't working. I'm doing a putty session to my server, with ssh auth forwarding enabled. I see the effects of that forwarding in the environment variables on the remote system.
Here's a transcript from an attempt that is not working. This is in a putty window.
login as: elyograg
Authenticating with public key "elyog ...
I am part of a small physics research team (10-15 people) which recently has acquired a storage server and I will be responsible for setting it up. As such, I needed to think the best way to organize the data we will be generating.
When researching the best way to do this, I came across git lfs. We already use GitLab (the cloud version) to version control our codes and easily share them between u ...
I am having an issue on login to docker from my Ubuntu 18.04.5 LTS
This is the command I run to login docker
sudo docker login -u myname -p mypass
This is the error I've got
Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
I did searches on google and seems it is not quite a common ...

I have an Ansible Tower installation and a lot of playbooks in Gitlab projects. Several projects make use of vault files, i.e. they contain credentials for a VMware VCenter.
Whenever I start a new project/playbook, I keep making copies of vault files from project to project because in Ansible Tower I can't access more than one GitLab project at once. That leads to vault files scattered all over m ...
for my company I have been tasked with creating a standard configuration and template for an (EKS) Kubernetes cluster in Terraform that can be deployed using GitLab CI/CD. The deployment and configuration has been done for a while, but I have been struggling with the template side of things.
Here's my task: create a template project/repo with configuration that someone else can copy and edit.
Howeve ...
I have custom image where I want to run some tests which require installed app which in turn need openGL context. I can run it in container composed this way and manually build project and run tests. docker-compose.yml
:
version: "3.6"
image: registry.gitlab.com/my_image_path:latest
volumes:
- /tmp/.X11-unix/:/tmp/.X11-unix
- /var/run/dbus:/var/run/dbus
- /dev/shm:/dev/shm
privileged: true
...
I'm trying to make Gitlab work behind Nginx. my configs:
Nginx:
upstream gitlab-workhorse {
server unix:/var/opt/gitlab/gitlab-workhorse/sockets/socket fail_timeout=0;
}
location /gitlab/ {
rewrite ^/gitlab(/.*)$ $1 break;
client_max_body_size 0;
gzip off;
proxy_read_timeout 300;
proxy_connect_timeout 300;
proxy_redirect off;
p ...
I need help with sourcing terraform modules from a gitlab repository with multiple modules in it like ec2, vpc etc. I have two branches in module repo - develop and main. I tried all the ways below but got an error. I am sourcing something like below. I need ssh only, not https.
source = "git::ssh://git@gitlabrepo.com:repo_name/modules.git//ec2?ref=develop"
"git::ssh://git@gitlabrepo.com:repo_name/ ...
I already use Azure AD for login to Gitlab and now I want to manage roles (Regular user, Admin user) in Azure AD as well and pass them to Gitlab. Roles can be stored in the Azure Manifest, which are then recognized by the application. Is this also possible for Gitlab CE?
Here is an example for Grafana: https://grafana.com/docs/grafana/latest/auth/azuread/
"appRoles": [
{
"a ...

After upgrading GitLab to 14.7, sidekiq fails to stay running, and no jobs are running.
All CI jobs are stuck saying This job depends on upstream jobs that need to succeed in order for this job to be triggered. I also cannot push in this state.
Kubernetes version: 1.21.6 Helm chart version: 5.7.0 (gitlab 14.7.0)
Output of kubectl get pods
NAME READY STATUS R ...

We recently updated gitlab server and we can see for some repos while creating Merge Requests we can see "Checking pipeline status" as stuck. We verified and confirmed settings for "Pipelines must succeed" is not enabled for this repo and also this repo has no .gitlab-ci.yml. On these job we had jenkins pipeline jobs as web hook. In https://gitlab.com/group/project/-/pipelines its empty.
But for other rep ...
I am trying to run gitlab docker image 14.6.3 with custom ports for HTTP (60000) HTTPS (60001) and SSH (60002).
For this, I created the folder /srv/gitlabNB/
and started the instance like so:
sudo docker run --detach \
--hostname gitlab.testdomain.de \
--publish 60000:60000 --publish 60001:60001 --publish 60002:60002 \
--name gitlabNB \
--restart always \
--volume /srv/gitlabNB/config:/etc/gi ...

The Problem
After a specific project runs on my CI, virtualbox hangs while trying to 'poweroff' the VM. vboxmanage list runningvms
shows nothing, but ps ax | grep VBoxHeadless
shows the process is still running, and vboxmanage controlvm <VMName> poweroff
throws error: The virtual machine is being powered down
. It will sit like this indefinitely until I manually kill the process.
The Details
We have two etcd clusters running in Kubernetes one act as primary(A
) and the second one act as backup(B
). We also have etcdctl make-mirror
in place between these two clusters, now the problem is if we switch traffic from cluster A
to B
then cluster B
becomes primary, and cluster A
becomes the backup cluster. There is an F5
load balancer in front of these two clusters.
I'm looking for a mechanism/trigg ...
I have an HTTPS-enabled centOS7 server setup with GitLab/nginx, with an A record registered on a payed DNS and certificate verified by Let's Encrypt. (I will use gitlab.example.com here). The domain name has been tested to be accessible at least via ssh and plain HTTP.
With HTTPS, I can connect to the server using direct IP like https://x.x.x.x . Although the unsafe certificate error will pop up (due to ...

Our organization uses Gitlab to host all our git-repositories. Most commits refer to one (sometimes more) Jira-tickets and/or other issue-trackers. Something like:
Add a widget to the trinket
Jira: FOOBAR-1117
ServiceNow: INC0000001319
or even simply:
FOOBAR-1119: add a bell to the wistle
The commit-messages themselves are, obviously, in plain text -- and that's, how it should be. However, when vie ...

I have subscribed for GoDaddy VPS, where I am hosting GitLab servers. I would like to understand the backup methodologies used in the industry, to keep the data secure. I know GoDaddy provides a weekly automatic backup plan. I'm interested in daily backup plans if available.

Running with gitlab-runner 14.5.2 (e91107dd) on ibrahimrunner a8c7nx2r Preparing the "shell" executor 00:00 Using Shell executor... Preparing environment 00:00 Running on ip-172-31-5-177... ERROR: Job failed: prepare environment: exit status 1. Check https://docs.gitlab.com/runner/shells/index.html#shell-profile-loading for more information
I have install gitlab server in one aws ec2 and in the same ...
I need to move all the data from a NON-BOOTING (so I can't create a GitLab backup normally) GitLab instance on EC2 to a fresh instance. I do NOT have GitLab backups, but have access to full disk of the old instance.
I have:
- Detached the volume from the old, non-booting instance
- Launched a new EC2 instance
- Attached the volume to the new instance (not as the root volume, as an additional volume as ...