Subversion Repositories DevTools

Rev

Rev 1313 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1313 Rev 2541
Line 182... Line 182...
182
   * @attribute
182
   * @attribute
183
   */
183
   */
184
 
184
 
185
  private String mPlannedPkgVersion = null;
185
  private String mPlannedPkgVersion = null;
186
 
186
 
-
 
187
  /** Set in autoMakeRelease
-
 
188
   * @attribute
-
 
189
   */
-
 
190
   public String mAutoMakeReleaseCause = null;
-
 
191
 
187
  /**in daemon mode
192
  /**in daemon mode
188
   *   select gm.gbe_value from release_manager.release_config rc, release_manager.gbe_machtype gm
193
   *   select gm.gbe_value from release_manager.release_config rc, release_manager.gbe_machtype gm
189
   *   where rc.rtag_id=<baseline> and gm.gbe_id=rc.gbe_id;
194
   *   where rc.rtag_id=<baseline> and gm.gbe_id=rc.gbe_id;
190
   * in escrow mode
195
   * in escrow mode
191
   *   select gm.gbe_value from deployment_manager.boms b, release_manager.release_config rc,
196
   *   select gm.gbe_value from deployment_manager.boms b, release_manager.release_config rc,
Line 3856... Line 3861...
3856
  }
3861
  }
3857
 
3862
 
3858
  /**handles database connection/disconnection
3863
  /**handles database connection/disconnection
3859
   * executes the AutoMakeRelease stored procedure with the passed parameters
3864
   * executes the AutoMakeRelease stored procedure with the passed parameters
3860
   */
3865
   */
3861
  public void autoMakeRelease(String rtagId,
3866
  public boolean autoMakeRelease(String rtagId,
3862
                              String packageName,
3867
                              String packageName,
3863
                              String packageExtension, 
3868
                              String packageExtension, 
3864
                              String packageVersion,
3869
                              String packageVersion,
3865
                              String packageVcsTag,
3870
                              String packageVcsTag,
3866
                              String packageDepends,
3871
                              String packageDepends,
3867
                              String isRipple) throws SQLException, Exception
3872
                              String isRipple) throws SQLException, Exception
