Wednesday 29 November 2017

SonarQube et Jenkins

SonarQube was fun while it lasted, while I used the embedded version. When it was time to get my production SonarQube on a separate server, it became a huge problem.

Firstly, Sonar had too many issues working on my AWS hosted Windows 2016 server. My DB, a SQL server, got it connected to SonarQube but Sonar expected it to be upgraded. It finally got upgraded and Sonar had issues with it because the Latin_General_CP1_CS_AS got changed after the update and it was no where to be found.

Resolving the DB:
I got another SQL server on AWS RDS and connected to that, I stopped the upgrade of that DB for the duration of setup.

SonarQube Version:
Sonar 6.3 Works!!! 6.5 - 6.7 had issues with SQL server.

Jenkins:
After all the drama with SonarQube, then came Jenkins. I thought it would be easier but it obviously wasn't. I got the necessary plugins installed, including Sonar Scanner. Now, the configuration is the issue.
With Jenkins, ensure you use JDK for ANT otherwise, Jenkins won't see it. Also, you need to reference Sonar Properties in the sonar scanner section of the Build configuration.
Important!! don't forget to get your Sonar Token from sonar Administration portal, you may choose version 5.2 in Jenkins configuration to enter username and password, but if you use anything higher, you require a token!

Tuesday 21 November 2017

Huddle for some weeks

I've been working on installing SonarQube to use for secure code analysis.
Boy! I never knew SonarQube could be this easy and yet complicated. I'm still working on it.

What I've done so far:

  1. Got windows server on AWS
  2. Setup an RDS for SQL server in AWS
  3. Installed, Java (JRE. JDK gave me serious trouble, so I stuck with just the JRE), Ant (needed for the plugin and I need in Sonar) and SonarQube.
  4. Downloaded sqljdbc_6.0


SonarQube issues:
Firstly, the database is very different for AWS when using RDS. Connecting to the database in the sonar.properties doesn't require localhost. You'll need the RDS connection string, which can be obtained from AWS or when you log into SQL server on the Amazon windows machine. (if you have questions regarding this, please comment and I'll respond as soon as I can).

Secondly, ensure your database was created properly! You can google SonarQube SQL server database and you'll find information of what's required in the "collation" properties. 

Ensure you include Java JRE location in the wrapper properties, it should be at the top of the page, do not edit the other parts of it, it's strictly prohibited if you expect Sonar to work.
***********************************

I tried all these with SonarQube 6.3. 6.5 and 6.6

I got kicked out a lot of times with issues regarding IP address, firewall and Java. Now, enable port 9000, 9001 (if needed) and 1433 through your firewall. Trust me, sometimes, this can resolve a bunch of issues, it worked for me.
SonarQube 6.6 worked after installation but it had issues with some upgrade to the database, which I found out is synonymous for "upgrade SonarQube".

Friday 10 November 2017

Hello there... I'm still here

Yes, yes, I know!
Its been so long here. The craziness in this industry isn't funny. Some days I'm spent researching and configuring, other days are more analytical. Well, I'm still here and I've got this!
I'm installing Oracle on Ubuntu 😧😧😧
It has given me few sleepless nights because it keeps looking for a zipped directory! Well, I'm working on it and I'll try to share any tips. For now, I've got to run. Please don't quit on me, I'll be right back with more juice :)