CentOS 6.4 Minimal + how to configure jenkins jobs via xml? - maven

I need to create a Build Server in CentOS 6.4 Minimal I sucessfully installed:
Java compiler (OpenJDK 1.7.0)
Git or Mercurial
Maven
Jenkins
Now I need to to the following:
At given intervals (eg daily at midnight) is the latest revision in the version control system (tip, HEAD, ...) compiled with Maven. In addition, Java Docs and packages (jar, war) need to be created.
Then Jenkins with all tests conducted and reported.
Make sure there is a report of previous builds
Ensure that the Java Docs and packages can be downloaded (jars, wars, ...) of the latest build
I can't use a GUI on CentOS Minimal so I need to configure the job in xml files? Could please someone show me the way... I'm not a linux server guru.

It's a bit impractical to configure Jenkins via XML by hand, because Jenkins' configuration is spread over multiple files, and the format of the configuration files changes between releases.
Given that Jenkins is a web application, you should be able to visit port 8080 (Jenkins' default port, assuming you didn't change it) on the server where you installed Jenkins (e.g. http://mycentosserver.example.com:8080), and configure it via the web interface.
If you're unable to access the web interface because of a firewall or similar, but you are able to SSH to the server (presumably you can, given that you were able to install stuff on it), you could set up an SSH tunnel to forward a port on your local machine to port 8080 on the server. For example, from your local machine, run the following command. You will then be able to access Jenkins on your local machine at http://localhost:28080 . If you're on Windows, you can use Putty to do the same thing.
ssh -L 28080:127.0.0.1:8080 mycentosserver.example.com
If you can't access the web app directly, and you can't SSH tunnel, I'd recommend setting up Jenkins on a server where you can access the web app, configuring it, and copying the XML config files from /var/lib/jenkins on that server across to your Centos server.

Related

Jenkins through docker: How to configure own host as agent for jenkins?

I'm using Jenkins with pipelines on a mac-mini. All builds are working fine with docker agents (backend, frontend, android app, etc)
The only thing I haven't been able to achieve is to use my own mac-mini as build-agent/slave for the IOS app (I need to build on OSX). Jenkins itself runs through docker as well, so I would need to connect to the host (the OS of the mac-mini) and use that as an agent...
I know one option would be to install jenkins instead of using docker, but I would prefer to keep Jenkins running in a docker container.
Does someone has experience with this or knows any good documentation on how to set this up?
Go to Manage Jenkins > Manage Nodes > New Node.
Configure a node.
Go to the list of nodes.
Select your newly configured node. It should be offline at this moment.
Run the java command displayed on the interface on your host machine.
Your Host machine is now a slave.

Tomcat Remote Deployment

I want to deploy a WAR from my local windows box to a remote tomcat machine
I am using the following command from Postman
http://10.248.9.104:8080/manager/text/deploy?path=/greeting1&war=file:///C:/Users/jagaran.das/Documents/work/AIP/Automation/workspace/gs-rest-service-master/initial/target/gs-rest-service-0.1.0.war
Also I have tried lot of options.
My main requirement is to control deployment to 100 tomcat server from a central location. I was thinking of using tomcat manager remote deployment way but I am not able to do. Please help
Tomcat Version is Tomcat 7.0.78

Jenkins build project "Unable to access to repository"

I am a complete Jenkins noob so if I have missed something completely obvious I apologise in advance!
I am building an intranet web application using Visual Studio 2010 and commit changes using AnkhSVN to a repository stored on a server that is running Visual SVN Server.
Due to budget restrictions this server is also acting as our web server and also running Jenkins. It is connected to our internal network but doesn't have external internet access so I have had to manually install Jenkins plugins and dependencies.
I am trying to build a Jenkins project that would build the web application when it detects a commit but when I enter the repository URL and the user credentials in the source code management window I get the following error message:
Unable to access to repository
However when I enter the url in a browser and enter the same credentials I can access the repository without any errors.
Any ideas would be greatly appreciated.
Server Specs
Windows Server 2012 R2 Datacenter 64bit
Visual SVN Server
Port: 443
Version 3.5.6
Jenkins
Port: 8080
Credentials Plugin 2.1.9
MapDB API Plugin 1.0.9.0
Pipeline: SCM Step 2.3
Pipeline: Step API 2.5
SCM API Plugin 1.3
SSH Credentials Plugin 1.12
Structs Plugin 1.5
Subversion Plug-in 2.7.1
check if the ip of jenkins server can access the svn ip server....i have the same problem and i found that my ci server can not access the svn server .using ping command
That actually might be okay. For some reason I see similar error message (could be a bug in Jenkins frontend) when edit SCM details for a job in Jenkins, but it does work flawlessly if I actually save and run the job.
Give it a try it might actually work during the build time.

Deploying war to production from mac | WinSCP equivalent

I have a dynamic web project which I run locally on tomcat. We have a linux based production server which is accessed via host, port username and password.
Earlier, I had a windows machine and I used WinSCP for transferring the war to the webapp folder of tomcat in linux machine. But now, we have got a mac machine to work and I am unable to find a similar way(or any other easier) to deploy my application war onto the production.
What is the best way to deploy the war in the above mentioned scenario? I am unable to find any WinSCP equivalent for mac and also don't know the use of any other SFTP client to be used in mac.
Please suggest.
I am unable to find any WinSCP equivalent for mac and also don't know the use of any other SFTP client to be used in mac.
"Equivalent"?
If you're using WinSCP on Windows, why not use scp, the command-line tool that ships with OS X?

Unable to deploy from Jenkins to Jboss

We are unable to deploy our application from our BuildServer to our appliation server.
This is the maven command we use in Jenkins:
clean install jboss-as:deploy -Pjboss7 -Dmaven.test.skip=true
We have tried the following:
Confirmed we can telnet from our BuildServer to our appliation server
Upgrade Jboss maven plugin
Started Jboss (on our application server) with
$JBOSS_HOME/bin/standalone.sh -b 0.0.0.0
Jenkins seems to hang at the following point:
INFO: JBoss Remoting version 3.2.12.GA
Authenticating against security realm: ManagementRealm
Is the JBoss AS 7 working on the same machine as Jenkins?
Currently your binding your public interface to all network interfaces on the host machine (the -b command). You should also bind your management interface of the app server to a proper network interface (Jboss allows remote deployment only by the management interface). You can do it in the $JBOSS_HOME/standalone/configuration/standalone.xml (or domain.xml for domain mode) file. Find:
and set the inet-address to the ip of the machine which hosts the application server. You can also use the -bmanagement switch to bind the management interface, as such:
$JBOSS_HOME/bin/standalone.sh -bmanagement=192.168.100.10
You also stated, that you have a potential problem with authentication. Please post your maven plugin configuration. Note that the username and password you provide for the maven plugin should match the administrator user on JBoss (you can add him by choosing Management User in the $JBOSS_HOME/bin/add-user.sh promp). This is the most likely source of your problem - but it is hard to tell without any further information (for example something from the pom.xml file).
Also if the app server is working on the same machine as Jenkins, JBoss allows the "local user authentication" which basicaly checks if the call has originated from the same machine.
Additional source for network interface binding: https://docs.jboss.org/author/display/AS71/Command+line+parameters#Commandlineparameters-bindaddress

Resources