question
stringlengths
11
28.2k
answer
stringlengths
26
27.7k
tag
stringclasses
130 values
question_id
int64
935
78.4M
score
int64
10
5.49k
Is it possible to make a reference to an issue in Gitlab from a commit message? I haven't found anything on the web.
There should be a way to reference a GitLab issue from a commit message, simply with #xx (id of the issue). Consider "Default closing pattern value " For example the following commit message: Awesome commit message Fix #20, Fixes #21 and Closes group/otherproject#22. This commit is also related to #17 and fixes #18, ...
GitLab
45,292,973
61
So I have a react/typescript app in my repo that I'm working on and in my repo I have a .env file that I'm ignoring so that my secrets don't get exposed and a .env-example file of important environment variables to configure. My problem is, since I'm not pushing the .env file to my repo, when I deploy my app through th...
I don't know if you still need this, but this is how I achieved, what you wanted to. Create your environment variables in your gitlab repo config Create setup_env.sh: #!/bin/bash echo API_URL=$API_URL >> .env echo NODE_ENV=$NODE_ENV >> .env Modify your .gitlab-ci.yml. Upsert below to your before_script: section ...
GitLab
52,540,316
61
I am trying to test to see if my SSH key was added correctly by following the instructions which are found halfway down the page here. To test whether your SSH key was added correctly, run the following command in your terminal (replacing gitlab.com with your GitLab's instance domain): ssh -T git@gitlab.com How...
If you're using Gitlab on gitlab.com then the domain is gitlab.com, so you should run  ssh -T git@gitlab.com
GitLab
56,033,742
61
When I do this: git clone https://example.com/root/test.git I am getting this error: fatal: HTTP request failed When I use SSH: git clone username git@example.com:root/test.git I am getting this error: Initialized empty Git repository in /server/user/git@example.com:root/test.git/.git/ fatal: 'user' does not...
It looks like there's not a straightforward solution for HTTPS-based cloning regarding GitLab. Therefore if you want a SSH-based cloning, you should take account these three forthcoming steps: Create properly an SSH key using your email used to sign up. I would use the default filename to key for Windows. Don't forget...
GitLab
30,202,642
60
I forked a GitHub repository and made some changes on my fork and submited a pull request but the owners of the original GitHub repository asked for some changes which they asked me for in the pull request. I assumed that adding additional changes to my fork will cause them to show up in the current pull request but to...
First, make sure that you did push to the right branch and that the commit still doesn't show up in the PR. For me, the commit showed up when I viewed the specific branch in the repo, but didn't show in the PR and didn't trigger CI. This is what fixed the issue for me: Click on Edit in the top right corner. Click on t...
GitLab
45,626,986
60
I am looking for a git hosting environment for several users. Therefore i've searched for comparisons between Gitolite, Gitlab and Gitorius. But i get nothing what could be useful. Is there anybody, who has experiences with different hosting tools and could provide an advice?
Gitolite is not a git hosting environment: it is an authorization layer, which grants or denies access to a git repo. It is the https or ssh layer which allows the authentication of a user, and the git repo hosting itself. See "How do programs like gitolite work?" GitLab and Gitorious both provide git hosting, with (t...
GitLab
17,167,414
59
Situation I have two servers, Production and Development. On Production server, there are two applications and multiple (6) databases (MySQL) which I need to distribute to developers for testing. All source codes are stored in GitLab on Development server and developers are working only with this server and don't have ...
Update 2017: Microsoft is contributing to Microsoft/GVFS: a Git Virtual File System which allows Git to handle "the largest repo on the planet" (ie: the Windows code base, which is approximately 3.5M files and, when checked in to a Git repo, results in a repo of about 300GB, and produces 1,760 daily “lab builds” across...
GitLab
17,888,604
59
I build the project at gitlab ci ./gradlew assembleDebug --stacktrace and sometimes it throws an error: FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:transformClassesWithDexBuilderForDebug'. > com.android.build.api.transform.TransformException: java.lang.IllegalStateExcep...
./gradlew clean fixed the same error for me.
GitLab
47,791,227
59
Currently when I start a build in GitlabCI it is running under gitlab-runner user. I want to change it the company's internal user. I didn't find any parameter to the /etc/gitlab-runner/config.toml which is solve that. My current configuration: concurrent = 1 [[runners]] name = "deploy" url = "" token = "" exe...
Running ps aux | grep gitlab you can see: /usr/bin/gitlab-ci-multi-runner run --working-directory /home/gitlab-runner --config /etc/gitlab-runner/config.toml --service gitlab-runner --syslog --user gitlab-runner Service is running with option --user. So let's change this, it depends on what distro. you are running it....
GitLab
37,187,899
58
I created a merge request on gitlab (local) server. Now whenever I click on the merge request, the request times out with error 500. Before that I used to get an error code 504 and I applied the change mentioned in this gitlab support topic. All I want to do is remove the merge request. Is there a manual way of doing t...
Web UI Option Today I discovered a way to do this with the Web UI. So for Merge Request 14 https://gitlab.example.com/MyGroup/MyProject/merge_requests/14/edit On the bottom Right you should see a red Delete button. PowerShell Option Invoke-RestMethod -Method Delete -Uri 'https://gitlab.example.com/api/v4/projects/PROJ...
GitLab
32,194,657
57
I have a Gitlab CI runner running on windows 10: before_script: - "echo off" - 'call "%VS120COMNTOOLS%\vsvars32.bat"' - echo. - set - echo. stages: - build build: stage: build script: - 'StatusTest.exe' #- msbuild... I am trying to fail the build with StatusText.exe (I tried returning status code...
What determines that CI shell runner should fail the build and not proceed to next step? If a pipeline job exits with the code other than 0 then that job fails causing all the following jobs in the pipeline to be skipped. This behaviour can be changed on a per job basis with allow_failure job keyword. To make a job t...
GitLab
36,619,212
57
I am working on a project which I cloned from a remote repository hosted on GitLab. I made some changes to the project, but I didn’t create any branch and want to now start work on some other new features, but without first pushing my existing work to the remote repository. I might discard the changes in the new featur...
You switch back and forth between branches using git checkout <branch name>. And yes, git checkout -b NEW_BRANCH_NAME is the correct way to create a new branch and switching to it. At the same time, the command you used is a shorthand to git branch <branch name> and git checkout <branch name>.
GitLab
66,882,952
57
Not long ago, we have made the switch from SVN to Git. A few days ago, I realized that all of our team gets those messages when they push : $ git push Counting objects: 32, done. Delta compression using up to 8 threads. Compressing objects: 100% (19/19), done. Writing objects: 100% (32/32), 2.94 KiB | 0 bytes/s, done. ...
This is followed by issue 14357 (GitLab 8.6- or less) The manual fix was: SSH into worker1 cd into the gitlab-org/gitlab-ce directory ran rm gc.log, this just contained the line " warning: There are too many unreachable loose objects; run 'git prune' to remove them." ran git prune and prayed it didn't break things (wh...
GitLab
37,732,141
56
I am having a syntax error when I test my gitlab-ci.yml in CI Lint. Can someone suggest a solution to this problem? build-production: stage: build only: - master image: name: gcr.io/kaniko-project/executor:debug entrypoint: [""] script: - mkdir -p /kaniko/.docker - echo "{\"auths\":{\"$CI_R...
Documentation is pretty clear : rules replaces only/except and they can’t be used together in the same job. If you configure one job to use both keywords, the linter returns a key may not be used with rules error. I suggest to use rules: for both of your conditions : rules: - if: '$CI_COMMIT_REF_NAME == "master" &&...
GitLab
67,010,580
56
I have a Dockerfile which is going to be implemented FROM a private registry's image. I build this file without any problem with Docker version 1.12.6, build 78d1802 and docker-compose version 1.8.0, build unknown, but in another machine which has Docker version 17.06.1-ce, build 874a737 and docker-compose version 1.16...
If this is an authenticated registry, then you need to run docker login <registryurl> on the machine where you are building this. This only needs to be done once per host. The command then caches the auth in a file $ cat ~/.docker/config.json { "auths": { "https://index.docker.io/v1/": { "auth":...
GitLab
46,418,652
54
I have an unity ci-project. .gitlab-ci.yml contains base .build job with one script command. Also I have multiple specified jobs for build each platform which extended base .build. I want to execute some platform-specific commands for android, so I have created separated job generate-android-apk. But if it's failing t...
UPDATE: since gitlab 13.9 it is possible to use !reference tags from other jobs or "templates" (which are commented jobs - using dot as prefix) actual_job: script: - echo doing something .template_job: after_script: - echo done with something job_using_references_from_other_jobs: script: - !referenc...
GitLab
53,175,030
54
Q1: Whats the difference between concurrent = 3 [[runners]] .. executor = "shell" and concurrent = 3 [[runners]] ... executor = "shell" [[runners]] ... executor = "shell" [[runners]] ... executor = "shell" Q2: Does it makes sense, to... have 3 executors (workers) of same type on a single runner wi...
Gitlab's documentation on runners describes them as: (...) isolated (virtual) machines that pick up jobs through the coordinator API of GitLab CI Therefore, each runner is an isolated process responsible for picking up requests for job executions and for dealing with them according to pre-defined configurations. As a...
GitLab
54,534,387
54
First time GitLab user and I'm a bit confused when reviewing someone's merge request. Whenever I add a comment I get prompted with two options: Submit review and Add comment now. What's the difference between the two? Why is there a need for two options?
Just heard this from my colleagues, so not sure if this is 100% accurate: Add comment now: instantly adds the comment to the review and notifies the reviewer that a comment has been added. So if you choose this option X times, the reviewer receives X notifications. Submit review: You can add as many comments as you wan...
GitLab
71,407,947
54
How can we configure gitlab to keep only the last 10 CI jobs/builds and keep deleting the rest? For example , in Jenkins , we can configure the job to keep only last X builds.
UPDATE As of Gitlab Release 12.6, deleting a pipeline is now an option in the GUI for users in role Owner: Click the pipeline you want to remove in the pipelines list Hit the red Delete button in the upper right of the pipeline details page. As of Gitlab Release 11.6, deleting a pipeline is now an option, for users i...
GitLab
53,355,578
53
My gitlab is on a virtual machine on a host server. I reach the VM with a non-standard SSH port (i.e. 766) which an iptable rule then forward from host:766 to vm:22. So when I create a new repo, the instruction to add a remote provide a mal-formed URL (as it doesn't use the 766 port. For instance, the web interface giv...
In Omnibus-packaged versions you can modify that property in the /etc/gitlab/gitlab.rb file: gitlab_rails['gitlab_shell_ssh_port'] = 766 Then, you'll need to reconfigure GitLab: # gitlab-ctl reconfigure Your URIs will then be correctly displayed as ssh://git@git.domain.com:766/group/project.git in the web interface.
GitLab
18,517,189
52
I have found that Gitlab and SourceTree support icons for every repositories which make them more specific and easy to find at one glance. How is this possible?
We as a developer sometimes need a change to make our tools look different. You can add a small(I prefer 96px x 96px) logo.png image file to the root of your repository. Which makes your project more specific and easy to find with gitlab or SourceTree git client. Unfortunately github does not support this feature. It...
GitLab
40,049,648
52
After Gitlab switched its markdown engine to CommonMark it's no longer as easy to add things like custom styling to your markdown files. I've used Gitlab for some time and for the longest time I've liked how nicely I could make my README.md file look, having a centered icon, title and description for my project. When t...
Update I checked out an old project of mine and noticed that it was already centered. It turns out that CommonMark allows you to set align="center" on <div> tags as well! So, the simplest solution for centering is currently (note the empty line after the opening <div>: <div align="center"> # This is gonna be centered!...
GitLab
53,273,660
52
I am deploying my React app using GitLab Pages, and it works well. Here is my gitlab-ci.yml: # Using the node alpine image to build the React app image: node:alpine # Announce the URL as per CRA docs # https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/README.md#advanced-configura...
I've had success using the browsable artifacts for this purpose. In your example, you would create a job for your develop branch and set the PUBLIC_URL to the path on gitlab.io where the job's artifacts are published: develop: artifacts: paths: - public environment: name: Develop ...
GitLab
55,596,789
52
I am using GitLab 7.7.2 and tried to remove Tag in a repository in GitLab. I could remove tag in a local repository but cannot remove tag in origin. How do I remove tag in GitLab repository? $ git tag -d Tag_AAA Deleted tag 'Tag_AAA' (was d10bff2) $ git push --delete origin Tag_AAA remote: GitLab: You don't have permi...
# delete locally: git tag -d <tag> # delete remotely: git push origin :refs/tags/<tag> # another way to delete remotely: git push --delete origin <tag>
GitLab
30,858,781
51
I am trying to push to master branch of a repo and I am failing to do so, since it is protected. I tried to look into the project settings and do not see any option for protected branches. The only option I could see is members. remote: GitLab: You are not allowed to push code to protected branches on this project. ...
12/17/2018 1. git push: "error: failed to push some refs to" git push -f: "remote rejected" 2. the branch is in a protected state and cannot be forced to operate. Gitlab - Repository - Branches 3. temporarily remove branch protection. Gitlab - Settings - Repository - Protected Branches - Unprotect 4. try pushing ag...
GitLab
42,073,357
51
What is the easiest method to list all the projects and groups in GitLab using my private token?
If only your private token is available, you can only use the API: PROJECTS Use the following command to request projects: curl "https://<host>/api/v4/projects?private_token=<your private token>" This will return you the first 20 entries. To get more you can add the paramater per_page curl "https://<host>/api/v4/proje...
GitLab
45,068,904
50
I typed wrong ID (my mistake) and I think my computer's IP is permanently banned. I'd like to un-ban my IP so that I can git clone to my desired git repository. But when I tried to git clone my git repository, it says remote: HTTP Basic: Access denied fatal: Authentication failed for "~~my repository" How can I access ...
It seems that your credential manager stored wrong authentication and reuses it. Reset it. git config --system --unset credential.helper More information: Remove credentials from Git GitLab remote: HTTP Basic: Access denied and fatal Authentication
GitLab
51,581,582
50
I'm using Gitlab CI, and so have been working on a fairly complex .gitlab-ci.yml file. The file has an after_script section which runs when the main task is complete, or the main task has failed somehow. Problem: I need to do different cleanup based on whether the main task succeeded or failed, but I can't find any Git...
Since gitlab-runner 13.5, you can use the CI_JOB_STATUS variable. test_job: # ... after_script: - > if [ $CI_JOB_STATUS == 'success' ]; then echo 'This will only run on success' else echo 'This will only run when job failed or is cancelled' fi See GitLab's documentation on pre...
GitLab
49,867,981
49
we are using Gitlab 8.10.1 with many groups and projects. Many of the projects happen to be forks of other projects. Our problem is that whenever somebody opens a merge request for a project the default target branch is NOT the default branch of the project but from one very specific other project. Is there a way to ov...
The default MR target depends on whether or not the repository is a GitLab fork. Forks If the repository is a GitLab fork, then the default MR target will be the default branch of the upstream repository. This relationship can be removed via the "Remove fork relationship" option on the Project settings page, after whic...
GitLab
38,913,163
48
I'm using latest gitlab and the integrated docker registry. For each project I create an individual deploy token. On the host where I want to deploy the images I do docker login https://registry.example.com/project1, enter the deploy token and get success. Pulling the image just works fine. On the same host I need to d...
You can use the --config option of the Docker client to store multiple credentials into different paths: docker --config ~/.project1 login registry.example.com -u <username> -p <deploy_token> docker --config ~/.project2 login registry.example.com -u <username> -p <deploy_token> Then you are able to call Docker comman...
GitLab
50,177,884
48
I'm trying to build the CI pipeline in GitLab. I'd like to ask about making the docker work in GitLab CI. From this issue: https://gitlab.com/gitlab-org/gitlab-runner/issues/4501#note_195033385 I'm follow the instruction for both ways. With TLS and not used TLS. But It's still stuck. Which in same error Cannot connect ...
You want to set DOCKER_HOST to tcp://docker:2375. It's a "service", i.e. running in a separate container, by default named after the image name, rather than localhost. Here's a .gitlab-ci.yml snippet that should work: # Build and push the Docker image off of merges to master; based off # of Gitlab CI support in https:/...
GitLab
61,105,333
48
I have a subdirectory named "www" that is a repo: site |-- www/ | |-- .git/ | |-- index.html |-- design/ | |-- images.jpg I'd like to change the repo to the parent directory so that the repo structure mirrors the original file structure as follows: site |-- .git/ |-- www/ | |-- index.html |-- design/ | ...
Create a www directory in your repo. git mv the HTML files to that directory. Optionally commit this step. mv the design directory into your repo, and git add . Commit. Rename/move your whole repo.
GitLab
32,082,366
47
I've read that GitLab is capable of sending messages to other servers via "web hooks" but I can't find where one would create one. Can someone point me in the right direction?
All the answers I've found in official documentation and on Stack Overflow for finding web hooks are incorrect. The admin area > hooks page does NOT contain web hooks. It contains system hooks, which fire when you create/delete projects and users and things like that. This is not what you want. To find your web hooks, ...
GitLab
17,157,969
46
I just created a personal GitLab account and am trying to follow the steps on https://gitlab.com/help/ssh/README to deploy my SSH key to GitLab. I've completed up to step 5, and see my SSH key among 'Your SSH keys' in my User Settings -> SSH keys: I'm trying to now complete the optional 6th step, testing the key: My...
If you're using Gitlab on gitlab.com then the domain is simply gitlab.com so you should run ssh -T git@gitlab.com
GitLab
43,319,094
46
I am running the following command from my Jenkinsfile. However, I get the error "The input device is not a TTY". docker run -v $PWD:/foobar -it cloudfoundry/cflinuxfs2 /foobar/script.sh Is there a way to run the script from the Jenkinsfile without doing interactive mode? I basically have a file called script.sh that ...
Remove the -it from your cli to make it non interactive and remove the TTY. If you don't need either, e.g. running your command inside of a Jenkins or cron script, you should do this. Or you can change it to -i if you have input piped into the docker command that doesn't come from a TTY. If you have something like xyz ...
Jenkins
43,099,116
959
I've just started working with Jenkins and have run into a problem. After installing several plugins it said it needs to be restarted and went into a "shutting down" mode, but never restarts. How do I do a manual restart?
To restart Jenkins manually, you can use either of the following commands (by entering their URL in a browser): (jenkins_url)/safeRestart - Allows all running jobs to complete. New jobs will remain in the queue to run after the restart is complete. (jenkins_url)/restart - Forces a restart without waiting for builds to...
Jenkins
8,072,700
815
I'm trying to configure my e-mail on Jenkins/Hudson, and I constantly receive the error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty I've seen a good amount of information online about the error, but I have not gotten any to work. I'm using Sun's JDK on Fedora Lin...
This bizarre message means that the trust store you specified was: empty, not found, or couldn't be opened, due for example to: wrong/missing trustStorePassword, or file access permissions. See also @AdamPlumb's answer below.
Jenkins
6,784,463
613
I am new to docker. I just tried to use docker in my local machine(Ubuntu 16.04) with Jenkins. I configured a new job with below pipeline script. node { stage('Build') { docker.image('maven:3.3.3').inside { sh 'mvn --version' } } } But it fails with this error: Got permission denied while ...
If using jenkins The user jenkins needs to be added to the group docker: sudo usermod -a -G docker jenkins Then restart Jenkins. Otherwise If you arrive to this question of stack overflow because you receive this message from docker, but you don't use jenkins, most probably the error is the same: your unprivileged use...
Jenkins
47,854,463
561
I have a project hosted in Git stash (now rebranded as Bitbucket Server). It is built using Jenkins. Now I made a typo while installing my Git locally. Like @ab.example instead of @abc.example After every build, Jenkins sends email notifications and it picks up my incorrect email address from Git commit and tries to se...
Locally set email-address (separately for each repository) Open Git Bash. Change the current working directory to the local repository in which you want to set your Git config email. Set your email address with the following command: git config user.email "your_email@abc.example" Confirm that you have set your e...
Jenkins
37,805,621
407
I added a new job in Jenkins, which I want to schedule periodically. From Configure job, I am checking the "Build Periodically" checkbox and in the Schedule text field added the expression: 15 13 * * * But it does not run at the scheduled time. Is it the correct procedure to schedule a job? The job should run at 4:2...
By setting the schedule period to 15 13 * * * you tell Jenkins to schedule the build every day of every month of every year at the 15th minute of the 13th hour of the day. Jenkins used a cron expression, and the different fields are: MINUTES Minutes in one hour (0-59) HOURS Hours in one day (0-23) DAYMONTH Day ...
Jenkins
12,472,645
377
I'm running Jenkins inside a Docker container. I wonder if it's ok for the Jenkins container to also be a Docker host? What I'm thinking about is to start a new docker container for each integration test build from inside Jenkins (to start databases, message brokers etc). The containers should thus be shutdown after th...
Running Docker inside Docker (a.k.a. dind), while possible, should be avoided, if at all possible. (Source provided below.) Instead, you want to set up a way for your main container to produce and communicate with sibling containers. Jérôme Petazzoni — the author of the feature that made it possible for Docker to run i...
Jenkins
27,879,713
352
Is it possible to exchange jobs between 2 different Jenkins'? I'm searching for a way to export/import jobs.
Probably use jenkins command line is another option, see https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+CLI create-job: Creates a new job by reading stdin as a configuration XML file. get-job: Dumps the job definition XML to stdout So you can do java -jar jenkins-cli.jar -s http://server get-job myjob > myjob.x...
Jenkins
8,424,228
330
When writing jenkins pipelines it seems to be very inconvenient to commit each new change in order to see if it works. Is there a way to execute these locally without committing the code?
You cannot execute a Pipeline script locally, since its whole purpose is to script Jenkins. (Which is one reason why it is best to keep your Jenkinsfile short and limited to code which actually deals with Jenkins features; your actual build logic should be handled with external processes or build tools which you invoke...
Jenkins
36,309,063
314
I would like to be able to do something like: AOEU=$(echo aoeu) and have Jenkins set AOEU=aoeu. The Environment Variables section in Jenkins doesn't do that. Instead, it sets AOEU='$(echo aoeu)'. How can I get Jenkins to evaluate a shell command and assign the output to an environment variable? Eventually, I want to b...
This can be done via EnvInject plugin in the following way: Create an "Execute shell" build step that runs: echo AOEU=$(echo aoeu) > propsfile Create an Inject environment variables build step and set "Properties File Path" to propsfile. Note: This plugin is (mostly) not compatible with the Pipeline plugin.
Jenkins
10,625,259
281
Is it possible to turn off sonar (www.sonarsource.org) measurements for specific blocks of code, which one doesn't want to be measured? An example is the "Preserve Stack Trace" warning which Findbugs outputs. When leaving the server, I might well want to only pass the message back to the client, not including the actu...
You can annotate a class or a method with SuppressWarnings @java.lang.SuppressWarnings("squid:S00112") squid:S00112 in this case is a Sonar issue ID. You can find this ID in the Sonar UI. Go to Issues Drilldown. Find an issue you want to suppress warnings on. In the red issue box in your code is there a Rule link with...
Jenkins
10,971,968
280
Our Jenkins server has a job that has been running for three days, but is not doing anything. Clicking the little X in the corner does nothing, and the console output log doesn't show anything either. I've checked on our build servers and the job doesn't actually seem to be running at all. Is there a way to tell jenki...
I had also the same problem and fix it via Jenkins Console. Go to "Manage Jenkins" > "Script Console" and run a script: Jenkins.instance.getItemByFullName("JobName") .getBuildByNumber(JobNumber) .finish(hudson.model.Result.ABORTED, new java.io.IOException("Aborting build") ); You'll h...
Jenkins
14,456,592
264
Are comments possible in a Jenkinsfile? If so, what's the syntax? I am using the declarative pipeline syntax. I want to comment out the "post" section below until my SMTP server is working. pipeline { agent { label 'docker-build-slave' } environment { IMAGE = 'registry.gitlab.com/XXXXX/bible-server' DOCKE...
The Jenkinsfile is written in groovy which uses the Java (and C) form of comments: /* this is a multi-line comment */ // this is a single line comment
Jenkins
42,309,957
250
Is there a way to reset all (or just disable the security settings) from the command line without a user/password as I have managed to completely lock myself out of Jenkins?
The simplest solution is to completely disable security - change true to false in /var/lib/jenkins/config.xml file. <useSecurity>true</useSecurity> A one-liner to achieve the same: sed -i 's/<useSecurity>true<\/useSecurity>/<useSecurity>false<\/useSecurity>/g' /var/lib/jenkins/config.xml Then just restart Jenkins: su...
Jenkins
6,988,849
247
How can I trigger build of another job from inside the Jenkinsfile? I assume that this job is another repository under the same github organization, one that already has its own Jenkins file. I also want to do this only if the branch name is master, as it doesn't make sense to trigger downstream builds of any local br...
In addition to the above mentioned answers: I wanted to start a job with a simple parameter passed to a second pipeline and found the answer on http://web.archive.org/web/20160209062101/https://dzone.com/refcardz/continuous-delivery-with-jenkins-workflow So i used: stage ('Starting ART job') { build job: 'RunArtInT...
Jenkins
36,306,883
226
Recently Maven build jobs running in Jenkins are failing with the below exception saying that they couldn't pull dependencies from Maven Central and should use HTTPS. I'm not sure how to change the requests from HTTP to HTTPS. Could someone guide me on this matter? [ERROR] Unresolveable build extension: Plugin org.apa...
The reason for the observed error is explained in Central 501 HTTPS Required Effective January 15, 2020, The Central Repository no longer supports insecure communication over plain HTTP and requires that all requests to the repository are encrypted over HTTPS. It looks like latest versions of Maven (tried with 3....
Jenkins
59,763,531
218
I'm trying to set up Jenkins-ci for a project using GitHub. I've already set up Jenkins with the appropriate plugins. I want Jenkins to run build scripts only whenever someone on the project pushes to master. So far I've been able to set it up so that a build will be triggered anytime anyone pushes to anywhere, but tha...
As already noted by gezzed in his comment, meanwhile there is a good solution (described in Polling must die: triggering Jenkins builds from a Git hook): Set the Jenkins job's build trigger to Poll SCM, but do not specify a schedule. Create a GitHub post-receive trigger to notify the URL http://yourserver/jenkins/git/...
Jenkins
5,784,329
215
I have a problem with jenkins, setting "git", shows the following error: Failed to connect to repository : Command "git ls-remote -h https://person@bitbucket.org/person/projectmarket.git HEAD" returned status code 128: stdout: stderr: fatal: Authentication failed I have tested with ssh: git@bitbucket.org:person/projec...
Change to the jenkins user and run the command manually: git ls-remote -h git@bitbucket.org:person/projectmarket.git HEAD You will get the standard SSH warning when first connecting to a new host via SSH: The authenticity of host 'bitbucket.org (207.223.240.181)' can't be established. RSA key fingerprint is 97:8c:1b:f...
Jenkins
15,174,194
214
Is there a way to show the Jenkins build status on my project's GitHub Readme.md? I use Jenkins to run continuous integration builds. After each commit it ensures that everything compiles, as well as executes unit and integration tests, before finally producing documentation and release bundles. There's still a risk...
Ok, here's how you can set up Jenkins to set GitHub build statuses. This assumes you've already got Jenkins with the GitHub plugin configured to do builds on every push. Go to GitHub, log in, go to Settings, Developer Settings, Personal access tokens and click on Generate new token. Check repo:status (I'm not sure ...
Jenkins
14,274,293
210
We have a need to be able to skip a submodule in certain environments. The module in question contains integration tests and takes half an hour to run. So we want to include it when building on the CI server, but when developers build locally (and tests get run), we want to skip that module. Is there a way to do this ...
Maven version 3.2.1 added this feature, you can use the -pl switch (shortcut for --projects list) with ! or - (source) to exclude certain submodules. mvn -pl '!submodule-to-exclude' install mvn -pl -submodule-to-exclude install Be careful in bash the character ! is a special character, so you either have to single quo...
Jenkins
8,304,110
209
What is the difference between an agent and a node in a jenkins pipeline? I've found those definitions: Node: A Pipeline performs most of the work in the context of one or more declared node steps. Agent: The agent directive specifies where the entire Pipeline, or a specific stage, will execute in the Jenkins environm...
The simple answer is, Agent is for declarative pipelines and node is for scripted pipelines. In declarative pipelines the agent directive is used for specifying which agent/slave the job/task is to be executed on. This directive only allows you to specify where the task is to be executed, which agent, slave, label or ...
Jenkins
42,050,626
199
We are running Jenkins 2.x and love the new Pipeline plugin. However, with so many branches in a repository, disk space fills up quickly. Is there any plugin that's compatible with Pipeline that I can wipe out the workspace on a successful build?
Like @gotgenes pointed out with Jenkins Version. 2.74, the below works, not sure since when, maybe if some one can edit and add the version above cleanWs() With, Jenkins Version 2.16 and the Workspace Cleanup Plugin, that I have, I use step([$class: 'WsCleanup']) to delete the workspace. You can view it by going to...
Jenkins
37,468,455
189
I am currently using Jenkins on my development PC. I installed it on my development PC, because I had limited knowledge on this tool; so I tested on it in my development PC. Now, I feel comfortable with Jenkins as my long term "partner" in the build process and would like to "move" this Jenkins to a dedicated server. B...
Following the Jenkins wiki, you'll have to: Install a fresh Jenkins instance on the new server Be sure the old and the new Jenkins instances are stopped Archive all the content of the JENKINS_HOME of the old Jenkins instance Extract the archive into the new JENKINS_HOME directory Do not forget to change the owner of t...
Jenkins
8,724,939
184
We already tried the approaches as listed below: https://github.com/oliverlockwood/jenkinsfile-idea-plugin https://st-g.de/2016/08/jenkins-pipeline-autocompletion-in-intellij After having searched the web for many hours on multiple days, we still haven't found a helpful resource on this matter. Thus, it appears to ma...
If you want IDEA to recognize a Jenkinsfile as a Groovy file, then you can add the String "Jenkinsfile" as a valid file name pattern (normally contains file endings) for Groovy files. This is supported "out of the box" without requiring any additional Plugin (except the "Groovy" Plugin, but that is already part of IDEA...
Jenkins
47,796,757
182
As part of my build process, I am running a git commit as an execute shell step. However, if there are no changes in the workspace, Jenkins is failing the build. This is because git is returning an error code when there are no changes to commit. I'd like to either abort the build, or just mark it as unstable if this ...
To stop further execution when command fails: command || exit 0 To continue execution when command fails: command || true
Jenkins
14,392,349
176
I want to move an existing job from one view to another but I can't find the way. Is the only way to copy the job and delete it from the other view? I would like to have the same name and for my experience Jenkins doesn't handle very well the renaming of jobs.
you can simply do it by editing the view (link "Edit view" on left side) and check/uncheck checkboxes
Jenkins
28,562,666
172
This is probably very simple, but I can't find any hint anywhere. So how one is supposed to do that, in general and specifically on Mac?
These instructions apply if you installed using the official Jenkins Mac installer from http://jenkins-ci.org/ Execute uninstall script from terminal: '/Library/Application Support/Jenkins/Uninstall.command' or use Finder to navigate into that folder and double-click on Uninstall.command. Finally delete last configura...
Jenkins
11,608,996
171
I am Using Jenkins 2 for compiling Java Projects, I want to read the version from a pom.xml, I was following this example: https://github.com/jenkinsci/pipeline-plugin/blob/master/TUTORIAL.md The example suggest: It seems that there is some security problem accessing the File System but I can't figure out what it is g...
Quickfix Solution: I had similar issue and I resolved it doing the following Navigate to jenkins > Manage jenkins > In-process Script Approval There was a pending command, which I had to approve. Alternative 1: Disable sandbox As this article explains in depth, groovy scripts are run in sandbox mode by default. Thi...
Jenkins
38,276,341
161
How do you run a build step/stage only if building a specific branch? For example, run a deployment step only if the branch is called deployment, leaving everything else the same.
Doing the same in declarative pipeline syntax, below are few examples: stage('master-branch-stuff') { when { branch 'master' } steps { echo 'run this stage - ony if the branch = master branch' } } stage('feature-branch-stuff') { when { branch 'feature/*' } steps { ...
Jenkins
37,690,920
161
Our automated build is running on Jenkins. The build itself is running on slaves, with the slaves being executed via SSH. I get an error: 00:03:25.113 [codesign-app] build/App.app: User interaction is not allowed. I have tried every suggestion I have seen so far in other posts here: Using security unlock-keychain imm...
I too have been fighting this. Nothing helped until I tried the suggestion on http://devnet.jetbrains.com/thread/311971. Thanks ashish agrawal! Login your build user via the GUI and open Keychain Access. Select your signing private key, right-click, choose Get Info, change to the Access Control tab and select the "A...
Jenkins
20,205,162
161
How do you get Jenkins to execute python unittest cases? Is it possible to JUnit style XML output from the builtin unittest package?
sample tests: tests.py: # tests.py import random try: import unittest2 as unittest except ImportError: import unittest class SimpleTest(unittest.TestCase): @unittest.skip("demonstrating skipping") def test_skipped(self): self.fail("shouldn't happen") def test_pass(self): self.asse...
Jenkins
11,241,781
160
I was following this tutorial: node { git url: 'https://github.com/joe_user/simple-maven-project-with-tests.git' ... } However it doesn't tell how to add credentials. Jenkins does have specific "Credentials" section where you define user user&pass, and then get ID for that to use in jobs, but how do I use that in ...
You can use the following in a pipeline: git branch: 'master', credentialsId: '12345-1234-4696-af25-123455', url: 'ssh://git@bitbucket.org:company/repo.git' If you're using the ssh url then your credentials must be username + private key. If you're using the https clone url instead of the ssh one, then your cr...
Jenkins
38,461,705
156
Using Jenkins 1.501 and Jenkins Git plugin 1.1.26 I have 3 different git repos each with multiple projects. Now I need to checkout all projects from the 3 git repos into the same workspace on a Jenkins slave. I have defined each git repo in: Source code Management: Multiple SCMs. But each time a repo is checked out the...
With the Multiple SCMs Plugin: create a different repository entry for each repository you need to checkout (main project or dependancy project. for each project, in the "advanced" menu (the second "advanced" menu, there are two buttons labeled "advanced" for each repository), find the "Local subdirectory for repo (o...
Jenkins
14,843,696
153
I have two Jenkins instances running. An old (legacy) one at version 1.614 and a new one with 1.633. In the old one it is possible to use HTML in the job description (it even does syntax highlighting editing it). The new one doesn't. HTML content is escaped and shown as plain text. I could not find a change in the rele...
In the Global security menu: Select this value to display HTML:
Jenkins
33,821,217
149
I am new to Hudson / Jenkins and was wondering if there is a way to check in Hudson's configuration files to source control. Ideally I want to be able to click some button in the UI that says 'save configuration' and have the Hudson configuration files checked in to source control.
Most helpful Answer There is a plugin called SCM Sync configuration plugin. Original Answer Have a look at my answer to a similar question. The basic idea is to use the filesystem-scm-plugin to detect changes to the xml-files. Your second part would be committing the changes to SVN. EDIT: If you find a way to determin...
Jenkins
2,087,142
148
I have jenkins.war and I started it from command prompt in Windows as: java -jar jenkins.war It was started well and easily browsed as http://localhost:8080 I want to start on 9090 port. How can I do that?
Use the following command at command prompt: java -jar jenkins.war --httpPort=9090 If you want to use https use the following command: java -jar jenkins.war --httpsPort=9090 Details are here
Jenkins
15,265,277
146
For running an ASP.NET Core application, I generated a dockerfile which build the application and copys the source code in the container, which is fetched by Git using Jenkins. So in my workspace, I do the following in the dockerfile: WORKDIR /app COPY src src While Jenkins updates the files on my host correctly with...
Video with visual explanation (from 2022) Since I got a lot of positive feedback to my previous, first visual explanation, I decided to create another video for this question and answer since there are some things which can be visualized better in a graphical video. It visualizes and also updates this answer with the ...
Jenkins
41,322,541
145
I'm trying to create a declarative Jenkins pipeline script but having issues with simple variable declaration. Here is my script: pipeline { agent none stages { stage("first") { def foo = "foo" // fails with "WorkflowScript: 5: Expected a step @ line 5, column 13." sh "echo ${foo}" ...
The Declarative model for Jenkins Pipelines has a restricted subset of syntax that it allows in the stage blocks - see the syntax guide for more info. You can bypass that restriction by wrapping your steps in a script { ... } block, but as a result, you'll lose validation of syntax, parameters, etc within the script bl...
Jenkins
39,832,862
144
In 2011 situation with Hudson and Jenkins was following(IMHO) - Hudson was a little bit stable, but development of Jenkins was a little bit faster. What is the situation with "Hudson vs Jenkins" now in 2012?
I have used both Hudson and Jenkins. I have been following both change lists. I still think we made the right choice by moving from Hudson to Jenkins. The Hudson core developers are now working on Jenkins. Those who are still employed by Oracle are the ones mainly supporting Hudson (as far as I am aware the Apache Mave...
Jenkins
11,433,083
144
I am having issues getting Jenkins to build a specified tag. The tag is part of a parametrized build, but I do not know how to pass this through to the git plugin to just build that tag. This has been taking 3 hours of my day and I have conceded defeat to the masters at Stack Overflow.
I was able to do that by using the "branches to build" parameter: Branch Specifier (blank for default): tags/[tag-name] Replace [tag-name] by the name of your tag.
Jenkins
10,195,900
142
I'd like for Jenkins to automagically fetch data from my private repository hosted on Github. But I have no idea how to accomplish that task.. Tried the documentation, generating ssh-key for jenkins user and all what I can see is: "unable to clone the repo". I've checked URLs - they are valid. Any clues, maybe you know...
Perhaps GitHub's support for deploy keys is what you're looking for? To quote that page: When should I use a deploy key? Simple, when you have a server that needs pull access to a single private repo. This key is attached directly to the repository instead of to a personal user account. If that's what you're already...
Jenkins
5,212,304
141
What is the difference between Jenkins and other CI like GitLab CI, drone.io coming with the Git distribution. On some research I could only come up that GitLab community edition doesn't allow Jenkins to be added, but GitLab enterprise edition does. Are there any other significant differences?
This is my experience: At my work we manage our repositories with GitLab EE and we have a Jenkins server (1.6) running. In the basis they do pretty much the same. They will run some scripts on a server/Docker image. TL;DR; Jenkins is easier to use/learn, but it has the risk to become a plugin hell Jenkins has a GUI (t...
Jenkins
37,429,453
140
Could someone please explain to me the idea of artifacts in the build process? I have the workspace directory where I check out the code to compile and run my ant scripts etc. At the end, in my case, I get a jar file that's ready to install. Is that considered to be the artifact? Where should I tell my build script to ...
Your understanding is correct, an artifact in the Jenkins sense is the result of a build - the intended output of the build process. A common convention is to put the result of a build into a build, target or bin directory. The Jenkins archiver can use globs (target/*.jar) to easily pick up the right file even if you ...
Jenkins
5,821,545
137
I want to increase the available heap space for Jenkins. But as it is installed as a service I don´t know how to do it.
If you used Aptitude (apt-get) to install Jenkins on Ubuntu 12.04, uncomment the JAVA_ARGS line in the top few lines of /etc/default/jenkins: # arguments to pass to java #JAVA_ARGS="-Xmx256m" # <--default value JAVA_ARGS="-Xmx2048m" #JAVA_ARGS="-Djava.net.preferIPv4Stack=true" # make jenkins listen on IPv4 address
Jenkins
5,936,519
136
How to trigger a build remotely from Jenkins? How to configure Git post commit hook? My requirement is whenever changes are made in the Git repository for a particular project it will automatically start Jenkins build for that project. In Jenkins trigger build section I selected trigger build remotely. In .git direct...
As mentioned in "Polling must die: triggering Jenkins builds from a git hook", you can notify Jenkins of a new commit: With the latest Git plugin 1.1.14 (that I just release now), you can now do this more >easily by simply executing the following command: curl http://yourserver/jenkins/git/notifyCommit?url=<URL of the...
Jenkins
12,794,568
136
How do I pass variables between stages in a declarative pipeline? In a scripted pipeline, I gather the procedure is to write to a temporary file, then read the file into a variable. How do I do this in a declarative pipeline? E.g. I want to trigger a build of a different job, based on a variable created by a shell acti...
If you want to use a file (since a script is the thing generating the value you need), you could use readFile as seen below. If not, use sh with the script option as seen below: // Define a groovy local variable, myVar. // A global variable without the def, like myVar = 'initial_value', // was required for me in older ...
Jenkins
44,099,851
135
I have a strange problem with the Jenkins HTML Publisher plugin, wherein all the fancy CSS I have added to the report is stripped out when viewed in Jenkins. If I download the report to local, I am able to see the CSS formatting. Is there a setting in Jenkins which allows CSS to be viewed? My HTML Publisher Settings in...
Figured out the issue. Sharing it here for other users. CSS is stripped out because of the Content Security Policy in Jenkins. (https://wiki.jenkins-ci.org/display/JENKINS/Configuring+Content+Security+Policy) The default rule is set to: sandbox; default-src 'none'; img-src 'self'; style-src 'self'; This rule set resul...
Jenkins
35,783,964
135
This isn't as simple as just doing a parametrized build. I've already got a specific build process that will build and deploy whenever any of these branches are pushed to GitHub: So if I've just pushed develop and it built successfully, how do I trigger a manual build and have it pull feature/my-new-feature (without d...
Best solution can be: Add a string parameter in the existing job Then in the Source Code Management section update Branches to build to use the string parameter you defined: If you see a checkbox labeled Lightweight checkout, make sure it is unchecked. The configuration indicated in the images will tell the jenkins j...
Jenkins
32,108,380
135
Installing a plugin from the Update center results in: Checking internet connectivity Failed to connect to http://www.google.com/. Perhaps you need to configure HTTP proxy? Deploy Plugin Failure - Details hudson.util.IOException2: Failed to download from http://updates.jenkins-ci.org/download/plugins/deploy/1.9/d...
Yes, you can. Download the plugin (*.hpi file) and put it in the following directory: <jenkinsHome>/plugins/ Afterwards you will need to restart Jenkins.
Jenkins
14,950,408
135
When you are using a free style project you can set that after 20 minutes the build is aborted if not concluded. How is this possible with a Jenkins Multi Branch Pipeline Project?
You can use the timeout step: timeout(20) { node { sh 'foo' } } If you need a different TimeUnit than MINUTES, you can supply the unit argument: timeout(time: 20, unit: 'SECONDS') { EDIT Aug 2018: Nowadays with the more common declarative pipelines (easily recognized by the top-level pipeline construct), time...
Jenkins
38,096,004
133
I'm adding continuous integration to an EC2 project at work using Jenkins. The Jenkins machine itself is kept on an EC2 machine - one that might need to be taken offline and brought back on an entirely different EC2 instance at any point. We have a bunch of Puppet manifests allowing us to easily reinstall the software ...
Jenkins stores some of the related builds data like the following: The working directory is stored in the directory {JENKINS_HOME}/workspace/. Each job store its related temporal workspace folder in the directory {JENKINS_HOME}/workspace/{JOBNAME} The configuration for all jobs stored in the directory {JENKINS_HOME...
Jenkins
6,131,114
130
I'm using SVN, Maven 3.0.3 on the latest version of Jenkins and the Maven Release plugin. I'm trying to use the Maven release plugin (through Jenkins) do a dry run and so am executing the options … Executing Maven: -B -f /scratch/jenkins/workspace/myproject/myproject/pom.xml -DdevelopmentVersion=53.0.0-SNAPSHOT -Drel...
You're trying to release an artifact that's not a snapshot. That means your artifact's version number is something like 3.0.3. That version number implies its already been released. You can't release a release. There would be no changes in between and therefore no point. You're only supposed to release SNAPSHOT v...
Jenkins
20,054,185
128
I have a little problem. The Problem: I am trying to build a gradle of my Android Project on Jenkins and now I am standing on this problem i can't resolve. During the Building I have this Error message: :Client:mergeDebugResources /var/lib/jenkins/workspace/LMA-Client/Client/build/exploded-aar/com.google.android.gms/p...
I had the following similar error on Ubuntu 13.10: Cannot run program "/usr/local/android-sdk-linux/build-tools/19.0.3/aapt": error=2, No such file or directory And this answer fixed it for me: To get aapt working (this fixed my issues with the avd as well) just install these two packages: sudo apt-get install lib32st...
Jenkins
22,701,405
126
I am trying to run a block if a directory exists in my jenkins workspace and the pipeline step "fileExists: Verify file exists" in workspace doesn't seem to work correctly. I'm using Jenkins v 1.642 and Pipeline v 2.1. and trying to have a condition like if ( fileExists 'test1' ) { //Some block } What are the other ...
You need to use brackets when using the fileExists step in an if condition or assign the returned value to a variable Using variable: def exists = fileExists 'file' if (exists) { echo 'Yes' } else { echo 'No' } Using brackets: if (fileExists('file')) { echo 'Yes' } else { echo 'No' }
Jenkins
38,534,781
125
The horror stories I found while searching for an answer for this one... OK, I have a .sh script which pretty much does everything Jenkins supposed to do: checks out sources from SVN build the project deploys the project cleans after itself So in Jenkins I only have to 'build' the project by running the script in an ...
First things first, hover the mouse over the grey area below. Not part of the answer, but absolutely has to be said: If you have a shell script that does "checkout, build, deploy" all by itself, then why are you using Jenkins? You are foregoing all the features of Jenkins that make it what it is. You might as well hav...
Jenkins
22,814,559
122
I have downloaded "jenkins-1.501.zip" from http://jenkins-ci.org/content/thank-you-downloading-windows-installer . I have extracted zip file and installed Jenkins on Windows 7 successfully. Jenkins runs at http://localhost:8080/ well. I want to stop Jenkins service from console. How can I do that? What's the way to st...
Open Console/Command line --> Go to your Jenkins installation directory (very likely cd "C:\Program Files\Jenkins\"). Execute the following commands respectively: to stop: .\jenkins.exe stop to start: .\jenkins.exe start to restart: .\jenkins.exe restart
Jenkins
14,869,311
121
I'm trying to convert my old style project base workflow to a pipeline based on Jenkins. While going through docs I found there are two different syntaxes named scripted and declarative. Such as the Jenkins web declarative syntax release recently (end of 2016). Although there is a new syntax release Jenkins still suppo...
When Jenkins Pipeline was first created, Groovy was selected as the foundation. Jenkins has long shipped with an embedded Groovy engine to provide advanced scripting capabilities for admins and users alike. Additionally, the implementors of Jenkins Pipeline found Groovy to be a solid foundation upon which to build wha...
Jenkins
43,484,979
119
Solved: Thanks to below answer from S.Richmond. I needed to unset all stored maps of the groovy.json.internal.LazyMap type which meant nullifying the variables envServers and object after use. Additional: People searching for this error might be interested to use the Jenkins pipeline step readJSON instead - find more i...
Use JsonSlurperClassic instead. Since Groovy 2.3 (note: Jenkins 2.7.1 uses Groovy 2.4.7) JsonSlurper returns LazyMap instead of HashMap. This makes new implementation of JsonSlurper not thread safe and not serializable. This makes it unusable outside of @NonDSL functions in pipeline DSL scripts. However you can fall-ba...
Jenkins
37,864,542
119
For example: var output=sh "echo foo"; echo "output=$output"; I will get: output=0 So, apparently I get the exit code rather than the stdout. Is it possible to capture the stdout into a pipeline variable, such that I could get: output=foo as my result?
Now, the sh step supports returning stdout by supplying the parameter returnStdout. // These should all be performed at the point where you've // checked out your sources on the slave. A 'git' executable // must be available. // Most typical, if you're not cloning into a sub directory gitCommit = sh(returnStdout: true,...
Jenkins
36,507,410
119
Somehow in my app many of the cordova plugins are installed and because of that it requires access to almost everything - from my contacts to current location ( even though this app doesn't need this ). This app is build via jenkins and as far as I understand one solution is to remove every plugin with single command,...
First, you should list your plugins: cordova plugin list With this result, you can simply do: cordova plugin remove <PLUGIN_NAME> For example: cordova plugin remove org.apache.cordova.media
Jenkins
21,932,758
119
Under certain conditions I want to fail the build. How do I do that? I tried: throw RuntimeException("Build failed for some specific reason!") This does in fact fail the build. However, the log shows the exception: org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: Scripts not permitted to use new...
You can use the error step from the pipeline DSL to fail the current build. error("Build failed because of this and that..")
Jenkins
37,685,958
118
I'm running Jenkins 2 with the Pipeline plugin. I have setup a Multi-branch Pipeline project where each branch (master, develop, etc.) has a Jenkinsfile in the root. Setting this up was simple. However, I'm at a loss for how to have each branch run periodically (not the branch indexing), even when the code does not cha...
If you use a declarative style Pipeline and only want to trigger the build on a specific branch you can do something like this: String cron_string = BRANCH_NAME == "master" ? "@hourly" : "" pipeline { agent none triggers { cron(cron_string) } stages { // do something } } Found on Jenkins Jira
Jenkins
39,168,861
117
The groovy syntax generator is NOT working for sample step properties: Set Job Properties. I've selected Discard old builds and then entered 10 in the Max # of builds to keep field and then Generate Groovy and nothing shows up. Jenkins version: 2.7
As for declarative syntax, you can use the options block: pipeline { options { buildDiscarder(logRotator(numToKeepStr: '30', artifactNumToKeepStr: '30')) } ... } Parameters for logRotator (from the source code): daysToKeepStr: history is only kept up to this days. numToKeepStr: only this number of build log...
Jenkins
39,542,485
116
When setting up how Jenkins shoul pull changes from subversion I tried checked Poll SCM and set schedule to 5 * * * *, I get the following warning Spread load evenly by using ‘H * * * *’ rather than ‘5 * * * *’ I'm not sure what H means in this context and why I should use that.
H stands for Hash To allow periodically scheduled tasks to produce even load on the system, the symbol H (for “hash”) should be used wherever possible. For example, using 0 0 * * * for a dozen daily jobs will cause a large spike at midnight. In contrast, using H H * * * would still execute each job once a day,...
Jenkins
26,383,778
115
I'm looking to run automated NUnit tests for a C# application, nightly and on each commit to svn. Is this something that Jenkins-CI can do? Is there an online tutorial or how-to document which documents a similar setup that I can look at?
I needed to do exactly what you do, here's how I setup Jenkins to do this: Add the NUnit Plugin to Jenkins In your project go to Configure -> Build -> Add a build step In the dropdown scroll down to -> Execute Windows Batch Command Ensure this step is placed after your MSBuild step Add the following, replacing the va...
Jenkins
9,121,312
114
I am trying to use the Jenkins REST API. In the instructions it says I need to have the API key. I have looked all over the configuration pages to find it. How do I get the API key for Jenkins?
Since Jenkins 2.129 the API token configuration has changed: You can now have multiple tokens and name them. They can be revoked individually. Log in to Jenkins. Click your name (upper-right corner). Click Configure (left-side menu). Use "Add new Token" button to generate a new one then name it. You must copy the toke...
Jenkins
45,466,090
113