Siddesh BG's Build Release Config mgmt Blog

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Thursday, 19 July 2012

Upgrading Sonatype nexus from 1.5 to 1.6

Posted on 03:08 by Unknown

Here are the steps followed while upgrading Sonatype nexus server from 1.5 to 1.6 version in Linux server (RHEL)



1) Stop the nexus service
   service nexus stop
2) Copy the nexus 1.6.0 package to previously installed directory
     cp  nexus-oss-webapp-1.6.0-bundle.tar.gz  /usr/local
3) Extract nexus 1.6.0 package in a temp directory
    cd /usr/local/temp
    tar xvf ../nexus-oss-webapp-1.6.0-bundle.tar.gz
4) Copy nexus-oss-webapp-1.6.0 directory to installation directory
     mv /usr/local/temp/nexus-oss-webapp-1.6.0 /usr/local
5) Change ownership to the Unix user account nexus was running
    chown -R nexus:nexus nexus-oss-webapp-1.6.0
6) Create a softlink to the new nexus installation source directory
     ln -s nexus-oss-webapp-1.6.0 nexus
7) There are some changes in 'nexus' script and location of wrapper.conf. Hence we need to replace the previously installed /etc/init.d/nexus script
    diff nexus/bin/jsw/linux-x86-64/nexus /etc/init.d/nexus
     mv /etc/init.d/nexus /etc/init.d/nexus.old
     cp nexus/bin/jsw/linux-x86-64/nexus /etc/init.d/nexus
8) If you have made changes in old /etc/init.d/nexus script, restore it to the new script
    The notable change is the WRAPPER_CONF location got changed in 1.6 version. Hence correct path needs to be defined in /etc/init.d/nexus script
  For example, in our setup, we made these changes in old script, which is transferred to new script
   vi nexus

      #USER DEFINED VARIABLES
      NEXUS_HOME=/usr/local/nexus
      PLATFORM="linux-x86-64"
      JAVA_HOME=/usr/local/jdk1.6.0_27
       PATH="${JAVA_HOME}/bin:$PATH"

      # Wrapper
      WRAPPER_CMD="${NEXUS_HOME}/bin/jsw/${PLATFORM}/wrapper"
      WRAPPER_CONF="${NEXUS_HOME}/bin/jsw/conf/wrapper.conf"

     # Location of the pid file.
      PIDDIR="/var/run"

      #RUN_AS_USER=
      RUN_AS_USER=nexus
9) If you have changed the nexus storage location from the default /usr/local/sonatype-work or default tcp port, then make sure you update this path in the file nexus/conf/plexus.properties
     nexus-work=/export/nexus/sonatype-work/nexus
     application-port=8081

10) Restart nexus
    service nexus start
Read More
Posted in | No comments

Monday, 16 July 2012

Jira workflows - Dealing with validator

Posted on 23:19 by Unknown
Recently I got a request to make certain fields mandatory while marking a issue as 'Fix' (A step in our workflow'). Initially I made the requested custom fields as 'Required' in Field configuration, but it screwed !!!. After this change it started asking to provide values for fields which are not visible in 'create' page.
Finally I learnt it needs to be configured in Workflows validator.
I'm sharing my learning's here.

Introduction
Workflow is the place where we define business process. A JIRA workflow is the set of steps (or statuses) and transitions that an issue goes through during its lifecycle.
The below picture represents the default Jira workflow.
JIRA workflows consist of steps and transitions:
  A step represents a workflow's current status for an issue.An issue can exist in one step only at any point in time. In the diagram above the rectangular boxes represent steps/statuses.
 A transition is a link between two steps. A transition allows an issue to move from one step to another step. A transition is a one-way link, so if an issue needs to move back and forth between two steps, two transitions need to be created. In the diagram above the arrows represent transitions.



Workflow Administration
Creating Workflow:  Login -> Administration -> Workflows -> Add new Workflow  (Give name & desc)
Editing a workflow: 
   Inactive workflow:  You can simply edit steps & transition
   Active workflow:  Not possible to edit active workflow directly. 
         Create draft -> Edit  & validate ->  Publish -> Backup old workflow
  • Login ->  Administration -> Workflows  -> Choose your workflow -> Edit
  • There are two types of edit mode, Diagram and Text

How to make a field mandatory during a workflow transition change ?
Request: In the “Fix” page, (when the bug is marked as fixed), Make the following fields as mandatory
1) Fixed in build 2) Fixed in Iteration 3) Code reviewed by 4) Fix description

