public class FlexDeployFunctions
extends BaseFunctions
Constructor and Description |
---|
FlexDeployFunctions(DevOpsRestAM pRestAM,
LogFunctions pFLOG) |
Modifier and Type | Method and Description |
---|---|
void |
addFilesToPackage(java.lang.Long pProjectId,
java.lang.String pPackageName,
java.util.List<java.lang.String> pFiles)
Adds files to a given package.
|
void |
addProjectsToRelease(java.lang.String pReleaseName,
java.util.List<ReleaseProjectsPojo> pReleaseProjects)
Add FlexDeploy projects to a given release.
|
void |
approveTask(java.lang.String pUsername,
java.lang.Long pTaskId,
java.lang.String pNotes)
Approve a FlexDeploy Task.
|
java.lang.Long |
buildPackage(java.lang.Long pStreamId,
ProjectPackagePojo projectPackage)
Builds a FlexDeploy Package.
|
java.lang.Long |
buildPackage(java.lang.Long pStreamId,
ProjectPackagePojo projectPackage,
PollingResult pPollingResult)
Builds a FlexDeploy Package using a PollingResult.
|
java.lang.Long |
buildPackage(java.lang.Long pStreamId,
ProjectPackagePojo projectPackage,
java.lang.String pEnvironmentCode)
Builds a FlexDeploy Package.
|
java.lang.Long |
buildPackage(java.lang.Long pStreamId,
ProjectPackagePojo projectPackage,
java.lang.String pEnvironmentCode,
PollingResult pPollingResult)
Builds a FlexDeploy Package using a PollingResult.
|
java.lang.Long |
buildProject(java.lang.Long pStreamId,
java.lang.Long pProjectId)
Builds a FlexDeploy Project.
|
java.lang.Long |
buildProject(java.lang.Long pStreamId,
java.lang.Long pProjectId,
PollingResult pPollingResult)
Builds a FlexDeploy Project using a PollingResult.
|
java.lang.Long |
buildProject(java.lang.Long pStreamId,
java.lang.Long pProjectId,
java.lang.String pEnvironmentCode)
Builds a FlexDeploy Project.
|
java.lang.Long |
buildProject(java.lang.Long pStreamId,
java.lang.Long pProjectId,
java.lang.String pEnvironmentCode,
PollingResult pPollingResult)
Builds a FlexDeploy Project using a PollingResult.
|
java.lang.Long |
createPackage(java.lang.Long pProjectId,
java.lang.String pPackageName,
java.lang.String pDescription,
java.util.List<java.lang.String> pFiles)
Creates a package for a given project and list of files.
|
java.lang.Long |
createRelease(java.lang.String pReleaseName,
java.lang.String pPipelineName,
java.lang.String pDescription)
Create an empty FlexDeploy Release that defaults to 'Not Started' status.
|
java.lang.Long |
createRelease(java.lang.String pReleaseName,
java.lang.String pPipelineName,
java.lang.String pDescription,
java.lang.String pCronSchedule)
Create an empty scheduled FlexDeploy Release that defaults to 'Not Started' status.
|
java.lang.Long |
createSnapshot(java.lang.Long pReleaseId)
Create a Snapshot for a given Release.
|
java.lang.Long |
createStream(java.lang.Long pProjectId,
java.lang.String pStreamName)
Create a FlexDeploy Stream on a given project.
|
java.lang.Long |
createStream(java.lang.Long pProjectId,
java.lang.String pStreamName,
java.lang.String pVersionSyntax)
Create a FlexDeploy Stream on a given project.
|
void |
deletePackage(java.lang.Long pProjectId,
java.lang.String pPackageName)
Deletes a project package
|
void |
endRelease(java.lang.Long pReleaseId)
End a FlexDeploy Release.
|
void |
endRelease(java.lang.String pReleaseName)
End a FlexDeploy Release.
|
PollingResult |
findLocalChangeLogs(java.lang.String pUrl,
java.lang.String pBranch,
java.lang.String pCurrentRevision,
java.lang.String pFromRevision)
Finds change logs for a local ssh enabled git repository.
|
PollingResult |
findLocalChangeLogs(java.lang.String pUrl,
java.lang.String pBranch,
java.lang.String pCurrentRevision,
java.lang.String pFromRevision,
java.lang.String pUser,
java.lang.String pPassword)
Finds change logs for a local git repository.
|
java.util.List<ProjectPackagePojo> |
findPackagesForChange(java.lang.String pRepositoryName,
java.lang.String pStreamName,
java.util.List<java.lang.String> pChangedFiles)
Finds relevant FlexDeploy Packages for a list of changed files.
|
java.util.List<ProjectPackagePojo> |
findPackagesForChange(java.lang.String pRepositoryName,
java.lang.String pStreamName,
PollingResult pPollingResult)
Finds relevant FlexDeploy Packages for any given PollingResult.
|
java.lang.Long |
findProjectId(java.lang.String pProjectName)
Finds the FlexDeploy Project id for any given name
|
java.util.Set<java.lang.Long> |
findProjectsForChange(java.lang.String pRepositoryName,
java.lang.String pStreamName,
java.util.List<java.lang.String> pChangedFiles)
Finds relevant FlexDeploy Projects for a list of changed files.
|
java.util.Set<java.lang.Long> |
findProjectsForChange(java.lang.String pRepositoryName,
java.lang.String pStreamName,
PollingResult pPollingResult)
Finds relevant FlexDeploy Projects for any given PollingResult and stream.
|
java.util.Set<java.lang.Long> |
findProjectsForNewBranch(java.lang.String pRepositoryName)
Finds relevant FlexDeploy Projects for a new branch event.
|
java.util.Set<java.lang.Long> |
findProjectsForNewBranch(java.lang.String pRepositoryName,
PollingResult pPollingResult)
Finds relevant FlexDeploy Projects for a new branch event.
|
java.util.List<ReleasePojo> |
findReleases(java.lang.String pName)
Finds Releases matching the specified name.
|
java.lang.Long |
findStreamId(java.lang.Long pProjectId,
java.lang.String pStreamName)
Finds a FlexDeploy stream id from the Stream name.
|
java.lang.String |
getGroovyKey() |
ProjectPojo |
getProject(java.lang.Long pProjectId)
Returns project information for a given projectId.
|
ReleasePojo |
getRelease(java.lang.Long pId)
Gets a release by a specific id.
|
void |
inactivateStream(java.lang.Long pProjectId,
java.lang.String pStreamName)
Inactive a FlexDeploy Stream on a project.
|
void |
pauseRelease(java.lang.Long pReleaseId)
Pause a FlexDeploy Release.
|
void |
pauseRelease(java.lang.String pReleaseName)
Pause a FlexDeploy Release.
|
java.lang.Integer |
populateFiles(java.lang.Long pProjectId,
java.lang.Long pStreamId)
Populate partial deployment files for a given project.
|
void |
rejectTask(java.lang.String pUsername,
java.lang.Long pTaskId,
java.lang.String pNotes)
Reject a FlexDeploy Task.
|
void |
removeProjectsFromRelease(java.lang.String pReleaseName,
java.util.List<ReleaseProjectsPojo> pReleaseProjects)
Remove FlexDeploy projects from a given release.
|
void |
startRelease(java.lang.Long pReleaseId)
Start a FlexDeploy Release.
|
void |
startRelease(java.lang.String pReleaseName)
Start a FlexDeploy Release.
|
void |
updatePackage(java.lang.Long pProjectId,
java.lang.String pPackageName,
java.lang.Long pStreamId,
PollingResult pPollingResult)
Updates a given package relative to a PollingResult.
|
public FlexDeployFunctions(DevOpsRestAM pRestAM, LogFunctions pFLOG)
public PollingResult findLocalChangeLogs(java.lang.String pUrl, java.lang.String pBranch, java.lang.String pCurrentRevision, java.lang.String pFromRevision) throws FlexCheckedException
findLocalChangeLogs
pUrl
- Url of the git repository to find logs againstpBranch
- Branch to find logs againstpCurrentRevision
- Current revision after the pushpFromRevision
- Previous revision before the pushFlexCheckedException
- If an invalid revision is passed.public PollingResult findLocalChangeLogs(java.lang.String pUrl, java.lang.String pBranch, java.lang.String pCurrentRevision, java.lang.String pFromRevision, java.lang.String pUser, java.lang.String pPassword) throws FlexCheckedException
pUrl
- Url of the git repository to find logs againstpBranch
- Branch to find logs againstpCurrentRevision
- Current revision after the pushpFromRevision
- Previous revision before the pushpUser
- User to use for local credentialspPassword
- Password of the userFlexCheckedException
- If an invalid revision is passed.public ProjectPojo getProject(java.lang.Long pProjectId) throws FlexNotFoundException
pProjectId
- Project Id of the project to retrieveFlexNotFoundException
- When no project is found for given Idpublic ReleasePojo getRelease(java.lang.Long pId) throws FlexNotFoundException
pId
- Release IdFlexNotFoundException
- When no Release is found for the given idpublic java.util.List<ReleasePojo> findReleases(java.lang.String pName) throws FlexNotFoundException
getRelease
this method returns a list of Releases.pName
- Name to search byFlexNotFoundException
- When no releases match the naming criteriapublic void addFilesToPackage(java.lang.Long pProjectId, java.lang.String pPackageName, java.util.List<java.lang.String> pFiles) throws FlexCheckedException
pProjectId
- Parent project id of the packagepPackageName
- Name of the packagepFiles
- Filepaths to add to the package.FlexCheckedException
public java.lang.Integer populateFiles(java.lang.Long pProjectId, java.lang.Long pStreamId)
pProjectId
- Project id to populate files for. This should be a project using partial deployment.pStreamId
- Stream id to use when populating.findStreamId(java.lang.Long, java.lang.String)
public void updatePackage(java.lang.Long pProjectId, java.lang.String pPackageName, java.lang.Long pStreamId, PollingResult pPollingResult) throws FlexNotFoundException, FlexCheckedException
addFilesToPackage
method.
This function will automatically populate files if new files are detected.pProjectId
- Parent project id of the packagepPackageName
- Name of the packagepStreamId
- Stream to use when populating files if new files are foundpPollingResult
- PollingResult object to use for finding differencesFlexNotFoundException
- Project id is not found or package doesnt exist on project.FlexCheckedException
- All other exceptionsBitbucketFunctions.getChangeLogs(java.lang.Object, java.lang.String, java.lang.String)
,
GithubFunctions.getChangeLogs(java.lang.Object)
public java.lang.Long createPackage(java.lang.Long pProjectId, java.lang.String pPackageName, java.lang.String pDescription, java.util.List<java.lang.String> pFiles) throws FlexCheckedException
pProjectId
- Parent project id to create package under.pPackageName
- Package name to use.pDescription
- Description to give the package.pFiles
- List of files to add to the package. File paths should be as they appear in the project files tab of the project.FlexCheckedException
public void deletePackage(java.lang.Long pProjectId, java.lang.String pPackageName) throws FlexCheckedException
pProjectId
- Parent project id package is under.pPackageName
- Name of package to delete.FlexCheckedException
public java.lang.Long buildPackage(java.lang.Long pStreamId, ProjectPackagePojo projectPackage) throws FlexCheckedException
PollingResult variant
pStreamId
- Stream to use when building package. See findStreamId
.projectPackage
- Wrapper object containing project id and package name to build.FlexCheckedException
public java.lang.Long buildPackage(java.lang.Long pStreamId, ProjectPackagePojo projectPackage, java.lang.String pEnvironmentCode) throws FlexCheckedException
PollingResult variant
pStreamId
- Stream to use when building package. See findStreamId
.projectPackage
- Wrapper object containing project id and package name to build.pEnvironmentCode
- Environment code to use for the build request.FlexCheckedException
public java.lang.Long buildPackage(java.lang.Long pStreamId, ProjectPackagePojo projectPackage, PollingResult pPollingResult) throws FlexCheckedException
pStreamId
- Stream to use when building package. See findStreamId
.projectPackage
- Wrapper object containing project id and package name to build.pPollingResult
- PollingResult object containing change logs and committer information.FlexCheckedException
BitbucketFunctions.getChangeLogs(java.lang.Object, java.lang.String, java.lang.String)
,
GithubFunctions.getChangeLogs(java.lang.Object)
public java.lang.Long buildPackage(java.lang.Long pStreamId, ProjectPackagePojo projectPackage, java.lang.String pEnvironmentCode, PollingResult pPollingResult) throws FlexCheckedException
pStreamId
- Stream to use when building package. See findStreamId
.projectPackage
- Wrapper object containing project id and package name to build.pEnvironmentCode
- Environment code to use for the build request.pPollingResult
- PollingResult object containing change logs and committer information.FlexCheckedException
BitbucketFunctions.getChangeLogs(java.lang.Object, java.lang.String, java.lang.String)
,
GithubFunctions.getChangeLogs(java.lang.Object)
public java.lang.Long buildProject(java.lang.Long pStreamId, java.lang.Long pProjectId) throws FlexCheckedException
PollingResult variant
pStreamId
- Stream to use when building project. See findStreamId
.pProjectId
- Project id to build.FlexCheckedException
public java.lang.Long buildProject(java.lang.Long pStreamId, java.lang.Long pProjectId, java.lang.String pEnvironmentCode) throws FlexCheckedException
PollingResult variant
pStreamId
- Stream to use when building project. See findStreamId
.pProjectId
- Project id to build.pEnvironmentCode
- Environment code to use for the build request.FlexCheckedException
public java.lang.Long buildProject(java.lang.Long pStreamId, java.lang.Long pProjectId, PollingResult pPollingResult) throws FlexCheckedException
pStreamId
- Stream to use when building project. See findStreamId
.pProjectId
- Project id to build.pPollingResult
- PollingResult object containing change logs and committer information.FlexCheckedException
BitbucketFunctions.getChangeLogs(java.lang.Object, java.lang.String, java.lang.String)
,
GithubFunctions.getChangeLogs(java.lang.Object)
public java.lang.Long buildProject(java.lang.Long pStreamId, java.lang.Long pProjectId, java.lang.String pEnvironmentCode, PollingResult pPollingResult) throws FlexCheckedException
pStreamId
- Stream to use when building project. See findStreamId
.pProjectId
- Project id to build.pEnvironmentCode
- Environment code to use for the build request.pPollingResult
- PollingResult object containing change logs and committer information.FlexCheckedException
BitbucketFunctions.getChangeLogs(java.lang.Object, java.lang.String, java.lang.String)
,
GithubFunctions.getChangeLogs(java.lang.Object)
public java.util.Set<java.lang.Long> findProjectsForNewBranch(java.lang.String pRepositoryName)
pRepositoryName
- Github repository name with the change. Name is of the form (username/repo). e.g. toddmotto/public-apispublic java.util.Set<java.lang.Long> findProjectsForNewBranch(java.lang.String pRepositoryName, PollingResult pPollingResult)
findProjectsForNewBranch
.
This function currently only compares against Git repositories and is not compatible with other scm types.pRepositoryName
- Github repository name with the change. Name is of the form (username/repo). e.g. toddmotto/public-apispPollingResult
- PollingResult object for determining relevant projects.BitbucketFunctions.getChangeLogs(java.lang.Object, java.lang.String, java.lang.String)
,
GithubFunctions.getChangeLogs(java.lang.Object)
public java.util.Set<java.lang.Long> findProjectsForChange(java.lang.String pRepositoryName, java.lang.String pStreamName, PollingResult pPollingResult)
pRepositoryName
- Github repository name with the change. Name is of the form (username/repo). e.g. toddmotto/public-apispStreamName
- Stream/branch name for which the change occurred. e.g. 'master'pPollingResult
- PollingResult object for determining relevant projects.BitbucketFunctions.getChangeLogs(java.lang.Object, java.lang.String, java.lang.String)
,
GithubFunctions.getChangeLogs(java.lang.Object)
public java.util.Set<java.lang.Long> findProjectsForChange(java.lang.String pRepositoryName, java.lang.String pStreamName, java.util.List<java.lang.String> pChangedFiles)
pRepositoryName
- Github repository name with the change. Name is of the form (username/repo). e.g. toddmotto/public-apispStreamName
- Stream/branch name for which the change occurred. e.g. 'master'pChangedFiles
- List of changed files from a push event. If no files are passed then all projects using given repository will be returned.BitbucketFunctions.getChangeLogs(java.lang.Object, java.lang.String, java.lang.String)
,
GithubFunctions.getChangeLogs(java.lang.Object)
public java.util.List<ProjectPackagePojo> findPackagesForChange(java.lang.String pRepositoryName, java.lang.String pStreamName, PollingResult pPollingResult)
pRepositoryName
- Github repository name with the change. Name is of the form (username/repo). e.g. toddmotto/public-apispStreamName
- Stream/branch name for which the change occurred. e.g. 'master'pPollingResult
- PollingResult object for determining relevant packages.BitbucketFunctions.getChangeLogs(java.lang.Object, java.lang.String, java.lang.String)
,
GithubFunctions.getChangeLogs(java.lang.Object)
public java.util.List<ProjectPackagePojo> findPackagesForChange(java.lang.String pRepositoryName, java.lang.String pStreamName, java.util.List<java.lang.String> pChangedFiles)
pRepositoryName
- Github repository name with the change. Name is of the form (username/repo). e.g. toddmotto/public-apispStreamName
- Stream/branch name for which the change occurred. e.g. 'master'pChangedFiles
- List of changed files from a push event. If no files are passed then all packages using given repository will be returned.BitbucketFunctions.getChangeLogs(java.lang.Object, java.lang.String, java.lang.String)
,
GithubFunctions.getChangeLogs(java.lang.Object)
public java.lang.Long findProjectId(java.lang.String pProjectName) throws FlexNotFoundException, FlexCheckedException
pProjectName
- Case sensitive project name to search byFlexNotFoundException
- If project name is not found in FlexDeployFlexCheckedException
- All other exceptionspublic java.lang.Long createRelease(java.lang.String pReleaseName, java.lang.String pPipelineName, java.lang.String pDescription) throws FlexCheckedException
pReleaseName
- Name to give Release.pPipelineName
- Pipeline name to use for the Release.pDescription
- Optional description to give the Release.FlexCheckedException
public java.lang.Long createRelease(java.lang.String pReleaseName, java.lang.String pPipelineName, java.lang.String pDescription, java.lang.String pCronSchedule) throws FlexCheckedException
pReleaseName
- Name to give Release.pPipelineName
- Pipeline name to use for the Release.pDescription
- Optional description to give the Release.pCronSchedule
- Cron schedule to give the Release.FlexCheckedException
public void endRelease(java.lang.String pReleaseName) throws FlexCheckedException, FlexNotFoundException
pReleaseName
- Release name to end.FlexNotFoundException
- When Release is not foundFlexCheckedException
- All other exceptionspublic void endRelease(java.lang.Long pReleaseId) throws FlexCheckedException, FlexNotFoundException
pReleaseId
- Release id to end.FlexNotFoundException
- When Release is not foundFlexCheckedException
- All other exceptionspublic void pauseRelease(java.lang.String pReleaseName) throws FlexCheckedException, FlexNotFoundException
pReleaseName
- Release name to pause.FlexNotFoundException
- When Release is not foundFlexCheckedException
- All other exceptionspublic void pauseRelease(java.lang.Long pReleaseId) throws FlexCheckedException, FlexNotFoundException
pReleaseId
- Release id to pause.FlexNotFoundException
- When Release is not foundFlexCheckedException
- All other exceptionspublic void startRelease(java.lang.String pReleaseName) throws FlexCheckedException, FlexNotFoundException
pReleaseName
- Release name to start.FlexNotFoundException
- When Release is not foundFlexCheckedException
- All other exceptionspublic void startRelease(java.lang.Long pReleaseId) throws FlexCheckedException, FlexNotFoundException
pReleaseId
- Release id to start.FlexNotFoundException
- When Release is not foundFlexCheckedException
- All other exceptionspublic void addProjectsToRelease(java.lang.String pReleaseName, java.util.List<ReleaseProjectsPojo> pReleaseProjects) throws FlexCheckedException, FlexNotFoundException
pReleaseName
- Release name to add projects to.pReleaseProjects
- List of ReleaseProjects to add.FlexCheckedException
FlexNotFoundException
public void removeProjectsFromRelease(java.lang.String pReleaseName, java.util.List<ReleaseProjectsPojo> pReleaseProjects) throws FlexCheckedException, FlexNotFoundException
pReleaseName
- Release name to remove projects from.pReleaseProjects
- List of ReleaseProjects to remove.FlexCheckedException
FlexNotFoundException
public java.lang.Long createSnapshot(java.lang.Long pReleaseId) throws FlexCheckedException
pReleaseId
- Release to create the snapshot forFlexCheckedException
public java.lang.Long findStreamId(java.lang.Long pProjectId, java.lang.String pStreamName) throws FlexCheckedException, FlexNotFoundException
pProjectId
- Project id on which the stream belongs.pStreamName
- Name of the stream. e.g. 'feature/JIRA-12', 'master'.FlexNotFoundException
- If stream name is not found on the project.FlexCheckedException
- All other exceptionspublic java.lang.Long createStream(java.lang.Long pProjectId, java.lang.String pStreamName, java.lang.String pVersionSyntax) throws FlexCheckedException
pProjectId
- Project to create the stream on.pStreamName
- Stream name to createpVersionSyntax
- Version Syntax to use for the stream. For example: "1.0.mybranch." + SequenceNumber. Note that this is a groovy script and literal strings should be enclosed in quotes.FlexCheckedException
public java.lang.Long createStream(java.lang.Long pProjectId, java.lang.String pStreamName) throws FlexCheckedException
pProjectId
- Project to create the stream on.pStreamName
- Stream name to createFlexCheckedException
public void inactivateStream(java.lang.Long pProjectId, java.lang.String pStreamName) throws FlexCheckedException
pProjectId
- Project id for which the stream belongs.pStreamName
- Stream name to inactivate.FlexCheckedException
public void approveTask(java.lang.String pUsername, java.lang.Long pTaskId, java.lang.String pNotes) throws FlexCheckedException, FlexNotFoundException
pUsername
- Username to approve the task as, the user passed here needs permission to approve otherwise an error will occur. User must be in local realm.pTaskId
- Task id to approve.pNotes
- Optional notes to assign to the approval.FlexNotFoundException
- If no task found for passed idFlexCheckedException
- All other exceptionspublic void rejectTask(java.lang.String pUsername, java.lang.Long pTaskId, java.lang.String pNotes) throws FlexCheckedException, FlexNotFoundException
pUsername
- Username to reject the task as, the user passed here needs permission to reject otherwise an error will occur. User must be in local realm.pTaskId
- Task id to reject.pNotes
- Optional notes to assign to the rejected task.FlexNotFoundException
- If no task found for passed idFlexCheckedException
- All other exceptionspublic java.lang.String getGroovyKey()