gitlab-ci | DEPRECATED - Continuous integration server | Continous Integration library
kandi X-RAY | GitLab CI Summary
kandi X-RAY | GitLab CI Summary
DEPRECATED - Continuous integration server for gitlabhq | Coordinator
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of gitlab-ci
GitLab CI Key Features
GitLab CI Examples and Code Snippets
Community Discussions
Trending Discussions on gitlab-ci
QUESTION
I am learning GitLab-ci and a few things puzzle me. So here is a build job I found while googling:
...ANSWER
Answered 2022-Mar-30 at 18:47You should pull the image to take advantage of cached layers so that you don't build layers again unnecessarily. This results in faster builds, faster updates for people pulling new images, and more efficient use of storage in your container registry.
You can read more about this in the GitLab docs: Make Docker-in-Docker builds faster with Docker layer caching
For your additional questions:
Regarding --ssh default
: see the docker documentation on this.
Regarding BUILDKIT, in short, in enables faster and more efficient builds.
QUESTION
ANSWER
Answered 2022-Mar-30 at 18:41This is the edit project API. The parameter controlling this is the ci_config_path
.
QUESTION
How can I run a service-based command after the build process in gitlab-ci.yml?
For example, i'd like to run:
...ANSWER
Answered 2022-Mar-29 at 06:38As mentioned here:
Process started with Runner, even if you add
nohup
and&
at the end, is marked with process group ID.
When the job is finished, the Runner is sending a kill signal to the whole process group.
So any process started directly from CI job will be terminated at job end.
Using a systenter code here
emd service (as in this same page) remains an option, if you control the target server.
QUESTION
I have composed a gitlab-ci.yml file consisting of multiple gitlab jobs and stages. Some jobs run on specific git branches when code is merged to that branch and some jobs are scheduled.
I want to create a scheduled CI/CD pipeline in Gitlab which only contains specific scheduled jobs and not all the scheduled jobs. Is that possible?
For Example this is my gitlab-ci.yml file.
...ANSWER
Answered 2022-Mar-14 at 11:36Use only:variables:
and set those variables in your schedules.
QUESTION
ANSWER
Answered 2022-Mar-07 at 09:48You can create a job than must be run manually
You can require that a job doesn’t run unless a user starts it.
This is called a manual job.You might want to use a manual job for something like deploying to production.
To specify a job as manual, add
when: manual
to the job in the.gitlab-ci.yml
file.By default, manual jobs display as skipped when the pipeline starts.
The OP adds:
QUESTION
I have researched the way to push docker images from gitlab container registry to an azure resource: Pushing Docker image from gitlab-ci to Azure Container Registry
I have also found the documentation to create managed identities (both system-assigned and user-assigned) in the Azure docs
I am missing to connect the dots on how I can use
az login —-identity
in a gitlab-ci.yml
file to access an azure app service. The purpose is to push a docker image from gitlab container registry.
- How can I do this?
- How do I need to configure the azure app service (identity / access control)?
- Are there any security concerns? If yes, is
az login —-service-principal
a more secure way to do this? Or any other authentication procedure?ssh
?
Thank you for your help in advance! 🙏
...ANSWER
Answered 2022-Feb-28 at 21:55You can use a GitLab CI Job JWT token to login to Azure from within a CI/CD pipeline without needing to store secrets in a GitLab project. In order to do this, you will also need to configure OpenID Connect (OIDC) for ID federation between GitLab and an Azure service principal. This is recommended by Microsoft for authenticating to Azure from CI/CD services, among other use cases.
Note: Using OIDC as described below will only work if you are using gitlab.com or a publicly reachable GitLab instance. This is because Azure needs to connect to the token issuer for the keys to validate the token. If you are self-hosting GitLab and your instance is not publicly accessible, you can choose a different credential type for step 2.
1. Create a registered appFirst, you will need to register an Application in Azure. You can do this by following these instructions to register an application and create a service principal.
After doing this, make note of the values for Application (client) ID and Directory (tenant) ID (found in the application Overview pane). These values will be needed for step 3.
2. Add the federated credentialsOnce your app is registered, you can add federated credentials to the application's service principal. In the Azure portal, go to registered apps -> your application. In the sidebar, select Certificates & secrets. Under the Federated credentials tab, click the "Add credential" button
Use the following parameters for the credential configuration:
Federated credential sceanrio: Other issuer
Issuer: your gitlab URL e.g. https://gitlab.example.com
Subject Identifier: The value of the sub
claim to match. For example, to allow jobs on the main
branch of the contoso/myproject
project to use this service principal, use project_path:contoso/myproject:ref_type:branch:ref:main
Name: Any descriptive name for the federated credental (e.g. contoso-myproject-main
)
Description: Optional, a description for the federated credential.
Audience: your GitLab URL e.g. https://gitlab.example.com
After the federated credentials are created, you can leverage the CI_JOB_JWT_V2
token in your job to authenticate with Azure. In this example, we'll use the Azure CLI (az login
).
QUESTION
I have a gitlab-ci/cd.yaml-file that executes 2 test scripts. As you can see there is a lot of repetition going on. As a matter of fact, both stages are identical, except for their "script" value.
For the smoke-suite the value is
- npm run docker_smoke --single-run --progress false
For the regression-suite the value is
- npm run docker_regression --single-run --progress false
ANSWER
Answered 2022-Feb-23 at 16:03You can define templates and then extend your jobs with them.
Documentation: https://docs.gitlab.com/ee/ci/yaml/#extends
Example:
QUESTION
I'm completely new to trying to implement GitLab's CI/CD pipelines, but it's been going quite well. In fact, for my ASP.NET project, if I specify a Publish Profile in the msbuild
command that uses Web Deploy, it actually deploys the code successfully to the web server.
However, I'm now wanting to have the "build" job create artifacts which are uploaded to GitLab that I can then subsequently deploy. We're using a self-hosted instance of GitLab, for which I'm not an admin, but I can speak to the admin if I know what I'm asking for!
So I've configured my gitlab-ci.yml
file like this:
ANSWER
Answered 2022-Feb-08 at 15:22After countless hours working on this, it seems that ultimately the issue was that our internal Web Application Firewall was blocking some part of the transfer of artefacts to the server, or the response back from it. With the WAF reconfigured not to block traffic from the machine running the GitLab Runner, the artefacts are successfully uploaded and the job succeeds.
This would have been significantly easier to diagnose if the logging from GitLab was better. As per my comment on this issue, it should be possible to see the content of the response from the GitLab server after uploading artefacts, even when the response code is 200
.
What's strange - and made diagnosing the issue even harder - is that when I worked through the issue with the admin of our GitLab instance, digging through logs and running it in debug mode, the artefact upload process was uploading something successfully. We could see, for example, the GitLab Runner's log had been uploaded to the server. Clearly the WAF's blocking was selective and didn't block everything in both directions.
QUESTION
I am working on a gitlab-ci project.
I have a variable A
that I retrieve from a form.
I have to set another variable B
in my playbook.
If A
matches a certain regex, B
should be ' -p A'
else B
should be an empty string ''
.
This should be written in an Ansible file.
I have tried
...ANSWER
Answered 2022-Jan-27 at 22:05You do have three issues, I would say:
- you should use an inline if expression of Jinja rather than a
when
- the backslash of the digit pattern have to be escaped to produce a valid in YAML:
\\d
- I guess the regex do not match what you think it does, to match between one and eight digit(s), the quantifier have to be used with a comma (
,
) to separate the minimum and the maximum repetition of the previous pattern, not a dash (-
):\\d{1,8}
All together
QUESTION
Given that I have a private repo with this file:
https://gitlab.com/myuser/snippets/-/raw/main/snippets.yml
ANSWER
Answered 2022-Jan-27 at 10:43This can be achieved even with a nicer and easier way to handle this.
You can use a special syntax for gitlab, as long as they are on the same instance. you can specify a project and optional ref and the file with this syntax like
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install GitLab CI
On a UNIX-like operating system, using your system’s package manager is easiest. However, the packaged Ruby version may not be the newest one. There is also an installer for Windows. Managers help you to switch between multiple Ruby versions on your system. Installers can be used to install a specific or multiple Ruby versions. Please refer ruby-lang.org for more information.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page