public class GitSiteWagon
extends org.apache.maven.wagon.AbstractWagon
This should do more or less the following, but doesn't because it doesn't actually delete old files.
mkdir ${checkoutDirectory} cd ${checkoutDirectory} git init git remote add origin ${gitRepoUrl} git pull origin refs/heads/${siteBranch}We need to create the gh-pages branch if it doesn't already exist:git add . git commit -a -m "Wagon: Deploying site to repository" git push origin master:${siteBranch} rm -Rf ${checkoutDirectory}
cd ${checkoutDirectory} git symbolic-ref HEAD refs/heads/gh-pages rm .git/index git clean -fdx git add . git commit -a -m "First pages commit" git push origin gh-pages
Constructor and Description |
---|
GitSiteWagon() |
Modifier and Type | Method and Description |
---|---|
void |
closeConnection() |
void |
connect(org.apache.maven.wagon.repository.Repository repository,
org.apache.maven.wagon.authentication.AuthenticationInfo authenticationInfo,
org.apache.maven.wagon.proxy.ProxyInfoProvider proxyInfoProvider) |
protected org.apache.maven.scm.ScmResult |
executeCommand(org.apache.maven.scm.provider.git.gitexe.GitExeScmProvider scmProvider,
org.apache.maven.scm.provider.git.command.GitCommand command,
org.apache.maven.scm.provider.ScmProviderRepository repository,
org.apache.maven.scm.ScmFileSet fileSet,
org.apache.maven.scm.CommandParameters parameters)
Wrapper around gitCommand.execute to handle setting the logger.
|
void |
get(String resourceName,
File destination) |
File |
getCheckoutDirectory()
Get the directory where Wagon will checkout files from SCM.
|
List<String> |
getFileList(String resourcePath)
Get the file list for the resource.
|
boolean |
getIfNewer(String resourceName,
File destination,
long timestamp) |
org.apache.maven.scm.manager.ScmManager |
getScmManager()
Get the
ScmManager used in this Wagon. |
org.apache.maven.scm.provider.ScmProvider |
getScmProvider(String scmType)
Convenience method to get the
ScmProvider implementation to
handle the provided SCM type. |
String |
getSiteBranch()
Get the
siteBranch used in this Wagon. |
void |
openConnectionInternal()
This will clean up the checkout directory.
|
void |
put(File source,
String destination) |
void |
putDirectory(File sourceDirectory,
String destinationDirectory) |
boolean |
resourceExists(String resourceName) |
void |
setCheckoutDirectory(File checkoutDirectory)
Set the directory where Wagon will checkout files from SCM.
|
void |
setScmManager(org.apache.maven.scm.manager.ScmManager scmManager)
Set the
ScmManager used in this Wagon. |
void |
setSiteBranch(String siteBranch)
Set the
siteBranch used in this Wagon. |
boolean |
supportsDirectoryCopy()
Return whether or not this wagon supports directory copy.
|
addSessionListener, addTransferListener, cleanupGetTransfer, cleanupPutTransfer, connect, connect, connect, connect, connect, createParentDirectories, disconnect, finishGetTransfer, finishPutTransfer, fireGetCompleted, fireGetInitiated, fireGetStarted, firePutCompleted, firePutInitiated, firePutStarted, fireSessionConnectionRefused, fireSessionDebug, fireSessionDisconnected, fireSessionDisconnecting, fireSessionError, fireSessionLoggedIn, fireSessionLoggedOff, fireSessionOpened, fireSessionOpening, fireTransferDebug, fireTransferError, fireTransferProgress, getAuthenticationInfo, getPath, getPermissionsOverride, getProxyInfo, getProxyInfo, getRepository, getSessionEventSupport, getTimeout, getTransfer, getTransfer, getTransfer, getTransfer, getTransferEventSupport, hasSessionListener, hasTransferListener, isInteractive, openConnection, postProcessListeners, putTransfer, putTransfer, removeSessionListener, removeTransferListener, setInteractive, setPermissionsOverride, setSessionEventSupport, setTimeout, setTransferEventSupport, transfer, transfer, transfer
public org.apache.maven.scm.manager.ScmManager getScmManager()
ScmManager
used in this Wagon.ScmManager
.public void setScmManager(org.apache.maven.scm.manager.ScmManager scmManager)
ScmManager
used in this Wagon.scmManager
- the scmManager to set.public String getSiteBranch()
siteBranch
used in this Wagon.siteBranch
.public void setSiteBranch(String siteBranch)
siteBranch
used in this Wagon.siteBranch
- the siteBranch to set.public File getCheckoutDirectory()
checkoutDirectory
.public void setCheckoutDirectory(File checkoutDirectory)
checkoutDirectory
- the check-out directory to set.public org.apache.maven.scm.provider.ScmProvider getScmProvider(String scmType) throws org.apache.maven.scm.manager.NoSuchScmProviderException
ScmProvider
implementation to
handle the provided SCM type.scmType
- type of SCM, eg. svn
, cvs
ScmProvider
that will handle provided SCM type.org.apache.maven.scm.manager.NoSuchScmProviderException
- if there is no ScmProvider
able to handle that SCM type.public void openConnectionInternal() throws org.apache.maven.wagon.ConnectionException
openConnectionInternal
in class org.apache.maven.wagon.AbstractWagon
org.apache.maven.wagon.ConnectionException
public boolean supportsDirectoryCopy()
supportsDirectoryCopy
in interface org.apache.maven.wagon.Wagon
supportsDirectoryCopy
in class org.apache.maven.wagon.AbstractWagon
true
AbstractWagon.supportsDirectoryCopy()
public void connect(org.apache.maven.wagon.repository.Repository repository, org.apache.maven.wagon.authentication.AuthenticationInfo authenticationInfo, org.apache.maven.wagon.proxy.ProxyInfoProvider proxyInfoProvider) throws org.apache.maven.wagon.ConnectionException, org.apache.maven.wagon.authentication.AuthenticationException
connect
in interface org.apache.maven.wagon.Wagon
connect
in class org.apache.maven.wagon.AbstractWagon
org.apache.maven.wagon.ConnectionException
org.apache.maven.wagon.authentication.AuthenticationException
AbstractWagon.connect(org.apache.maven.wagon.repository.Repository,
org.apache.maven.wagon.authentication.AuthenticationInfo,
org.apache.maven.wagon.proxy.ProxyInfoProvider)
public void put(File source, String destination) throws org.apache.maven.wagon.TransferFailedException
org.apache.maven.wagon.TransferFailedException
Wagon.put(java.io.File, java.lang.String)
public void putDirectory(File sourceDirectory, String destinationDirectory) throws org.apache.maven.wagon.TransferFailedException, org.apache.maven.wagon.ResourceDoesNotExistException, org.apache.maven.wagon.authorization.AuthorizationException
putDirectory
in interface org.apache.maven.wagon.Wagon
putDirectory
in class org.apache.maven.wagon.AbstractWagon
org.apache.maven.wagon.TransferFailedException
org.apache.maven.wagon.ResourceDoesNotExistException
org.apache.maven.wagon.authorization.AuthorizationException
AbstractWagon.putDirectory(java.io.File, java.lang.String)
public void closeConnection() throws org.apache.maven.wagon.ConnectionException
closeConnection
in class org.apache.maven.wagon.AbstractWagon
org.apache.maven.wagon.ConnectionException
AbstractWagon.closeConnection()
public boolean getIfNewer(String resourceName, File destination, long timestamp) throws org.apache.maven.wagon.TransferFailedException, org.apache.maven.wagon.ResourceDoesNotExistException, org.apache.maven.wagon.authorization.AuthorizationException
org.apache.maven.wagon.TransferFailedException
org.apache.maven.wagon.ResourceDoesNotExistException
org.apache.maven.wagon.authorization.AuthorizationException
Wagon.getIfNewer(java.lang.String,java.io.File,
long)
public void get(String resourceName, File destination) throws org.apache.maven.wagon.TransferFailedException, org.apache.maven.wagon.ResourceDoesNotExistException, org.apache.maven.wagon.authorization.AuthorizationException
org.apache.maven.wagon.TransferFailedException
org.apache.maven.wagon.ResourceDoesNotExistException
org.apache.maven.wagon.authorization.AuthorizationException
Wagon.get(java.lang.String, java.io.File)
public List<String> getFileList(String resourcePath) throws org.apache.maven.wagon.TransferFailedException, org.apache.maven.wagon.ResourceDoesNotExistException, org.apache.maven.wagon.authorization.AuthorizationException
getFileList
in interface org.apache.maven.wagon.Wagon
getFileList
in class org.apache.maven.wagon.AbstractWagon
resourcePath
- the resource path.org.apache.maven.wagon.TransferFailedException
org.apache.maven.wagon.ResourceDoesNotExistException
org.apache.maven.wagon.authorization.AuthorizationException
AbstractWagon.getFileList(java.lang.String)
public boolean resourceExists(String resourceName) throws org.apache.maven.wagon.TransferFailedException, org.apache.maven.wagon.authorization.AuthorizationException
resourceExists
in interface org.apache.maven.wagon.Wagon
resourceExists
in class org.apache.maven.wagon.AbstractWagon
org.apache.maven.wagon.TransferFailedException
org.apache.maven.wagon.authorization.AuthorizationException
AbstractWagon.resourceExists(java.lang.String)
protected org.apache.maven.scm.ScmResult executeCommand(org.apache.maven.scm.provider.git.gitexe.GitExeScmProvider scmProvider, org.apache.maven.scm.provider.git.command.GitCommand command, org.apache.maven.scm.provider.ScmProviderRepository repository, org.apache.maven.scm.ScmFileSet fileSet, org.apache.maven.scm.CommandParameters parameters) throws org.apache.maven.scm.ScmException
scmProvider
- the SCM provider.command
- the command.repository
- the SCM repository.fileSet
- the file set.parameters
- any parameters to the command.org.apache.maven.scm.ScmException
Copyright © 2010–2014 kathrynhuxtable.org. All rights reserved.