public class CmsGitCheckin extends java.lang.Object
/WEB-INF/git-scripts/module-checkin.sh.| Constructor and Description |
|---|
CmsGitCheckin(CmsObject cms)
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addModuleToExport(java.lang.String moduleName)
Adds a module to the modules that should be exported.
|
int |
checkIn()
Start export and check in of the selected modules.
|
void |
clearModules()
Clears the selected modules.
|
boolean |
getCheckout()
Gets the checkout flag.
|
CmsObject |
getCmsObject()
Gets the CMS context.
|
java.lang.String |
getCommitMessage()
Returns the commitMessage.
|
java.util.Collection<CmsGitConfiguration> |
getConfigurations()
Returns the available configurations.
|
CmsGitConfiguration |
getCurrentConfiguration()
Returns the currently used configuration.
|
java.lang.String |
getGitUserEmail()
Returns the gitUserEmail.
|
java.lang.String |
getGitUserName()
Returns the gitUserName.
|
java.util.Collection<java.lang.String> |
getInstalledModules()
Returns the collection of all installed modules.
|
java.lang.String |
getLogFilePath()
Returns the path to the log file.
|
java.lang.String |
getLogText()
Gets the log text.
|
boolean |
hasValidConfiguration()
Returns true if at least one valid configuration is present.
|
boolean |
isFetchAndResetBeforeImport()
Returns true if the 'fetch and reset' flag is set.
|
boolean |
isModuleInstalled(java.lang.String moduleName)
Tests if a module is installed.
|
void |
setCheckout(boolean checkout)
Sets the checkout flag.
|
void |
setCommit(boolean autoCommit)
Setter for the commit mode.
|
void |
setCommitMessage(java.lang.String message)
Setter for the commit message.
|
void |
setCopyAndUnzip(boolean copyAndUnzip)
Setter for the copy and unzip mode.
|
boolean |
setCurrentConfiguration(CmsGitConfiguration configuration)
Sets the current configuration if it is a valid configuration.
|
void |
setExcludeLibs(boolean excludeLibs)
Setter for the exclude libs flag.
|
void |
setFetchAndResetBeforeImport(boolean fetchAndReset)
Sets the 'fetch and reset' flag.
|
void |
setGitUserEmail(java.lang.String useremail)
Setter for the git user email.
|
void |
setGitUserName(java.lang.String username)
Setter for the git user name.
|
void |
setIgnoreUnclean(boolean ignore)
Setter for the ignore-unclean flag.
|
void |
setPullAfter(boolean autoPull)
Setter for the pull-after flag.
|
void |
setPullBefore(boolean autoPull)
Setter for the pull-before flag.
|
void |
setPush(boolean autoPush)
Setter for the auto-push flag.
|
void |
setResetHead(boolean reset)
Setter for the reset-head flag.
|
void |
setResetRemoteHead(boolean reset)
Setter for the reset-remote-head flag.
|
static void |
zipRfsFolder(java.io.File root,
java.io.OutputStream zipOutput)
Creates ZIP file data from the files / subfolders of the given root folder, and sends it to the given stream.
|
public CmsGitCheckin(CmsObject cms)
cms - the CMS context to usepublic static void zipRfsFolder(java.io.File root, java.io.OutputStream zipOutput) throws java.lang.Exception
The stream passed as an argument is closed after the data is written.
root - the folder to zipzipOutput - the output stream which the zip file data should be written tojava.lang.Exception - if something goes wrongpublic void addModuleToExport(java.lang.String moduleName)
moduleName - the name of the module to export.public int checkIn()
public void clearModules()
public boolean getCheckout()
public CmsObject getCmsObject()
public java.lang.String getCommitMessage()
public java.util.Collection<CmsGitConfiguration> getConfigurations()
public CmsGitConfiguration getCurrentConfiguration()
public java.lang.String getGitUserEmail()
public java.lang.String getGitUserName()
public java.util.Collection<java.lang.String> getInstalledModules()
public java.lang.String getLogFilePath()
public java.lang.String getLogText()
public boolean hasValidConfiguration()
public boolean isFetchAndResetBeforeImport()
public boolean isModuleInstalled(java.lang.String moduleName)
moduleName - name of the module to check.public void setCheckout(boolean checkout)
checkout - the checkout flagpublic void setCommit(boolean autoCommit)
autoCommit - the commit mode to set.public void setCommitMessage(java.lang.String message)
message - the commit message to set.public void setCopyAndUnzip(boolean copyAndUnzip)
copyAndUnzip - the copy and unzip mode to set.public boolean setCurrentConfiguration(CmsGitConfiguration configuration)
configuration - the configuration to set.public void setExcludeLibs(boolean excludeLibs)
excludeLibs - flag, indicating if the lib/ folder of the modules should be deleted before the commit.public void setFetchAndResetBeforeImport(boolean fetchAndReset)
If this flag is set, the script will be used to fetch the remote branch and reset the current branch to the remote state before trying to import the modules.
fetchAndReset - the 'fetch and reset' flagpublic void setGitUserEmail(java.lang.String useremail)
useremail - the git user email to set.public void setGitUserName(java.lang.String username)
username - the git user name to set.public void setIgnoreUnclean(boolean ignore)
ignore - flag, indicating if an unclean repository should be ignored.public void setPullAfter(boolean autoPull)
autoPull - flag, indicating if a pull should be performed directly after the commit.public void setPullBefore(boolean autoPull)
autoPull - flag, indicating if a pull should be performed first.public void setPush(boolean autoPush)
autoPush - flag, indicating if a push should be performed in the end.public void setResetHead(boolean reset)
reset - flag, indicating if a reset to the HEAD should be performed or not.public void setResetRemoteHead(boolean reset)
reset - flag, indicating if a reset to the ${origin}/${branch} should be performed or not.