Solution:
Using Diagram edit mode.

  • Login ->  Administration -> Workflows  -> Choose your workflow -> Edit 
  • Using workflow diagram I tracked my workflow steps involved in the transition. The source step is 'New' and destination is 'Assigned to QE' through the transition label 'Fix - Release to QE'. 
  • Click on round wheel as shown above and select 'View Validators'
  • Click Add a new validator -> Select 'Fields Required' -> Add -> Select the custom fields names (in my case its 'Fixed in build', 'Fixed in Iteration', etc -> Add.
  • Publish and Take backup
  • That's it
  • Alternatively to do the same from Text mode
  • Select workflows ->  Edit in Text mode -> Create Draft 
  • Find the Step name (in my case its 'New') and the transition ( In my case 'Assign to QE') -> Click on the transition -> Validators -> Add -> Fields Required
  • Publish & Backup
    




  
Read More
Posted in Jira | No comments

Friday, 6 July 2012

jenkins nested views not displaying with read permissions after upgrade

Posted on 01:20 by Unknown
Today I upgraded Jenkins from 1.444 version to 1.470 and to my surprise it was not showing any nested views for anonymous users. It was showing only the default 'All' view. But if we login to jenkins, then it shows all nested views.
When I googled I found this relevant link https://issues.jenkins-ci.org/browse/JENKINS-13429
As suggested I had already had Jenkins version > 1.459, Nested View Plugin 1.8. But I didn't had Role-based Authorization Strategy. Even I added this plugin to my jenkins.

Then I realized that this issue can fixed without adding Role based Authorization Strategy.
We are already using 'Project-based Matrix Authorization Strategy' and migrating to Role based authorization will be some additional tasks, which I didn't wanted to do.

Anyways the solution is enable 'Anonymous' account 'Read' 'View' in 'Project-based Matrix Authorization Strategy'

Here is the detailed way of doing it

Login to Jenkins -> Manage Jenkins -> Configure System -> Access Control -> Authorization -> Project-based Matrix Authorization Strategy
For Anonymous user -> View section -> Click 'Read'





Read More
Posted in jenkins-hudson | No comments

Wednesday, 4 July 2012

How to run dos commands from cygwin? File name too long - fix

Posted on 02:05 by Unknown
Typically we write shell scripts and run it under cygwin shell. The command used in scripts like rm, mv are obtained from cygwin installation. But recently we encountered a tedious issue with cygwin shell.
The 'rm' command run from cygwin fails with message "File name too long" for some of the files and it's causing build failure.

After a bit of research, I found there is a limit for file name length in cygwin (I guess 256 characters). Upgrading the cygwin may fix the issue, but I didn't want to do that.

Fix: I found that the native dos 'rmdir' command can delete these lengthy file names without any issue and hence I decided to call native dos commands from Shell scripts.

Here is a way to call native dos commands from cygwin shell
  cmd /C rmdir /S /Q <directory>


here
   cmd   -  Starts a new instance of the Windows command interpreter
       /C   - Carries out the command specified by string and then terminates

  rmdir - dos command to delete directory
     /S - recursive delete of files & sub-directories
     /Q  - Quiet


Just add this command to shell script. It may need some if condition to run this only on Windows platform.


Read More
Posted in | No comments
Newer Posts Older Posts Home
Subscribe to: Posts (Atom)

Popular Posts

  • Solution to Project Euler Problem 10 - Find the sum of all the primes below two million
    http://projecteuler.net/problem=10 Problem The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17. Find the sum of all the primes below two mi...
  • Fortify scan automation steps for analyzing c/c++ code (Makefiles)
    I wrote in my previous blog about installing and configuring Fortify client. This blog presents standard steps to automate fortify scan for ...
  • Posting a JIRA bug using Perl Mechanize
    Perl provides modules which can be used as command line browser to automate tasks dependent on web pages. Among them LWP and mechanize are i...
  • jenkins error: java.io.IOException: Authentication method password not supported by the server at this stage
    When I tried to add a node to jenkins/hudson using ssh as launch method, the authentication keeps on failing with the below error. [12/15/11...
  • Unable to resolve target system name - a DNS problem
    I was not able to ping to any machines from my Windows 2003 server. I did following steps to debug & resolve the issue, which was relate...
  • Installing and configuring Fortify on Linux and Windows machines
    Installing Fortify on Linux (RHEL 5 32 bit) Download Fortify archive Fortify-360-2.6.5-Analyzers_and_Apps-Linux-x86.tar.gz and extract it to...
  • Perforce - can't edit exclusive file already opened
    In perforce, whenever a binary file like doc, xls or ppt files are checked out, it is opened in exclusive lock mode. So no other person can ...
  • Perforce and cygwin
    Are you a command-line freak ? Do you want your automated shell scripts to run on Windows ? Do you wish to work with Perforce commands on Cy...
  • Using BUILD_LOG_REGEX in jenkins email notification
    Jenkins provide 'Email-ext' plugin, which  allows to configure every aspect of email notifications. One of my requirement is to send...
  • 0509-036 Cannot load program p4 because of the following errors
    Here is the full description of error ............ bash-3.00# p4 info exec(): 0509-036 Cannot load program p4 because of the following error...

Categories

  • AIX
  • AIX ssh
  • ANT
  • apache
  • appliance
  • awk
  • branching
  • build-failures
  • cgi-perl
  • code-signing
  • commands
  • continuous Integration
  • cvs
  • cygwin
  • DNS
  • Drupal
  • EPM
  • euler
  • Fortify
  • hadoop
  • hpux
  • html
  • InstallShield
  • iptables
  • iso
  • jenkins-hudson
  • Jira
  • kiwi
  • linux
  • Makefile
  • maven
  • Miscellaneous
  • mysql
  • nexus
  • NFS
  • package
  • Perforce
  • Perl
  • php
  • rbuilder
  • rpath
  • rpm
  • rsync
  • Solaris
  • ssh
  • SuseStudio
  • tinderbox
  • unix
  • Visual studio 2008
  • vmware
  • war
  • webserver
  • wget
  • windows
  • xterm

Blog Archive

  • ►  2013 (12)
    • ►  December (1)
    • ►  July (2)
    • ►  April (2)
    • ►  March (2)
    • ►  February (3)
    • ►  January (2)
  • ▼  2012 (43)
    • ►  December (2)
    • ►  November (1)
    • ►  October (4)
    • ►  September (7)
    • ►  August (5)
    • ▼  July (4)
      • Upgrading Sonatype nexus from 1.5 to 1.6
      • Jira workflows - Dealing with validator
      • jenkins nested views not displaying with read perm...
      • How to run dos commands from cygwin? File name too...
    • ►  June (2)
    • ►  May (3)
    • ►  April (4)
    • ►  March (3)
    • ►  February (1)
    • ►  January (7)
  • ►  2011 (23)
    • ►  December (4)
    • ►  November (9)
    • ►  October (4)
    • ►  September (1)
    • ►  June (2)
    • ►  May (1)
    • ►  April (1)
    • ►  March (1)
  • ►  2010 (15)
    • ►  December (2)
    • ►  November (1)
    • ►  September (3)
    • ►  April (1)
    • ►  February (6)
    • ►  January (2)
  • ►  2009 (28)
    • ►  November (5)
    • ►  October (3)
    • ►  September (2)
    • ►  August (1)
    • ►  July (1)
    • ►  June (5)
    • ►  May (3)
    • ►  April (1)
    • ►  February (2)
    • ►  January (5)
  • ►  2008 (20)
    • ►  December (6)
    • ►  November (3)
    • ►  October (1)
    • ►  September (1)
    • ►  July (8)
    • ►  June (1)
Powered by Blogger.

About Me

Unknown
View my complete profile