Class ReleaserUtils


  • public class ReleaserUtils
    extends java.lang.Object
    The Class ReleaserUtils.
    Author:
    merlinfe
    • Field Detail

      • REGEX_ID

        public static final java.lang.String REGEX_ID
        The Constant REGEX_ID.
        See Also:
        Constant Field Values
    • Constructor Detail

      • ReleaserUtils

        public ReleaserUtils()
    • Method Detail

      • getWorklowContextDataKey

        public static java.lang.String getWorklowContextDataKey​(java.lang.String strArtifactId,
                                                                int nContextId)
        Gets the worklow context data key.
        Parameters:
        strArtifactId - the str artifact id
        nContextId - the n context id
        Returns:
        the worklow context data key
      • getLastReleaseVersionDataKey

        public static java.lang.String getLastReleaseVersionDataKey​(java.lang.String strArtifactId)
        Gets the last release version data key.
        Parameters:
        strArtifactId - the str artifact id
        Returns:
        the last release version data key
      • getLastReleaseNextSnapshotVersionDataKey

        public static java.lang.String getLastReleaseNextSnapshotVersionDataKey​(java.lang.String strArtifactId)
        Gets the last release next snapshot version data key.
        Parameters:
        strArtifactId - the str artifact id
        Returns:
        the last release next snapshot version data key
      • getLocalPath

        public static java.lang.String getLocalPath​(WorkflowReleaseContext context)
        Gets the local path.
        Parameters:
        context - the context
        Returns:
        the local path
      • getLocalPomPath

        public static java.lang.String getLocalPomPath​(WorkflowReleaseContext context)
        Gets the local pom path.
        Parameters:
        context - the context
        Returns:
        the local pom path
      • getLocalSitePath

        public static java.lang.String getLocalSitePath​(Site site)
        Gets the local site path.
        Parameters:
        site - the site
        Returns:
        the local site path
      • getLocalSitePomPath

        public static java.lang.String getLocalSitePomPath​(Site site)
        Gets the local site pom path.
        Parameters:
        site - the site
        Returns:
        the local site pom path
      • getComponentName

        public static java.lang.String getComponentName​(java.lang.String strScmDeveloperConnection,
                                                        java.lang.String strArtifactId)
        Gets the component name.
        Parameters:
        strScmDeveloperConnection - the str scm developer connection
        strArtifactId - the str artifact id
        Returns:
        the component name
      • getSiteTagName

        public static java.lang.String getSiteTagName​(Site site)
        Gets the site tag name.
        Parameters:
        site - the site
        Returns:
        the site tag name
      • addInfoError

        public static void addInfoError​(CommandResult commandResult,
                                        java.lang.String strError,
                                        java.lang.Exception e)
        Adds the info error.
        Parameters:
        commandResult - the command result
        strError - the str error
        e - the e
      • addTechnicalError

        public static void addTechnicalError​(CommandResult commandResult,
                                             java.lang.String strError,
                                             java.lang.Exception e)
                                      throws fr.paris.lutece.portal.service.util.AppException
        Adds the technical error.
        Parameters:
        commandResult - the command result
        strError - the str error
        e - the e
        Throws:
        fr.paris.lutece.portal.service.util.AppException - the app exception
      • addTechnicalError

        public static void addTechnicalError​(CommandResult commandResult,
                                             java.lang.String strError)
                                      throws fr.paris.lutece.portal.service.util.AppException
        Adds the technical error.
        Parameters:
        commandResult - the command result
        strError - the str error
        Throws:
        fr.paris.lutece.portal.service.util.AppException - the app exception
      • startCommandResult

        public static void startCommandResult​(WorkflowReleaseContext context)
        Start command result.
        Parameters:
        context - the context
      • logStartAction

        public static void logStartAction​(WorkflowReleaseContext context,
                                          java.lang.String strActionName)
        Log start action.
        Parameters:
        context - the context
        strActionName - the str action name
      • logEndAction

        public static void logEndAction​(WorkflowReleaseContext context,
                                        java.lang.String strActionName)
        Log end action.
        Parameters:
        context - the context
        strActionName - the str action name
      • stopCommandResult

        public static void stopCommandResult​(WorkflowReleaseContext context)
        Stop command result.
        Parameters:
        context - the context
      • convertStringToInt

        public static int convertStringToInt​(java.lang.String strParameter)
        convert a string to int.
        Parameters:
        strParameter - the string parameter to convert
        Returns:
        the conversion
      • getReleaserUser

        public static ReleaserUser getReleaserUser​(javax.servlet.http.HttpServletRequest request,
                                                   java.util.Locale locale)
        Gets the releaser user.
        Parameters:
        request - the request
        locale - the locale
        Returns:
        the releaser user
      • populateReleaserUser

        public static void populateReleaserUser​(javax.servlet.http.HttpServletRequest request,
                                                ReleaserUser user)
        Populate releaser user.
        Parameters:
        request - the request
        user - the user
      • setReleaserUser

        public static void setReleaserUser​(javax.servlet.http.HttpServletRequest request,
                                           ReleaserUser releaserUser)
        Sets the releaser user.
        Parameters:
        request - the request
        releaserUser - the releaser user
      • isApplicationAccountEnable

        public static boolean isApplicationAccountEnable()
        Checks if is application account enable.
        Returns:
        true, if is application account enable
      • compareVersion

        public static int compareVersion​(java.lang.String strVersion1,
                                         java.lang.String strVersion2)
        Compare version.
        Parameters:
        strVersion1 - the str version 1
        strVersion2 - the str version 2
        Returns:
        the int
      • cleanPWDInLog

        public static java.lang.String cleanPWDInLog​(java.lang.String strLog)
      • getBranchReleaseFrom

        public static java.lang.String getBranchReleaseFrom​(WorkflowReleaseContext context)
      • IsVersionInRightFormat

        public static boolean IsVersionInRightFormat​(java.lang.String strVersion)