Saturday, 16 April 2016

Jenkins GitHub Hooks Problems


GitHub Hooks Problems

1)
This page shows hooks problems and ignored projects. You can view detailed stacktrace of any problem in system log. For better debug in jenkins interface, enable this logs:

com.cloudbees.jenkins.GitHubWebHook - ALL
org.jenkinsci.plugins.github.webhook.WebhookManager - ALL
org.jenkinsci.plugins.github.admin.GitHubHookRegisterProblemMonitor - ALL
This table shows problems with registering/removing hooks for corresponding repo. Message will be dismissed if Jenkins will receive PING hook for repo, or if you add this repo to ignore list. This messages will not be saved to the disk, so all of them will be
cleared after jenkins restart

1.a)
github.com:username/repo There is no credentials with admin acces
s to manage hooks on GitHubRepositoryName[host=github.com,username=username,repository=repo]

solution :
1) go to jenkins homepage.
2) click on manage jenkins
3) click on configure system
4) go to
GitHub -> GitHub Servers
uncheck "manage hooks"
5) restart the jenkins


Ref : stackoverflow 

Friday, 15 April 2016

Failed to connect to repository : Could not init /tmp/hudson

Failed to connect to repository : Could not init /tmp/hudson

1) There's no such executable git in PATH: /sbin, /usr/sbin, /bin, /usr/bin.
In the jenkins job section.
Advanced...
Source Code Management.
got git.
2) Failed to connect to repository : Could not init /tmp/hudson

solution : please install git(as below ) or provide the git exe file path (/usr/bin/git).  

Install git on linux.

command : sudo yum install git-all

ref : https://git-scm.com/book/en/v2/Getting-Started-Installing-Git

now check the git version.
cmd : git --version

Know tomcat version on linux

Know tomcat version on linux

sudo rpm -qa | grep tomcat

output : tomcat-7.x.x.

Create job in jenkins

Create job in jenkins

1) Go to jenkins homepage
2) create job/New item.
3)Create a item name an choose type of project you want it can be.
a) Freestyle project
b) Maven project
c) External Job
d) Multi-configuration project
e) Copy existing Item
we are using option b.
3) In the configuration page fill following
a) Maven project name
since we are using github repository as CVS. Install the plugin if not avaialble.
to install github plugin
a.1) go to jenkins->manage plugin->manage plugin->search from "github plugin" from available plugin. check and install.
b)  click on "GitHub project" provide project URL. and description.
c) Source Code Management.
c.1) choose project URL of the github
c.2) and enter the username and pwassoer of the repositroy (define it global/system)
d)Build Triggers choose
d.1)Build whenever a SNAPSHOT dependency is built
d.2) Build when a change is pushed to GitHub
e) Build
e.1) root pom.xml
e.2) Goals and options (clean and install)
f) Intall tomcat plugin for Capitomcat plugin deploy the WAR file to multiple remote Tomcat servers.
g) install “Deploy to container Plugin" to deplloy the war file in tomcat container.
This plugin takes a war/ear file and deploys that to a running remote application server at the end of a build
h) In the post build action choose "Deploy to container Plugin"

1) 

javax.mail.MessagingException: Could not connect to SMTP host: smtpout.secureserver.net, port: 465;
  nested exception is:
javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake


2)  Check username and password are correct or not

javax.mail.AuthenticationFailedException: 535-5.7.8 Username and Password not accepted. Learn more at 535 5.7.8  https://support.google.com/mail/answer/14257 q4sm64058194pfi.94 - gsmtp


3) an error occurred while sending mail (534-5.7.14 redmin gmail

step 1) go to select Access for less secure apps as "turn of"

step 2)  go to and  Allow access to your Google account : click on continue
REF : Stackoverflow

JDK installations in jenkins


error : /usr/java/jdk1.8.0_45 is not a directory on the Jenkins master (but perhaps it exists on some slaves)


Set the path JAVA_HOME : /usr/java/jdk1.8.0_45




Install maven on redhat linux

Install maven on redhat  linux

wget : to retrieve content from server

REF : maven mirror

1) wget http://mirror.olnevhost.net/pub/apache/maven/binaries/apache-maven-3.2.1-bin.tar.gz

1.1)
create the apache-maven if not exist.
command :
sudo mkdir -m a=rwx /usr/local/apache-maven

1.2) Go to apache-maven directory and execute the command.
maven

1.3) extract the file
command : tar xvf apache-maven-3.2.1-bin.tar.gz

1.4) export the path
1.4.1) export M2_HOME=/usr/local/apache-maven/apache-maven-3.2.1
1.4.2)export M2=$M2_HOME/bin
1.4.3) export PATH=$M2:$PATH

1.5) verify maven version
mvn -version

output :

Maven home: /usr/local/apache-maven/apache-maven-3.2.1
Java version: 1.8.0_45, vendor
Java home: /usr/java/jdk1.8.0_45/jre
Default locale:
OS name: "linux",

REF : 1) stackoverflow
           2) linux