Jenkins Automation help required - jenkins

I have been assigned a task to do build automation using jenkins which should perform checkout, compile & build automatically.
Existing set up - Currently we have PVCS installed in one of our AIX server where build process(checkout,compile,build) is automated using ant script.
I have installed jenkins in my windows server.
How do i get the code into my windows server from PVCS which resides in AIX server to perform build through jenkins.
Thanks in advance.

As I posted on CodeRanch where you posted the same question, you need to install the PVCS plugin for Jenkins.

Related

How to Integrate SonarQube with QuickBuild?

We are currently using GitLab and QuickBuild for our Android Projects.
I have to integrate Sonarqube to have a pre check before every build.
I'm not able to get much information for quickbuild as most of the documentation is for Jenkins.
I can see that we can create steps in quickbuild and I would have to add one more step for sonar check and execute the sonar command.
But still I'm not very sure what is the best practice?
Where should I run the Sonar Server?
Where to add the sonar configuration files?
Any good documentation available?
Should I run the Sonar check on GitLab or QuickBuild? (Our build server is QuickBuild so it looks the better option)
Ideally you should run sonar server on separate machine or you can use the same server on which quickbuild is running (depending upon java versions)
You can place sonar configuration file either in project directory or you can store it at any central location.
No official documentation for sonar and quickbuild integration.
Run sonar check on Buildserver.
We chose to do the SonarQube check inside the Maven build (that runs on Quickbuild). A Maven plugin is available. If you use Gradle, this might do as well.

TFS 2017 + Sonarqube

We have a on prem installation of TFS (TFS 2017) and I am attempting to integrate SonarQube analysis into our build steps. I have installed the SonarQube extension on the TFS server and added a service endpoint to point to a server where I have SonarQube Server installed and configured.
When I attempting to trigger a build, I am getting an error "No agents could be found with the following capabilities: msbuild, java, visualstudio". Does my build server need JRE to be installed to get the SonarQube build steps to work? SonarQube website says this:
**Installation
Make sure the .NET Framework v4.5.2+ is installed
Make sure the Java Runtime Environment 8 is installed
Install the extension from the marketplace**
Both the error message and the documentation told you the same thing: You need Java installed.
I will be the third source of confirmation: You need Java installed.
First, the official document is very clear here: Make sure the Java Runtime Environment 8 is installed
Besides, according to your prompting error message:
No agents could be found with the following capabilities: msbuild,
java, visualstudio
You are also lacking msbuild, visualstudio. Not only need Java installed, but also need Visual Studio installed on your build agent, then restart the build agent. Restarting the build agent will capture the added Capabilities. If this not work, reconfigure the build agent should do the trick.
The build agent will not detect the environment changes after you installed it. It will only detect during the installation. If you are using vNext build agent, also try to manually add some capabilities in Settings- Agent Queues- Agent Pool - Agent- Capabilities. After this trigger the build again.
Note: if you are running on TFS earlier than 2017 Update 2, you will need to download and manually install the latest 3.x version of the VSIX to install SonarQube Extension.

run sonarQube via jenkins Task 'my-task' does not exist. Please use 'list' task to see all available tasks

I've got a server in work which has sonarQube, Gitlab and jenkins running side by side with Maven also on the box. I have also a project on this box i wish to test with sonarqube (located on this same box in /home/{user}/live/{sitename}/htdocs). I created a job in sonarqube, the only options i had where to call it something and I've no idea how this links to the actual project or where it is expecting to find the project to scan. in jenkins I added build step for sonarqube, again no option on where to find the code. i ran it anyway and to no surprise it failed asking me to use list to see all available, not being funny but where do i do this?
So I have 2 questions really:
where is sonarQube looking for this code, i presume symbolic links are good in this location to the actual code right?
where do i find and use this list command? is this in jenkins or sonarqube?
sonarqube jankins and gitlab are all accessible on our intranet with different default ports (8080, 8008 and 9000) i have the sonarqube scanner plugin on jenkins and it is using maven? Does anyone know of any good tutorials to setup this kind of scenario?
thanks
Craig
Configure your current Job and set below.
Under Build->Execute SonarQube Scanner
Task to run : leave it blank
Path to project properties: Specify your sonar project properties file
path
Before doing above changes make sure that below configurations are set
Jenkins->Manage Jenkins->Sonar Servers
Name:Sonarqube
Server URL: http://localhost:9000/sonarqube
Server authentication token: Generate in SonarQube in specify here
Jenkins->Manage Jenkins->Global Tool Configuration->SonarQube Scanner
SonarQube Scanner installations:
Name: SonarScanner
Install automatically: Tick checkbox
Install from Maven Center: Choose compatible SonarScanner version
I was able to get this working in the end but after upgrading sonarqube we decided to use the new pipelines feature, this took a while to configure but we are now able to do code analysis on our builds, see this link for details

How to use a script shell or a jenkins plugin to create or to delete a sonarqube project?

I have many project of Sonarqube, each project correspond to a a version of my software.
At the same moment, I save the last 5 version of my software. I use jenkins for integration continue.
My aims it to delete or to create a sonarqube project by a script or a jenkins plugins
Thank you
Projects are created on their first analysis. If you need to create them before that, you can Provision them via the UI or via web services, which will also let you delete projects: https://sonarqube.com/web_api/api/projects
So your script simply needs to invoke the web services with the proper permissions.

Run deployment script from TFS build workflow on remote system using MSTest agent only

My Question: How can I run a deployment script from the TFS 2010 build template on a remote system that has only a MSTest agent running?
I know this can be done by activating the Deployment section in the test settings configuration file, but this is not flexible enough. At night a build runs. When the build is successful, a deployment script is placed at a drop location. The drop location is date, project and build definition specific. These parameters are available in the TFS build template we use.
I do not have Lab Management available, just a physical server. I would rather not spoil the physical server with an additional build agent to only do the deployment. The MSTest agent is apparently capable of running deployment scripts, but how do I use that functionality from the TFS build workflow. For example, can I use the RunDeploymentScript activity without having Lab Management?
PSExec is a great tool for running scripts on remote computers. I use this in Team Deploy that allows you to install MSIs on remote computers from Team Build. You can also run PowerShell on remote computers but it is a little more complicated to set up. Another option is to use MSDeploy. There is a command option that you can run any command on a remote computer. I usually use an InvokeProcess activity to call a PowerShell script on the build server. From the PowerShell script I have called MSDeploy to run a remote PowerShell script on a target server. It sounds bad but worked good.
You can't run the RunDeploymentScript on the target machine. You can use a modified template to deploy to a physical environemnt. Here is a good post on doing this.. The options I mentioned above do not need any agent on it. You can use the ExecuteRemoteTestRun lab management activity without Lab Management to run the MTM Tests with the Test Agent with a Test Controller that is registered to the project collection (Test Manager).
Let me know if you have any questions on any of these options.

Resources