3868
  {
3873
  {
-
 
3874
    mAutoMakeReleaseCause = null;
3869
    mLogger.debug("autoMakeRelease " + packageName);
3875
    mLogger.debug("autoMakeRelease " + packageName);
3870
    if ( mUseDatabase )
3876
    if ( mUseDatabase )
3871
    {
3877
    {
3872
      try
3878
      try
3873
      {
3879
      {
Line 3882... Line 3888...
3882
        stmt.setString( 7, packageDepends );
3888
        stmt.setString( 7, packageDepends );
3883
        stmt.setString( 8, isRipple );
3889
        stmt.setString( 8, isRipple );
3884
        stmt.setString( 9, "buildadm" );
3890
        stmt.setString( 9, "buildadm" );
3885
        stmt.executeUpdate();
3891
        stmt.executeUpdate();
3886
        int result = stmt.getInt( 1 );
3892
        int result = stmt.getInt( 1 );
-
 
3893
 
3887
        
3894
        //
-
 
3895
        //  Return values
-
 
3896
        //      >0 PVID of package
-
 
3897
        //      -1 Package not found
-
 
3898
        //      -2 Package already exists
-
 
3899
        //      -3 Not approved for auto build
-
 
3900
        //      -4 Package Migrated to SVN being built from CC tag
-
 
3901
        //  Sql Application Errors cause an SQLException
3888
        if ( result <= 0 && result != -2 )
3902
        //         Rtagid is NULL
-
 
3903
        //         No Package Name
-
 
3904
        //         No Package Version
-
 
3905
        //         No Package VCS
-
 
3906
        //         Bad IsRipple value
-
 
3907
        //         No User Name
-
 
3908
        //         Malformed VCS Tag
-
 
3909
        //         Database missing VCS tag
-
 
3910
        //         Invalid UserName
-
 
3911
        //
-
 
3912
 
3889
        {
3913
        //
3890
          // -2 if already released
3914
        //  Report per-package errors directly
-
 
3915
        //  Exceptions are for errors that need to halt the entire system
-
 
3916
        //
3891
          // flag build failure
3917
        if ( result <= 0 )
-
 
3918
        {
3892
          mLogger.fatal("autoMakeRelease show stopper PK_RMAPI.AUTO_MAKE_RELEASE failed, returned" + result);
3919
            mLogger.fatal("autoMakeRelease PK_RMAPI.AUTO_MAKE_RELEASE failed, returned " + result);
-
 
3920
            if ( result == -4 ) {
-
 
3921
                mAutoMakeReleaseCause = "Package migrated to SVN being built from CC tag";
-
 
3922
            } else if ( result == -3 ) {
-
 
3923
                mAutoMakeReleaseCause = "Package not approved for autobuild";
-
 
3924
            } else if ( result == -2 ) {
-
 
3925
                // This is OK
-
 
3926
            } else {
-
 
3927
                // Don't know this error - so its fatal
3893
          throw new Exception("autoMakeRelease show stopper PK_RMAPI.AUTO_MAKE_RELEASE failed, returned" + result);
3928
                throw new Exception("autoMakeRelease show stopper PK_RMAPI.AUTO_MAKE_RELEASE failed, returned " + result);
-
 
3929
            }
3894
        }
3930
        }
3895
        stmt.close();
3931
        stmt.close();
3896
        commit();
3932
        commit();
3897
      }
3933
      }
3898
      catch( SQLException e )
3934
      catch( SQLException e )
Line 3901... Line 3937...
3901
        {
3937
        {
3902
          mLogger.error("autoMakeRelease database access error only");
3938
          mLogger.error("autoMakeRelease database access error only");
3903
          throw new SQLException();
3939
          throw new SQLException();
3904
        }
3940
        }
3905
        else
3941
        else
-
 
3942
 
3906
        {
3943
        {
3907
          mLogger.fatal("autoMakeRelease show stopper");
3944
          mLogger.fatal("autoMakeRelease show stopper");
3908
          throw new Exception("autoMakeRelease show stopper");
3945
          throw new Exception("autoMakeRelease show stopper");
3909
        }
3946
        }
3910
      }
3947
      }
Line 3914... Line 3951...
3914
        // even if an exception is thrown
3951
        // even if an exception is thrown
3915
        // ensure disconnect
3952
        // ensure disconnect
3916
        disconnect();
3953
        disconnect();
3917
      }
3954
      }
3918
    }
3955
    }
-
 
3956
 
-
 
3957
    return (mAutoMakeReleaseCause != null);
3919
  }
3958
  }
3920
 
3959
 
3921
  /**handles database connection/disconnection
3960
  /**handles database connection/disconnection
3922
   * executes the insertPackageMetrics stored procedure with the passed parameters
3961
   * executes the insertPackageMetrics stored procedure with the passed parameters
3923
   */
3962
   */
Line 4525... Line 4564...
4525
              // failed on first connection attempt - unlikely due to database loading - likely bad connection parameters
4564
              // failed on first connection attempt - unlikely due to database loading - likely bad connection parameters
4526
              throw new SQLException();
4565
              throw new SQLException();
4527
            }
4566
            }
4528
          }
4567
          }
4529
        } while ( problemConnecting );
4568
        } while ( problemConnecting );
-
 
4569
          mLogger.warn("connect checked connection");
4530
      }
4570
      }
4531
    }
4571
    }
4532
    finally
4572
    finally
4533
    {
4573
    {
4534
      mConnection = connection;
4574
      mConnection = connection;
-
 
4575
mLogger.warn("connect finally connection");
4535
    }
4576
    }
4536
    return connection;
4577
    return connection;
4537
 
4578
 
4538
  }
4579
  }
4539
 
4580