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
I am getting the strange error below in my Jenkins pipeline [Pipeline] withDockerContainer acp-ci-ubuntu-test does not seem to be running inside a container $ docker run -t -d -u 1002:1006 -u ubuntu --net=host -v /var/run/docker.sock:/var/run/docker.sock -v /home/ubuntu/.docker:/home/ubuntu/.docker -w /home/ubuntu/work...
This error means the Jenkins process is stuck on some command. Some suggestions: Upgrade all of your plugins and re-try. Make sure you've the right number of executors and jobs aren't stuck in the queue. If you're pulling the image (not your local), try adding alwaysPull true (next line to image). When using agent ins...
Jenkins
58,346,984
36
I am trying to activate a pipeline on any merge request change. This works as long as my pipeline script is in Jenkins UI. Now I outsourced my script on GitLab, and the checkout should happen via the pipeline via scm option. But all I get on build (yes, it triggers) is: java.lang.IllegalArgumentException: Invalid refs...
Most likely this is a Jenkins bug. https://issues.jenkins-ci.org/browse/JENKINS-46588 There seems to a solution anyway: In your project configuration under Pipeline -> SCM -> Branches to build -> "Branch Specifier (blank for 'any'): Do not use blank for any or * or .* or **. Use: */* Another workaround would be to dis...
Jenkins
46,684,972
36
I want to get Getting current timestamp in inline pipeline script using pipeline plugin of hudson. For setting up build display name. Inline groovy script used: def jobName = env.JOB_NAME + "_" + new Date() currentBuild.displayName = "$jobName" node { echo "job name $jobName" } Error on console : org.jenkinsci.plug...
you can also use this, I needed this in ms so: echo "TimeStamp: ${currentBuild.startTimeInMillis}" echo "TimeStamp: ${Util.getTimeSpanString(System.currentTimeMillis())}"
Jenkins
40,261,710
36
I have 10 jenkins job in folder foo. I have created a new sub folder baar in folder foo. How to move the 10 jobs from folder foo to the subfolder baar?
First, you need to install cloudbees folder plugin then you will see Move option in jobs click on it,then option(drop down) will come where you want to move select and move
Jenkins
39,406,546
36
I am triggering a parameterized Jenkins from from outside of jenkins via a http POST request: I have enabled in the job configuration that the job can be triggered from outside and i can really trigger it by sending jenkins a request with a content like this: POST http://myJenkins.com/myJob/buildWithParameters?token=M...
Since Jenkins 1.519, enqueuing a build responds with a URL in the Location, pointing you to an item in the build queue: $ nc localhost 8666 POST /jenkins/job/morgRemote/buildWithParameters?jenkins_status=1&jenkins_sleep=20&token=morgRemote HTTP/1.1 Host: localhost:8666 HTTP/1.1 201 Created Location: http://localhost:8...
Jenkins
24,507,262
36
I want to deploy with jenkins to the test environment and to the production environment. To do so I need to connect to the server of the wanted environment, something like ssh/scp. I would like to know what the best way is. I found some plugins to do this, like the Jenkins-Deploy-Plug-in or Jenkins Publish over SSH Pl...
I suggest the following procedure: one single shell script (stored somewhere on the jenkins server) does everything. Basically, the script does scp of the build artifact and then connects to the server (ssh) and does all the necessary tasks to deploy (setup maintenance page, backup the current app, deploy the new app, ...
Jenkins
13,976,373
36
I'm running a Jenkins CI server on an OS X machine. The server is running as a standard user 'john', and is started by running launchctl. One of the things this server does is build XCode projects using keys and certificates stored in a keychain 'xcode.keychain': Jenkins (which is running under the user 'john' accordi...
I had to: Right-click on the private key in my keychain that my build process was trying to use Click "Get Info" Then the "Access Control" tab. You can add specific apps (like "codesign") to the list of apps that are allowed access to that key, or just allow access from all applications. This cleared it up for me. M...
Jenkins
6,416,121
36
I need to build my application using Java 11. However the dropdown menu stops at Java 9. What do I do? OpenJDK is acceptable too. I'm on the latest version of Jenkins. Edit: as of now I've downloaded the binaries using wget, extracted them on the machine, and added a JDK JDK_HOME entry via Global Configurations.
I guess you are using the JDK Tool Plugin. Click "Manage Jenkins" > "Global Tool Configuration" > "Add JDK" (near JDK installations) Delete the java.sun.com installer. Just click "Add Installer" below and choose "Extract .zip/.tar.gz" Enter following: Label: openjdk-11 Download URL: https://download.java.net/java/GA/jd...
Jenkins
55,243,120
35
I have a job with as cron: 5 3,21 * * 1-5 This will run my job at 03:05AM and 09:05PM. Now I read it's a best practice to use H. I try: H/5 3,21 * * 1-5 What is the meaning now? Will this schedule a build in a range of 5 minutes or 5 minutes after 3AM and 21PM?
The H will take a numeric hash of the Job name and use this to ensure that different jobs with the same cron settings do not all trigger at the same time. This is a form of Scheduling Jitter H/5 in the first field means Every five minutes starting at some time between 0 and 4 minutes past the hour So H/5 3,21 * * 1-5 i...
Jenkins
47,302,607
35
I want to be able to say something like: git branch: commitHash, credentialsId: credentialsId, url: url The usecase: I'm doing parallel build and test runs on different platforms, and want to ensure each gets the same code. It is C++, and we build on separate platforms as well as building on them. If I do the above, i...
Use a general scm step checkout([$class: 'GitSCM', branches: [[name: commitHash ]], userRemoteConfigs: [[url: 'http://git-server/user/repository.git']]])
Jenkins
43,611,673
35
In one of my stages I need to copy the contents of two folders after a build is completed and copy to a different directory. I am actually converting a freestyle job to pipeline, and have been using the artifact deployer plugin. Reading around, it looks like stash and unstash commands should help with what I want to ac...
I hope it is meant to be this: stash includes: 'dist/**/*', name: 'builtSources' stash includes: 'config/**/*', name: 'appConfig' where dist and config are the directories in the workspace path, so it should be a relative path like above. Rest seems alright, only to mention that path "/some-dir" should be writable by...
Jenkins
43,050,248
35
I'm trying to access a variable from an input step using the declarative pipelines syntax but it seems not to be available via env or params. This is my stage definition: stage('User Input') { steps { input message: 'User input required', ok: 'Release!', parameters: [choice(name: 'RELEASE_SCOPE...
Since you are using declarative pipelines we will need to do some tricks. Normally you save the return value from the input stage, like this def returnValue = input message: 'Need some input', parameters: [string(defaultValue: '', description: '', name: 'Give me a value')] However this is not allowed directly in decla...
Jenkins
42,501,553
35
I have a file pipeline.gdsl that contains the Syntax for my Jenkins Pipeline DSL. Following this blog post I put the file into the /src folder of my Java project. When I now edit my Jenkinsfile (residing in the root folder of my project), I don't get any code completion / syntax explanation as I would expect. My projec...
The problem was, that /src was not marked as a source root folder in my project. Creating a folder /src/main/groovy, putting the file in there and marking it as a sources root (right click on the folder -> Mark directory as -> Sources Root) did the trick.
Jenkins
41,062,514
35
I am attempting to write a pipeline script to use with Jenkins 2.0 to replicate our existing build. This original build used the envInject plugin to read a Java properties file, but I can't see how to do this from the pipeline Groovy script. I have Googled and found the following, but it doesn't work (FileNotFoundExc...
I just fought with this yesterday and today. I wish the availability of this was easier to find. Grab the 'Pipeline Utility Steps' plugin. Use the readProperties step. def props = readProperties file: 'dir/my.properties' One word of warning - what I expected to be booleans in the properties files were treated as st...
Jenkins
39,619,093
35
I am currently testing the pipeline approach of Jenkins 2.0 to see if it works for the build environment I am using. First about the environment itself. It currently consists of multiple SCM repositories. Each repository contains multiple branches, for the different stages of the development and each branch is build wi...
If you're using a declarative multi-branch pipeline, you can use: triggers { upstream(upstreamProjects: "some_project/some_branch", threshold: hudson.model.Result.SUCCESS) } If you wish for branch matching to occur across dependencies you can use: triggers { upstream(upstreamProjects: "some_project/" + env.BRANCH_...
Jenkins
36,825,103
35
I have no idea why after Jenkins is updated to version 1.591 (Ubuntu Server 12.04), the originally correctly set up reverse proxy now becomes broken. My current setting is exactly the same as said in Jenkins wiki: ProxyPass /jenkins http://localhost:8081/jenkins nocanon ProxyPassReverse /jenkins http://localhost:8081/j...
I was faced with this issue with Jenkins as a Windows Service Package. According to their wiki: Make sure the Jenkins URL configured in the System Configuration matches the URL you're using to access Jenkins. To reach the System Configuration: Go to your Jenkins page Click Manage Jenkins Click Configure System Scro...
Jenkins
27,161,854
35
It seems like this should be easy to integrate CMake+CTest in jenkins. The cmakebuilder plugin is extremely easy to configure (just set the source tree and the build tree, done!). However I fail to understand how to call the CTest steps. According to the main xUnit page, since version 1.58 the XML output from CTest is ...
Here is a small example that demonstrates how to have xUnit pick up a CTest generated XML test result file. The example consists of a single C++ source file main.cpp #include <cstdlib> int main() { std::exit(-1); } and an accompanying CMakeLists.txt: cmake_minimum_required(VERSION 2.8) project(JenkinsExample) enab...
Jenkins
21,633,716
35
I have installed Jenkins by deploying its WAR file to Tomcat. On typing http://localhost:8080/jenkins In browser, jenkins home page is opening which means jenkins is successfully installed. I configured system settings, gave jdk and maven path and save them. Then to install plugins, I clicked on Jenkins->Manage plugi...
Go to: Manage Jenkins → Manage Plugins → Advanced, then click Check now in the bottom right-hand corner. When you go back to Available tab all plugins should be listed.
Jenkins
16,213,982
35
How can I change the location where jenkins store temp data in its slaves. Currently, it shuts down the connection to my slaves because it complains about the following Disk space is too low. Only 0.119GB left on /tmp. I want to move the tmpdir location to something like /var/tmp/ instead of /tmp. How can I do that?
Just add "-Djava.io.tmpdir=/path/to/tmp" to the java command line options (you don't need any extra service wrapper). Depending on your installation there might be an existing startup script and/or config file this can go into. On my fedora system, I can add the option to the /etc/sysconfig/jenkins file: ## Type: ...
Jenkins
15,675,783
35
When I run my selenium test (mvn test) from jenkins (windows) I see only the console output. I don't see the real browsers getting opened . How can I configure jenkins so that I can see the browsers running the test?
I had the same problem, i got the solution after many attempts. This solution works ONLY on windows XP If you are using jenkins as a windows service you need to do the following : 1) In windows service select the service of jenkins 2) Open properties window of the service -> Logon-> enable the checkbox "Allow service ...
Jenkins
9,618,774
35
I am trying to create a bash script for setting up Jenkins. Is there any way to update a plugin list from the Jenkins terminal? At first setup there is no plugin available on the list i.e.: java -jar jenkins-cli.jar -s `http://localhost:8080` install-plugin dry won't work
A simple but working way is first to list all installed plugins, look for updates and install them. java -jar /root/jenkins-cli.jar -s http://127.0.0.1:8080/ list-plugins Each plugin which has an update available, has the new version in brackets at the end. So you can grep for those: java -jar /root/jenkins-cli.jar -s ...
Jenkins
7,709,993
35
I have set up Jenkins, but I would like to find out what files were added/changed between the current build and the previous build. I'd like to run some long running tests depending on whether or not certain parts of the source tree were changed. Having scoured the Internet I can find no mention of this ability within ...
I have done it the following way. I am not sure if that is the right way, but it seems to be working. You need to get the Jenkins Groovy plugin installed and do the following script. import hudson.model.*; import hudson.util.*; import hudson.scm.*; import hudson.plugins.accurev.* def thr = Thread.currentThread(); def ...
Jenkins
6,260,383
34
I am using the Pipeline plugin in Jenkins by Clouldbees (the name was Workflow plugin before), I am trying to get the user name in the Groovy script but I am not able to achieve it. stage 'checkout svn' node('master') { // Get the user name logged in Jenkins }
Did you try installing the Build User Vars plugin? If so, you should be able to run node { wrap([$class: 'BuildUser']) { def user = env.BUILD_USER_ID } } or similar.
Jenkins
35,902,664
34
Maybe a fool question, I installed jenkins on windows by default, have set no user/password, it worked at first, no need to login. But when launch the 8080 webpage now, it hangs the login page, I've tried some normal user/password combinations, none could pass. Also searched the resolution on website, only find some ab...
You can try to re-set your Jenkins security: Stop the Jenkins service Open the config.xml with a text editor (i.e notepad++), maybe be in C:\jenkins\config.xml (could backup it also). Find this <useSecurity>true</useSecurity> and change it to <useSecurity>false</useSecurity> Start Jenkins service You might create an ...
Jenkins
39,340,322
34
I'm trying to mask a password in my Jenkins build. I have been trying the mask-passwords plugin. However, this doesn't seem to work with my Jenkins pipeline script, because if I define the password PASSWD1 and then I use it in the script like this ${PASSWD1}, I am getting: No such DSL method '$' found among steps [addT...
The simplest way would be to use the Credentials Plugin. There you can define different types of credential, whether it's a single password ("secret text"), or a file, or a username/password combination. Plus other plugins can contribute other types of credentials. When you create a credential (via the Credentials lin...
Jenkins
42,371,909
34
I have a fresh install of Jenkins as a service on my Linux machine. When Jenkins installs, it creates a 'jenkins' user, but I can't seem to find the default password for it anywhere. I'm trying to secure my system, so if the default password is '123' or something insecure that I just haven't thought of yet, that's a pr...
I don't believe it has any password. You should be able to do: sudo passwd jenkins This will prompt for you to set a password. Alternatively you could create the jenkins user prior to installing, and it would leverage that one.
Jenkins
25,041,125
34
I have written a simple script via PowerShell to gather some files and zip them into one folder, lets call it Script.ps1. I want to make the script run every time Jenkins does a new build, however I also would like the name of the zip file to be the BUILD_NUMBER. How can I create a variable in PowerShell that is Jenki...
I'm not familiar with Jenkins, but I believe BUILD_NUMBER is an environment variable. To access it in PowerShell, use $env:BUILD_NUMBER E.g. If using 7-zip 7z.exe a "$env:BUILD_NUMBER.zip" C:\Build\Path
Jenkins
24,291,827
34
I've been researching this for a good few hours now, but I've only found pieces of the big picture. Everywhere they are assuming that the reader already has a part of the system set up. I think it will be useful to have a big picture description of the parts needed to put the whole thing together. They all say "use you...
Responses, following your list: Q1. Install Jenkins (we already have that on our server) A1. None needed. Q2. Install plugins for Jenkins (which ones?) A2. As far as I remember no specific plugin is required just for this purpose. Jenkins should be able to run maven or ant job, it's out of the box. Q3. Install xvfb so ...
Jenkins
17,719,385
34
I have a Maven job in Jenkins. Before the actual build step I have an "Execute shell" pre-build step. In that shell I set a variable: REVISION=$(cat .build_revision) I would like to use that variable in the Maven build job in "Goals and options": clean install -Drevision=${REVISION} But that does not work! The "Drevi...
You're on the right track here, but missed a third feature of the EnvInject-Plugin: The "Inject environment variables" build step that can inject variables into following build steps based on the result of a script or properties. We're using the EnvInject plugin just like that; A script sets up a resource and communic...
Jenkins
16,332,659
34
I am new to Jenkins, I am getting following error while cloning repository from GitHub. I tried to search all relevant issues here but could find exact stacktstrace with answers. I am trying to clone repository which requires username and password, I am providing SSH:// repository-path in job configuration settings for...
I encountered and fixed the same problem :) There are two way to configure the path of git: On Jenkins Master a. Enter Jenkins System Configure (Jenkins -> Manage Jenkins -> Configure System ) b. Find the Git item and Configure the git installation (specify the git path on Jenkins Master) On Jenkins Slave a. Enter Jen...
Jenkins
12,202,078
34
In Jenkins is there a plugin for parameterized builds to make the parameters required? The fields under the standard "This build is parameterized" option do not seem to provide that. Clarification: by "required" I mean that the build will not execute until the field is populated with a value. This would obviously pre...
The accepted answer is no longer valid. There was a plugin that did that but is no longer maintained. There's an open bug to support it. In the mean time what you can do is check if your parameter is present and if not throw an error like: if (!params.SomeParam) { error("Build failed because of this and that..") } ...
Jenkins
10,742,401
34
I have two Jenkins projects that share a database. They must not be run simultaneously. Strictly speaking, there is no particular dependency between them beyond non concurrency, but at the moment I partially manage this constraint by running one "downstream" of the other. This works most of the time, but not always. If...
The Locks and Latches plugin should resolve your problem. Create a lock and have both jobs use the same lock. That will prevent the jobs from running concurrently. Install the plugin in "Manage Jenkins: Manage Plugins." Define (provide a name for) your lock(s) in "Manage Jenkins: Configure System." For each job yo...
Jenkins
10,115,759
34
I currently set up a Jenkins Multibranch Pipeline job that is based on a Git repository hosted on our GitLab server. Jenkins can read the branches in the repository and creates a job for every branch in the repository. But I can't figure out how to trigger the jobs with webhooks in GitLab. My questions are: How can I ...
You need to install the GitLab Plugin on Jenkins. This will add a /project endpoint on Jenkins. (See it in Jenkins => Manage Jenkins => Configure System => GitLab) Now add a webhook to your GitLab project => Settings => Integrations. (or in older GitLab versions: GitLab project => Wheel icon => Integrations, it seems y...
Jenkins
40,979,405
33
I recently ran into something of a puzzler while working on some Jenkins builds with a coworker. He's been using params.VARIABLE and env.VARIABLE interchangably and having no issues with it. Meanwhile, I started getting null object errors on one of his calls to a parameter object through the environment on this line ...
Basically this works as follows env contains all environment variables. Jenkins pipeline automatically creates a global variable for each environment variable params contains all build parameters. Jenkins also automatically creates an environment variable for each build parameter (and as a consequence of the second po...
Jenkins
50,398,334
33
I would like to use Pipeline to keep track of my Jenkin Jobs within my SCM. (Source control manager). Is there a way I can take my existing jobs and export them to a valid Jenkinsfile which can be read by Pipeline? The main plugins I'm using which I would need to be exported are Github Pull Request Builder, Test result...
Turns out the short answer is that you can't. You need to look up each plugin you use and see if it has a syntax or support for Jenkinsfile and Pipelines.
Jenkins
41,224,533
33
I am trying to setup a project that uses the shiny new Jenkins pipelines, more specifically a multibranch project. I have a Jenkinsfile created in a test branch as below: node { stage 'Preparing VirtualEnv' if (!fileExists('.env')){ echo 'Creating virtualenv ...' sh 'virtualenv --no-site-package...
What you are trying to do will not work. Every time you call the sh command, jenkins will create a new shell. This means that if you use .env/bin/activate in a sh it will be only sourced in that shell session. The result is that in a new sh command you have to source the file again (if you take a closer look at the co...
Jenkins
40,836,570
33
I got very strange behavior that has never happened before, when I try to configure the GitHub server in Jenkins general configuration to set up webhooks auto. The drop down menu doesn't display my registered credentials. I was always be able to do that, but suddenly I don't know what's happening. I tried to uninstall ...
The issue is that the GitHub plugin only accepts plain text credentials. The GitHub access token can be created manually, or automatically via the Advanced... options as described here. In case you already have an access token in GitHub (you'll get an error in Jenkins), you can remove it in Github. Then you can let Jen...
Jenkins
36,500,729
33
I have a React app that has Jest tests. I'm configuring Jest in my package.json: … "jest": { "setupEnvScriptFile": "./test/jestenv.js", "setupTestFrameworkScriptFile": "./test/setup-jasmine-env.js", "testRunner": "node_modules/jest-cli/src/testRunners/jasmine/jasmine2.js", "unmockedModulePathPatterns...
If you use a more recent version of jest (I'm looking at 16.0.2), you don't need to specify the testrunner because jasmine is the default. You also don't need the unmockedModulePathPatterns section of the jest config. I.e. you just need to include the following devDependencies in your package.json: "jasmine-reporters":...
Jenkins
34,427,553
33
I want to use Java 11 syntax in my unit tests, but my 'main' code needs to be compiled for Java 8 since my production environment only has JDK 8 installed. Is there a way of doing this with the maven-compiler-plugin? My Jenkins server has Java 11 installed. I will accept the risk that I can accidental use Java 11 speci...
In Maven compile and testCompile goals are different. And Maven even has parameters for testCompile: testTarget and testSource. So: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.0</version> <configuration> <source>1.7</source> ...
Jenkins
24,323,176
33
I've seen similar posts to this on SO, but not quite exactly what I am trying to do (or at least no full examples of a command to run). I am trying to remotely trigger a parameterized build on Jenkins using curl. I have 'Prevent Cross Site Request Forgery' enabled so I also need to pass a valid crumb. The script I hav...
What worked for me: SERVER=http://localhost:8080 CRUMB=$(curl --user $USER:$APITOKEN \ $SERVER/crumbIssuer/api/xml?xpath=concat\(//crumbRequestField,%22:%22,//crumb\)) curl --user $USER:$APITOKEN -H "$CRUMB" -d "script=$GROOVYSCRIPT" $SERVER/script
Jenkins
23,497,819
33
I am trying to get the git short hash in a variable. I tried to set GIT_COMMIT_SHORT variable to run 'git rev-parse --short HEAD' but it didn't work. I need this variable to pass to ant build script so the package name include this short hash. I am running Jenkins on windows 2008 server. Thanks
Probably the simplest way to achieve the result you want would be to use the GIT_REVISION token makro, like this: ${GIT_REVISION,length=6} Have a look at https://wiki.jenkins-ci.org/display/JENKINS/Token+Macro+Plugin for more details. Hope this helps, Jan
Jenkins
16,943,665
33
We are using maven. I want to set up infrastructure, so that automatically built artifacts would go to Nexus repository. And then they could be used by developers. I have already set up Jenkins with 1 job for our project. And I set up Nexus to on the same server. On developers' PCs I copied default maven setting to C:\...
To deploy artifacts to Nexus, you'll need to include a distributionManagement section in your pom. Nexus ships with specific repositories already set up for both snapshots and releases. You should give the correct path to each of those so that maven will deploy snapshot and release artifacts to the correct repos. Then ...
Jenkins
6,950,346
33
I'm trying to set up hudson with git according to this article, but I still get git errors during build: FATAL: Could not apply tag-PROJECTNAME-ID ... Caused by: hudson.plugins.git.GitException: Command returned status code 128: *** Please tell me who you are. running: git config --global user.name shows valid data, ...
After installing the git plugin you can configure git name and email in Jenkins "Configure System" page...
Jenkins
2,671,296
33
I have a virtual machine hosting Oracle Linux where I've installed Docker and created containers using a docker-compose file. I placed the jenkins volume under a shared folder but when starting the docker-compose up I got the following error for Jenkins : jenkins | touch: cannot touch ‘/var/jenkins_home/copy_refe...
The easy fix it to use the -u parameter. Keep in mind this will run as a root user (uid=0) docker run -u 0 -d -p 8080:8080 -p 50000:50000 -v /data/jenkins:/var/jenkins_home jenkins/jenkins:lts
Jenkins
44,065,827
32
In my Jenkins pipelines I generally use post declarative function to send me an email incase the pipeline has failed. A simple syntax of the post function is as under: post { failure { mail to: 'team@example.com', subject: "Failed Pipeline: ${currentBuild.fullDisplayName}", body: ...
There is a variable called env.STAGE_NAME which you can use. However, in your case you will probably need to store the stage name in a different variable, because when you get the env.STAGE_NAME in a post stage the result will be Declarative: Post Actions. Instead, you will need to store the stage name in a variable in...
Jenkins
50,411,381
32
I'm developing Jenkins pipelines as Groovy scripts (scripted pipelines, not declarative), and having a real hard time. Jenkins is always very generic regarding syntax/semantic errors, outputting stacks like below: groovy.lang.MissingPropertyException: No such property: caughtError for class: groovy.lang.Binding at groo...
I have seen this post, http://notes.asaleh.net/posts/debugging-jenkins-pipeline/ Which describe how to debug a groovy script for jenkins pipeline. it's clearly describe the steps how to do it.
Jenkins
47,993,538
32
env.JOB_NAME Is the pipeline name suffixed with the branch name. So env.JOB_NAME will be <jenkins_pipeline_name>_<my_branch> How can I just get the pipeline name and store it in a var in the environment{} block at the top of my jenkinsfile to use through the file? I don't want to resort to scripted pipeline just the de...
@red888 pointed out the following answer that worked like magic for me. I am pointing it out in an actual answer because I almost missed it: env.JOB_BASE_NAME Credit to @red888 in the comment above. Send upvotes his/her way.
Jenkins
45,746,902
32
I have to create this JSON file in Groovy. I have try many things (JsonOutput.toJson() / JsonSlurper.parseText()) unsuccessfully. { "attachments":[ { "fallback":"New open task [Urgent]: <http://url_to_task|Test out Slack message attachments>", "pretext":"New open task [Urgent]: <http://url_to...
JSON is a format that uses human-readable text to transmit data objects consisting of attribute–value pairs and array data types. So, in general json is a formatted text. In groovy json object is just a sequence of maps/arrays. parsing json using JsonSlurperClassic //use JsonSlurperClassic because it produces HashMap t...
Jenkins
44,707,265
32
My Jenkins is not run in Docker container, just tradional install to VPS. I got the following error when executing a simple test project. I am using Ubuntu 14, java 7, and stable Jenkins. I tried all methods I can find on google, but can't get it work. I am trying to execute this shell docker build --pull=true -t nick...
In your VPS server terminal, do this to add your jenkins user to the docker group: sudo usermod -aG docker jenkins Then restart your jenkins server to refresh the group. Take into account any security issue that this could produce: Warning: The docker group grants privileges equivalent to the root user. For details o...
Jenkins
44,444,099
32
Tried with the configure option, not able to find the tools configuration option and the git executable section. Seems like it occurs after a successful build only. Please help. Here's the output I receive after building the project on the console output section: Building in workspace C:\Users\Anishas\.jenkins\worksp...
This wasted so much time on my Jenkins Windows slave. I knew git was in the path because I executed "where git" in the build job's batch command. where git C:\Program Files (x86)\Git\cmd\git.exe Apparently the Jenkins Git Plugin executes ** before ** the environment is inherited. SET YOUR SLAVE's PATH to Git ( Just DO...
Jenkins
37,155,321
32
It looks like the GitHubPullRequestBuilder is not compatible with Jenkins v2.0 pipeline jobs. How do you configure a pipeline job to be triggered from a GitHub pull request event? The documentation on this topic is sparse and I cannot find any examples of this. Or is it better to create a web-hook in GitHub to trigg...
I had similar issue. Here’s what worked for me Pre-req Jenkins ver. 2+ (I was using Jenkins 2.60) Github (or Githhub enterprise) account Your github and Jenkins must be able to talk to each other. On Github create a github Personal Access Token (PAT) with relevant rights. For your repo, create a webhook with ...
Jenkins
36,850,485
32
I have found a way to access the credentials store in Jenkins: def getPassword = { username -> def creds = com.cloudbees.plugins.credentials.CredentialsProvider.lookupCredentials( com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials.class, jenkins.model.Jenkins.instance )...
This works. It gets the credentials rather than the store. I didn't write any error handling so it blows up if you don't have a credentials object set up (or probably if you have two). That part is easy to add though. The tricky part is getting the right APIs! def getPassword = { username -> def creds = com.cloudbe...
Jenkins
35,205,665
32
To free up space on C:, I would like to move my Jenkins data files (specifically the \jobs directory) from the default installation directory C:\Program Files (x86)\Jenkins to F:\Jenkins\home. I think what I need to do is set the JENKINS_HOME environment variable to F:\Jenkins\home. But no matter what I try, the JENKIN...
Pre Jenkins 2.121 JENKINS_HOME is where Jenkins is installed which is not what you want to change. After you start up Jenkins, go to: Manage Jenkins System Configuration Click the first "advanced" button This gives you text fields where you can change the directory for the workspace and builds directories. Those are ...
Jenkins
28,034,663
32
Is there a easy way to get a list of all node labels in Jenkins? I can see which labels are set on each node (.../computer/) and which nodes have the same label (.../label/). But similar to listing all nodes on .../computer/ there is no listing of all the labels on .../label/ The approach with python and jenkinsapi or ...
Haven't installed/tried it myself, but the "label linked jobs" jenkins plugin has a label dashboard as one of its features.. it sounds like this is what you're looking for
Jenkins
27,384,481
32
I'm trying to restart the Jenkins service using Ansible: - name: Restart Jenkins to make the plugin data available service: name=jenkins state=restarted - name: Wait for Jenkins to restart wait_for: host=localhost port=8080 delay=20 timeout=300 - name: Install Jenkins plugins command: java -...
Using the URI module http://docs.ansible.com/ansible/uri_module.html - name: "wait for ABC to come up" uri: url: "http://127.0.0.1:8080/ABC" status_code: 200 register: result until: result.status == 200 retries: 60 delay: 1
Jenkins
23,919,744
32
I've set up a build on Jenkins for a Maven project, and I would like to build it without running any of the tests. I've tried entering "clean install -DskipTests" in the goals field, like this: But it doesn't work. What am I doing incorrectly? Note: I want to skip the tests without touching the pom. I have a separ...
The problem is that I omitted =true. I was able to build without running tests by entering: clean install -DskipTests=true
Jenkins
22,513,839
32
I just joined a company that uses batch files to build a C++ project. The batch does all sorts of things (updates svn, which is now done by jenkins), creates build folders, deletes unnecessary files after building, copies library files to the build folder, etc. My problem is Jenkins always considers the build successfu...
To answer each of your questions - Jenkins always return "SUCCESS", even when the Job actually failed: Jenkins sets the status of the Job, based on the return-code of the last command that ran in each "Execute windows batch command" block. If your last command is copy some.log D:, Jenkins thinks everything is OK (If t...
Jenkins
13,972,636
32
I have a GitHub repo that's big and contains several independently build-able bits. If I configure Jenkins with a job (or two) for each of these, I end up with having to pull gigabytes of data multiple times (one clone of the repo for each job). This takes both diskspace and bandwidth. What I'd like to do is have "Refr...
If you open the job configuration and click on the Advanced button of the git SCM configuration, you will see a place to specify "Path of the reference repo to use during clone (optional)". If you have a local clone of your repository, add the path to the reference repo field. Git will then use the local clone and shar...
Jenkins
9,914,664
32
I'm trying to follow the directions here: https://wiki.jenkins-ci.org/display/JENKINS/Running+Jenkins+behind+Apache to set up my Jenkins server to appear at http://myhost/jenkins. It works, but the Jenkins website thinks http://myhost/ is the jenkins/ root. I believe this problem is caused by the first warning flag o...
Paraphrasing from the document you mentioned; You need to specify the context/prefix of the Jenkins instance, this can be done by modifying the Jenkins configuration as follows; Either, set the context path by modifying the jenkins.xml configuration file and adding --prefix=/jenkins (or similar) to the entry. Or ...
Jenkins
9,089,566
32
Is there any option to install jenkins plugins from command line ? I found a command for this after a bit google search : java -jar /var/lib/jenkins/jenkins.war -s http://127.0.0.1:8080/ install-plugin ${Plugin_Name} But it's not working.
As per the Jenkins command line interface documentation, you need to use the client JAR file (not the server WAR file you're using), which you can obtain directly from Jenkins, e.g. via the links on http://localhost:8080/cli Then you can run the command using this JAR: java -jar jenkins-cli.jar -s http://127.0.0.1:8080...
Jenkins
34,761,047
31
In a declarative pipeline, I can specify the parameter that the pipeline expects right in the pipeline script like so: pipeline { parameters([ string(name: 'DEPLOY_ENV', defaultValue: 'TESTING' ) ]) } is it possible do to in a scripted pipline? I know I can do this : BUT, IS IT POSSIBLE TO DO THIS: node{ ...
I found a solution by experimentation so want to share it: properties( [ parameters([ string(defaultValue: '/data', name: 'Directory'), string(defaultValue: 'Dev', name: 'DEPLOY_ENV') ]) ] ) node { // params.DEPLOY_ENV ... }
Jenkins
53,747,772
31
I'm trying to trigger a downstream job from my current job like so pipeline { stages { stage('foo') { steps{ build job: 'my-job', propagate: true, wait: true } } } } The purpose is to wait on the job result and fail or succeed according to that result. Jenkins is always failing with th...
I actually managed to fix this by paying more attention to the definition of the build step. Since all my downstream jobs are defined as multibranch pipeline jobs, their structure is folder-like, with each item in the folder representing a separate job. Thus the correct way to call the downstream jobs was not build job...
Jenkins
46,471,467
31
Is there a way to trigger a Jenkins job to run every hour using the Jenkinsfile scripted pipeline syntax? I have seen examples using the declarative syntax, but none using the pipeline syntax. Declarative Syntax Example pipeline { agent any triggers { cron '@daily' } ... }
You could use this snippet for Scripted pipeline syntax: properties( [ ... , // other properties that you have pipelineTriggers([cron('0 * * * *')]), ] ) Reference for properties is here. You can search for "pipelineTriggers" string and find out that triggers for build can be for example artif...
Jenkins
44,113,834
31
I have an external tool that should be called as build-step in one of my jenkins jobs. Unfortunately, this tool has some issues with quoting commands to avoid problems with whitespaces in the path that is called from. Jenkins is installed in C:\Program Files (x86)\Jenkins. Hence I'm having trouble with jenkins calling...
the ws instruction sets the workspace for the commands inside it. for declarative pipelines, it's like this: ws("C:\jenkins") { echo "awesome commands here instead of echo" } You can also call a script to build the customWorkspace to use: # if the current branch is master, this helpfully sets your workspace to /tmp/...
Jenkins
43,627,358
31
The Extended Choice Parameter plugin is great and I use it in jobs configured via the UI https://wiki.jenkins-ci.org/display/JENKINS/Extended+Choice+Parameter+plugin However, I'm struggling to get it working in a Jenkinsfile style pipeline script. It would appear that the Extended Choice Parameter plugin isn't yet full...
Since April's 2nd, 2019 it's now possible because of this commit: https://github.com/jenkinsci/extended-choice-parameter-plugin/pull/25 You can use it like this for instance: properties([ parameters([ extendedChoice( name: 'PROJECT', defaultValue: '', description: 'Sél...
Jenkins
42,392,247
31
I wish to change the time zone of the Jenkins. I have changed the time zone of the Jenkins installed server, but the Jenkins UI shows the different time. I need to set the PST time for Jenkins UI. How can I do it?
On Jenkins2 you can set the timezone at runtime via the Groovy Console. Just open "Manage Jenkins >> Script Console" and type System.setProperty('org.apache.commons.jelly.tags.fmt.timeZone', 'America/Los_Angeles') for example. Particularly helpful if you have no chance to change the startup variables but have admin rig...
Jenkins
42,202,070
31
I am considering to use Jenkins pipeline script recently, one question is that I don't figure out a smart to way to create internal reusable utils code, imagine, I have a common function helloworld which will be used by lots of pipeline jobs, so I hope to create a utils.jar can injected it into the job classpath. I not...
The Shared Libraries (docs) allows you to make your code accessible to all your pipeline scripts. You don't have to build a plugin for that and you don't have to restart Jenkins. E.g. this is my library and this a Jenkinsfile that calls this common function. EDIT (Feb 2017): The library can be accessed through Jenkins...
Jenkins
38,695,237
31
Our build server runs Jenkins 1.502 with Subversion plugin upgraded to version 1.45. This plugin uses svnkit-1.7.6-jenkins-1.jar. Also we have SVN client 1.7.8 installed. Jenkins successfully checks out source code from SVN repository. But when I go to workspace directory and try to run some svn command manually, it fa...
There is an option in jenkins to tell svn which working copy format to use(manage jenkins > configure system), look for a 'Subversion Workspace Version' pulldown - it's likely set to 1.4. change it to the latest version in the list.
Jenkins
15,107,857
31
I'm attempting to build an ASP.NET vNext project in TeamCity. When it tries to build, I get the following error: C:\...\MyApp.kproj(7, 3): error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\AspNet\Microsoft.Web.AspNet.Props" was not found. Confirm that the path in the <Imp...
Edit: As of TeamCity 9.x, all works out of the box, but for earlier versions, the below is a solution. The project import problem should be solved by setting a env.VSToolsPath environment property to C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0. However, you will not be able to build using the TeamCity ...
TeamCity
27,095,531
13
A little background. In my environment we have a large number small .NET solutions each in their own Subversion repositories (500+). We not a TFS shop and are currently evaluating moving our home grown CI process to TeamCity. Instead of having these 500+ repos polling our Subversion server every 5-10 minutes or so...
bt7 is a build type identifier. Each build configuration has one. You can get the full list using the rest api as follows http://buildserver:8111/httpAuth/app/rest/buildTypes You can also see the build type in the url if you click any of the build configurations on your team city page. You will see a url parameter suc...
TeamCity
9,436,792
13
I am trying to setup a build trigger for TeamCity using Mercurial as the VCS. Right now the trigger looks like: +:/** This trigger get fired when changesets are committed. However, I have TeamCity setup to tag each build in the VCS. The tagging process is firing the above build trigger so the build gets caught in a lo...
Adding the trigger pattern: -:/.hgtags filters out the .hgtags file from the build trigger. This is the file that gets modified when the source is tagged by TeamCity. When this file is excluded tagging operations will not fire the build trigger.
TeamCity
1,478,297
13
I have a rather strange problem with TeamCity. I have a TeamCity installation, with local and remote build agents. The TeamCity server is hidden behind IIS with Application Request Routing (ARR), to enable SSL, etc. I have a feeling this might be part of the problem, but I am not sure. Another reason to suspect IIS bei...
EDIT: Found this documented on the TeamCity pages as well: https://confluence.jetbrains.com/display/TCD9/Known+Issues#KnownIssues-FailuretopublishartifactstoserverbehindIISreverseproxy Failed Request Tracing (as Terri Rougeou Donahue mentioned) was the tool to help me. I had two errors. Firstly, the StaticFileHandler...
TeamCity
31,811,110
12
Using TeamCity in combiniation with git. Currently, TeamCity is set up with "master" as the default branch. Typically, development takes place on another branch (e.g. "dev") - TeamCity is set to watch for changes on "dev" and build automatically. If DEADBEEF-SOME-SHA has been built & tagged by TeamCity as build 1.2.3....
You can query builds for a particular SHA1... but you have to know your previous buildID for that. So what I would do is: write in a dedicated folder (accessible by all agents) the sha1 built at the end of each job only triggers a new job if that sha1 file is not already present.
TeamCity
46,826,665
12
I am trying to build an ASP.NET Core 2.0 application for .NET Framework 4.6.2 (not .NET Core) with TeamCity on Windows Server 2012R2. The following components are installed in the server: Microsoft .Net Core SDK - 2.0.0.0 Microsoft .Net Framework (4.5.2, 4.6, 4.6.2) Microsoft Build Tools (2013, 2015, 2017) Windows SDK...
Using Nuget Version 4.3 fixed it :).
TeamCity
45,723,797
12
I want to inhibit the building of certain projects within a solution from building (within a TeamCity Build Configuration in order to optimize the speed of my Commit Build feedback if you must know). I'm aware of the Solution Configurations mechanism but don't want to have to force lots of .sln files to end up with eve...
You could always pass the particular projects you want to build as parameters to the MSBuild. The MSBuild command line would look like this: MSBuild /t:<Project Name>:Rebuild;<Another Project Name>:Rebuild In TeamCity, you would put <Project Name>:<Target Action> in the target field in the MSBuild runner.
TeamCity
5,977,444
12
I'm setting up TeamCity (migrating from CruiseControl.NET) and I'm struggling to get it to perform incremental builds through MSBuild. I've got a small .proj file which contains a basic build script to invoke a build of my solution with some parameters fed in from TeamCity. When I invoke the script manually, MSBuild's ...
A workaround for this problem is to customize the MSBuild process to set the path at which the "Target Framework Moniker Assembly Attributes" file (the proper name for the file mentioned in the question) will be created. The TargetFrameworkMonikerAssemblyAttributesPath property is defined in Microsoft.Common.targets de...
TeamCity
11,888,275
12
I am using Approval Tests. On my dev machine I am happy with DiffReporter that starts TortoiseDiff when my test results differ from approved: [UseReporter(typeof (DiffReporter))] public class MyApprovalTests { ... } However when the same tests are running on Teamcity and results are different tests fail wi...
There are a couple of solutions to the question of Reporters and CI. I will list them all, then point to a better solution, which is not quite enabled yet. Use the AppConfigReporter. This allows you to set the reporter in your AppConfig, and you can use the QuietReporter for CI. There is a video here, along with many ...
TeamCity
9,939,209
12
I'm trying to configure TeamCity to build the project located on the Visual Studio Team Services with Git as VCS. The project contains spaces in the URL, so it looks like: https://mysrv.visualstudio.com/DefaultCollection/_git/some%20project Clone from Visual Studio 2013 works fine, from command line too. When I'm confi...
Do you still get this behaviour, if you try to use unescaped url (without %20 replacing space)? Another option is to escape '%' sign itself with another '%' - so escaped url of your repository will look like this https://mysrv.visualstudio.com/DefaultCollection/_git/some%%20project
TeamCity
23,091,358
12
We are well into our deployment of continuous integration environment using TeamCity. As we work through the CI process and move toward continuous deployment, we have run into a problem with how we manage production passwords. For other changes in the config, we use the Web.Config transform. However, I don't really ...
One possible solution, available since TeamCity 7.0, is to use typed parameters. You can define a parameter in TeamCity of type password, and pass it somehow to your build script (either as environment variable or as your build script property). TeamCity stores values of such parameters in its own configuration files a...
TeamCity
9,470,703
12
I have a TeamCity build configuration A and B, where B is dependent on A. I need to pass a parameter from B to A when B is triggered. This is related to question: Override dependencies properties by parameters value in TeamCity 9 and the teamcity documentation here I need to find WHERE/HOW to use this reverse.dep to se...
Found it! We just need to add a new Configuration Parameter in B with name as reverse.dep.<btId>.paramName and its value as the intended value that needs to be passed. Imp: As noted in the TeamCity documentation - As the parameter's values should be known at that stage, they can only be defined either as build confi...
TeamCity
37,857,187
12
Since GitLab 7.6, or thereabouts, there is a new option to use TeamCity directly from GitLab projects. In the setup there is this message: The build configuration in Teamcity must use the build format number %build.vcs.number% you will also want to configure monitoring of all branches so merge requests build, tha...
I'm running GitLab 8.0.2 and TeamCity 9.1.1 and am able to run CI builds on branches and merge requests. I trigger CI builds for specific branches by setting a VCS trigger together with the branch specification +:refs/heads/(xyz*) where xyz is the string for our ticket system prefix since all active branches need to be...
TeamCity
29,282,548
12
I've had to revert to a previous commit in my master branch in git which has meant I've had to force push the changes up to Teamcity. It's seems as though Teamcity has got into a bind and it thinks that any newly triggered builds are actually building an older version of the project (it's correct, I reverted from Build...
You could always delete the builds for the reverted commits that no longer exist. To do this go to the build details page then click "Actions" > "Remove".
TeamCity
25,887,582
12
I came across an interesting issue. I want to build nuget packages with Teamcity. I did set up the configuration which is really straight forward (Good job JetBrains!) However I am not able to run it on one of our build agents. The agent does pass the agent requirements for the configuration, but next to it's name the...
Most likely the agent is configured to run only explicitly assigned configurations. Plesase, check the Agents -> -> "Compatible configurations" tab. There is a combo box with options "Run all compatible" / "Run assined .. ". Make sure "Run all compatible" is selected
TeamCity
25,030,483
12
Is there a way to push up a commit containing a param in the commit message such as "--nobuild" which would disable building the project in TeamCity?
Yes, you should change your build trigger. There are trigger rules, and you can add new rule -:comment=--nobuild:** More info: http://confluence.jetbrains.com/display/TCD8/Configuring+VCS+Triggers
TeamCity
23,360,619
12
As the first step in a build configuration I am trying to dynamically change a parameter and use it in the subsequent steps. Reading online, it seems that the way to do this is to call ##teamcity[setParameter. But this doesn't seem to be working. It doesn't even change the value in the same step. For example, I have c...
EDIT: I think the problem might be the command you're using to set the parameter. Try: Write-Host "##teamcity[setParameter name='TestParameter' value='2']" -- We've experienced the same behavior. The key here is 'subsequent steps.' You must modify the parameter in a separate build step that is run before the step in w...
TeamCity
22,141,259
12
I'm running into an issue with unit tests on our Team City (8.0.4) build server - the code builds & runs all tests locally via Resharper and nCrunch. But when running on the server I get the following error, even though the Unity assembly exists in the same directory as the unit test assembly, and is referenced in the ...
Check the pattern you're using to locate your test assemblies. I had a similar problem with another library and it turns out the pattern was finding the test assembly under bin\Release and obj\Release; the obj folder doesn't contain all the assemblies referenced by the project and is really just a scratch folder for t...
TeamCity
21,164,646
12
When trying to deploy my site using TeamCity and Web Deploy I get this error: error MSB4057: The target "MsDeployPublish" does not exist in the project. Is there something I have to install on a build server? It's a clean Windows Server 2012 with Web Deploy 3.5 installed.
Or you can use this NuGet package with portable version of the targets: https://www.nuget.org/packages/MSBuild.Microsoft.VisualStudio.Web.targets and modify your csproj file to include it like this: <Import Project="..\packages\MSBuild.Microsoft.VisualStudio.Web.targets.12.0.1\tools\VSToolsPath\WebApplications\Microsof...
TeamCity
19,295,854
12
I created build step with type "MSBuild", set Target to "Clean;Build;Publish", added command line parameters to /p:Configuration=Release;PublishDir=M:\MyPackage after running configuration I got "success" status but M:\MyPackage folder is empty. I need just revive deployment package files in directory on same computer ...
I've solved this problem by creating "Visual Studio" build step and add next build parameters /p:Configuration=QA /p:DeployOnBuild=true /p:PublishDir=M:\MyPackage It still do not copy deployment package to MyPackage folder, but it is available in "obj" directory of project sources and this is enough for me.
TeamCity
18,993,874
12
I've just installed Teamcity 8.0.3 on a fresh Windows Server 2012 machine. Installation was successful, and I'm trying to configure an agent in order to fetch a project stored in a git server. This server uses a ssh key. I've added it to my agent, but when it tries to retrieve the project this error appears. Failed for...
I had this problem and found out my private key file was in the wrong format. I'm not sure if you used PuTTYgen to generate the key but if so try "Export OpenSSH key" from the Conversions menu and use that file instead.
TeamCity
18,813,237
12
I have a command line 'custom script' build step involving robocopy. Unfortunately when robocopy is successful, it returns exit code 1 instead of the more common exit code 0. When it does this, it fails my teamcity build configuration. How can I tell teamcity to fail the build if the exit code != 1 for this build step ...
There's two ways: In that Build Configuration, go to the Build Failure Conditions step. Look for the heading Fail build if: . The first checkbox is "build process exit code is not zero". Make sure that sucker isn't checked. When you run robocopy, check the result of the call to robocopy. You can explicitly exit 0 from...
TeamCity
14,477,592
12
I'm trying to integrate the sonar analysis into by TeamCity build process. I have a NUnit build step which runs my unit tests and then runs dotCover for the coverage. My next step is the sonar-runner. The configuration that currently exists is; gallio.mode=dotCover, sonar.gallio.mode=reuseReport but I also need sonar.g...
Spent some amount of time on the same issue, but with newer Sonar c# plugin (v.2.3) - Gallio support has been dropped, but the report is still required. To answer the question directly, TeamCity puts dotcover snapshot file into a temp folder with a name like coverage_dotcover27574681205420364801.data (where digits are ...
TeamCity
13,170,780
12
I have two svn VCS roots (ProjectX, ProjectY). Correct build path should be: ParrentFolder\ProjectX (svn://svn_server1/ProjectX) ParrentFolder\ProjectY (svn://svn_server2/Folder1/ProjectY) How to configure shared ParrentFolder for both projects? I looked into Checkout directory parameter but its seams there is no s...
So if anyone have similar issue you need todo next: Configure checkout rule for the first project +:.=>ProjectX Configure checkout rule for the second project +:.=>ProjectY Configure correct build paths /ProjectX/ProjectX.sln, /ProjectY/ProjectY.sln
TeamCity
13,117,953
12
We use the build in coverage application in TeamCity 6 (about to upgrade to 7.1) If we wish to see the code coverage (or other metrics) of a particular build it is fine as we can navigate to that build, but it would be great if we could pluck out a few interesting metrics from all/some of the current projects/build con...
If you want to compare a set of common metrics (e.g. code coverage) across different projects and over time then SonarQube is probably what you want. You can integrate it with TeamCity by adding a sonar-project.properties file to each project and calling sonar-runner from a command line build step.
TeamCity
12,844,190
12
We use TeamCity and GitHub Enterprise. We use an open-source-esque workflow with git: there's a mainline repository for each component, and when people want to make changes, they fork mainline to their own account (so there might be many forks) create a branch in their fork implement change bring up to date with main...
You can monitor pull-requests by teamcity: http://blog.jetbrains.com/teamcity/2013/02/automatically-building-pull-requests-from-github-with-teamcity/
TeamCity
12,494,759
12
I have looked into both. Would like your suggestions as to which one is better for automated web deployment on multiple servers.
I think you should definitely give TeamCity and Octopus a try. We use TeamCity to create Octopus (NuGet) packages and the Octo tool to automatically trigger deployment to a test environment after each succesfull build. After that we use the Octopus portal to promote deployments to other environments. We use the followi...
TeamCity
11,411,436
12
Is it possible to deploy a VS 2010 database project using TeamCity? I am building my whole solution, and deploying a website to my server, this all works fine. The final step I want to trigger is the deploy of the database project which generates a sql script and deploys it. I have the "Create a deployment script (.sql...
Visual Studio must be installed for this to work. For the original SQL Server 2005/2008 Database Project types: Create a build step of runner type Visual Studio to build the solution. Create a build step of runner type Command Line. Set Command Executable to C:\Program Files\Microsoft Visual Studio 10.0\VSTSDB\Deploy\...
TeamCity
11,291,250
12
I have a TeamCity agent configured to build my XCode projects and I use github. I would like to automatically include in my release notes the descriptions from all pending commits in TeamCity. How can I fetch them from github and store them in teamcity? Once I put them in a teamcity variable I can easily add them to my...
THis is how I ended up doing this using a bash script: #!/bin/bash curl -o lastBuild.tmp "http://localhost:8111/app/rest/buildTypes/id:bt2/builds/status:SUCCESS" --user rest:rest last_commit=`xpath lastBuild.tmp '/build/revisions/revision/@version'| awk -F"\"" '{print $2}'` echo "##Last commit = $last_commit" # pre...
TeamCity
10,794,300
12
Is it possible to format powershell output so that it renders as a collapsible section in the TeamCity build log, Tree view? So for example, my build step uses a powershell runner, and issues a write-host " ################# deployment manifest ############################" ls -r -i *.* | %{ $_.FullName } which outpu...
Yes we do this with our powershell scripts, you need to get your build script to update Teamcity with the build status. More specifically you need to report the build progress which will tell Teamcity when the start and the end of a block of work occurs. After the build has finished Teamcity will use this information t...
TeamCity
10,357,525
12
In our project, deployment is always a pain, mostly because of the mistakes done by the release management team. Either they screw up the configuration or get the wrong version installed somehow. We use teamcity as our CI server, and it produces the artifacts as zip files(dll's and exe) which is usually passed on to th...
I have used TeamCity for some fairly large projects and I have automated every aspect of deployments apart from the database. The main steps I use for each project are: Get a TeamCity agent installed on the production server Have the build get everything out of source control (you do have everything in source control ...
TeamCity
8,902,468
12
I am on Windows and trying to run multiple (currently two) instances of TeamCity on the same server. I chose not to install the Windows services and instead run the server via runAll.bat start command. When I ran the installer I chose different ports, names and paths for each one. The first server starts successfully, ...
You need to edit conf\server.xml for the second Tomcat/TeamCity instance so that it uses different ports or binds to different network interfaces, changing the following ports should be enough: Server port="8005" Connector port="8080" Two servers cannot share the same database, so you must configure them to use diffe...
TeamCity
6,267,737
12