Load Teamcity build log from step - continuous-integration

I need to load TeamCity build log from step(command line runner or another) to file.
And I need to do it from build step. Any ideas how to do it?

You could probably use Teamcity api to get log using wget or some other tool
http://teamcity.server/httpAuth/downloadBuildLog.html?buildId=NNNN
TeamCity Api

Related

How to install Jmeter on Gitlab runner machine?

I am new to using JMeter with GitLab CI/CD. I have created loadTest suite and want to configure it in Gitlab CI/CD pipeline. I have run.sh file in my loadTest project which do following:
Create and set up test data
Download JMeter dependencies and plugins (if JMeter already exists, skip this step)
Run the test
Clean up test data
Questions:
Is it a good idea to download JMeter in your project folder while you run the script or use JMeter docker image and run the tests ? I am concern about keeping JMeter folder in GitLab repo and occupying unnecessary space.
How to install Jmeter on Gitlab runner machine ?
Thank you in advance.
If your run.sh script downloads JMeter you don't need to put JMeter into Github repo. Using Docker is also possible, you can either check existing images or create your own with your own test data and plugins.
Gitlab runners are normal Linux machines (if you choose the relevant executor), my expectation is that your run.sh should work just fine there as it is (or with minimal amendments, like installing Java prior to installing JMeter)

How to run JMeter test from Jenkins

How to run jmeter test from Jenkins, here i want to run my jmeter test with jenkins and tried to configure the Jenkins with Performance plugin based on the information got after googling.
In Google the solution is provided where jenkins is hosted locally and in Build we configure command line execution by providing jmx file path and so on...
the problem comes when my jenkins is in other server like http://172.27.80.57:8080/... here if i give Command line execution by providing jmx file path my build will fail..because my path is in different location..
So How to over come this as i am new to Jmeter and my boss want this result to be shown in jenkins ....and if there is any plugins which i need to install or is there any place where i am missing, please let me know ....this is very important for me....
OR is there any possibility that where we can push our changes to Git lab using CI tools such as Sourcetree...etc and then run those in Jenkins.
Thanks in advance.
You will need to install Jenkins build agent to the machine which you plan to use as JMeter load generator, check out Distributed Builds Jenkins Wiki page.
Also JMeter test is possible using Jenkins Pipeline feature. For more information check Running a JMeter Test via Jenkins Pipeline
Hope this helps.

Is it possible to TeamCity Build Log file and mail it

I am working on TeamCity,
There are lot of failures in the my TestCase Automation,
I want to get the Build.log file,
I dont know the location of Build.log.
can some one please tell me where is this file location in Build Agent.
To get the build log you'll need its build id and place it into the following URL:
http://teamcity:8111/httpAuth/downloadBuildLog.html?buildId=BUILD_ID
It is also possible to get the build log as the zip file using
http://teamcity:8111/httpAuth/downloadBuildLog.html?buildId=BUILD_ID&archived=true
Just replace BUILD_ID with the desired build id.
For the detailed info, you may refer to the documentation

Where does Jenkins store the project source

I have a Jenkins job that uses a script to build my project. On the following line, the script fails mvn -e -X -Dgit='$git' release:prepare.
Because I want to search for the cause of this, I want to go to the Jenkins server and run mvn -e -X -Dgit='$git' release:prepare from the command line, to see if it works.
Does Jenkins store the projects' source code somewhere, such that I can go to that folder and call Maven?
If yes, then where?
Yes, It Stores the project files for the job by default at
/var/lib/jenkins/workspace/{your-job-name}
This is where jenkins suppose the project files to be present or it pulls it from a source before start working/building from it.
Quote from Andrew M.:
"Hudson/Jenkins doesn't quite work that way. It stores configurations and job information in /var/lib/jenkins by default (if you're using the .deb package). If you want to setup persistence for a specific application, that's something you'll want to handle yourself - Hudson is a continuous integration server, not a test framework.
Check out the Wiki article on Continuous Integration for an overview of what to expect."
From this Question on serverfault.
This worked for me:
/var/jenkins/workspace/JobNameExample
but, if your build machine (node) is a different than the one where Jenkins is running (manager), You need specify it:
/var/jenkins/workspace/JobNameExample/label/NodeName
Where you can define label too:
jenkins stores its workspace files currently in /var/jenkins_home/workspace/project_name
I am running from docker though!

How to execute remote bat file using build step in TeamCity?

I have TeamCity installed on centos. I have only one Linux BuildAgent for now. My build configuration execute a maven script and using ant upload WAR artifact to Windows Server on FTP. After this step i have to execute BAT file on remote Windows Server. I read that i can do this using psexec/RemCom, but i can't understand how i can do this in TeamCity? Build Step or different Build Configuration should contain steps to execute psexec/RemCom or i can insert Build Step into existed Build Configuration?
Single build configuration could potentially consists of multiple build steps. Think of them as a actions you would like to do. So I suppose that right now you have a maven step in your build configuration. I would suggest you to add Command Line step, where you can do what ever you want -- it's like bash/batch script. You can put script contents directly to the build step, or you can write script and execute it.
But as you mentioned that you have CentOS, it could be you have to do extra configuration on the build agent for PsExec to be available.

Resources