Verigreen / verigreen

Verigreen is a lightweight, server side solution for verification of git commits. It is a gated check-in process which will not allow any failed CI commit to go into an integration/release/any protected branch. We keep it green (hence the name).

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

verigreen deployment to tomcat in windows and linux ubuntu

pubaayaam opened this issue · comments

After following the steps, the error message of ${VG_HOME}/config.properties file not found is logged into tomcat server.
In windows, I did hard code the path but then I faced issue of Illigal Argument Exception.
My first guess is that a key from config.properties file takes a literal type than I have provided to it.
Please find attached the config.properties file.

@borzamircea - can you please investigate and help @prakashsinhab to make a successful deployment on Windows under Tomcat?
@prakashsinhab - alternatively, you could always deploy on Linux using our Docker image

@prakashsinhab - a few questions:

  1. Which Java version do you use? (VG currently supports 1.7)
  2. Which Tomcat version do you use?
  3. Not seeing the config.properties file - could you please upload it again?
  1. java version is 1.8.0_65 in windows and 1.7.0_65 in Ubuntu (VG supports 1.7).
  2. Tomcat version is 7 in both windows and linux.
  3. Please find attachement as text file.
    config.txt

Hi @prakashsinhab ,

Try doing this under Windows:

Go to your setenv.bat in tomcat and type this set "VG_HOME=place where your config properties is located".

Also, could you please attach a log, so I could see what's going on

As @eitanshp pointed out, the easiest way would be to deploy via Docker under Linux, if you would like to (if you need assistance with this, please let me know)

10x!

Also,

If you overwrote the root in tomcat, this collector address is fine: collector.address=http://172.27.59.62:8080/rest. But, if you did not deploy Verigreen as ROOT, please try changing to collector.address=http://172.27.59.62:8080/verigreen-collector/rest

10x!

@prakashsinhab once you get VG to point to the correct config.properties file, I see an issue with your current configuration. You have this set git.repositoryLocation=http://172.27.59.62:7990/scm/emsdb/ems_db.git where it really should be pointing to a local path in the machine that your VG collector is running. @borzamircea please confirm that this is the case.

@rqc, yes, you are right. It should point to a local copy of the repository, from there you do the pushes, VG monitoring that repo.

10x.

Please find attached error log and updated config.proerties file.
catalina.2016-01-15.log.txt
config.properties.txt

Updated the repository location to point ot local copy having a .git folder within it.

Thanks @prakashsinhab

Try using Java 7, point your JAVA_HOME to that: (had the issue with Java 8, which is not supported by Verigreen, had to revert to 7)

image

Also, the git repository location should look like this

git.repositoryLocation=C:\\Users\\borza\\workspace\\playground\\regular_repo\\mircea_test\\.git

(add a \.git at the end)

Let me know how it goes.

10x.

With Java 7, I could now access the dashboard.

Thanks for the support.

You're welcome!

Thanks
After updating the hook.properties file with collector addrees as http://172.27.59.40:8007/verigreen, attached error message is showing up from sprint jar's context xml file.
collector address from spring jar file xml context

@prakashsinhab - can you please share your pre-received hook file?
Please make sure the 'VG_HOOK' variable is defined.

Please find attached the hook.properties file.
hook.properties.txt

Also, this file is at 172.27.59.62 IP while both the local git repo and tomcat server are at 172.27.59.40 IP. Do I need to update collector address with /rest as browser does not show up any output for it?

@prakashsinhab - first thing first:

  1. in the hook.properties you need only one line for the collector address, all the rest of the fields are related to the config.properties which is located on the machine where you are running the collector. the hook properties should be located on your SCM machine (stash, git lab, etc.)
  2. You must put the /rest in the end although it is not returning anything in the browser. this is the entry point of the web application.
  3. Actually, I was wanted you to show your bash script for the pre-received hook (but it is good that you add it, so we save some troubles on the road ahead). it should look something like that:
#!/bin/bash
export JAVA_HOME=/usr/java/jdk1.7.0_51
export VG_HOOK=/tmp/soninob_hook
read LINE;
echo $LINE > /tmp/sonino.log
#java -Xdebug -Xrunjdwp:transport=dt_socket,address=8092,server=y,suspend=y -jar  /DATA/stash/hooks/verigreen/sonino2/git-hook.jar $1 $LINE
$JAVA_HOME/bin/java -jar /DATA/stash/hooks/verigreen/sonino/git-hook.jar $1 $LINE

Closing, @prakashsinhab - if you didn't manage to solve it yet, please reopen.

Thanks again team