IComponentsRepository
, ISynchronizer
public class GitComponentRepositoryImpl extends com.zfabrik.components.provider.fs.AbstractFileSystemComponentRepository
AbstractFileSystemComponentRepository
The Git CR clones the source repo (i.e. the one defined by gitcr.path
) into the z2-repo cache.
On sync the cloned repo fetches all changes from the source repo, so that git does all the ugly stuff :-)
Known GitCR properties:
gitcr.uri | The URI to the source repo. Can be an absolute path, a local path relative to bin, or a remote URL |
gitcr.priority or gitcr.prio | The priority of the repository |
gitcr.branch | The branch to clone. Defaults to the active branch of the source repository |
gitcr.ref | A ref to check out as active content.
This can be a tag (refs/tags/<tag name> ), a commit (some SHA, e.g. a9c96be455a40b35ee3cd33c8de07b4de87a6240 ),
or a remote (refs/remotes/origin/master or shortened to origin/master ). In practice this can be anything used for the JGit check out command (omitting the branch creation part) which
is very similar to what may be used in the git checkout command (omitting anything beyond checkout, such as branch creation). Use this option, if you need more
control then given by gitcr.branch . Note that the latter will be used with preference and hence needs to be omitted, if you want to use gitcr.ref . |
gitcr.roots | Comma-separated list of paths relative to the repo root to search for modules. Can be left empty for the default, which is searching from the root |
AbstractExtComponentRepository.Repo, AbstractExtComponentRepository.RepoMBean
Modifier and Type | Field | Description |
---|---|---|
static java.lang.String |
GITCR_BRANCH |
Branch to clone from the source repository.
|
static java.lang.String |
GITCR_OPTIONAL |
If set to 'true', the gitcr will be ignore silently if the defined gitcr.uri is invalid.
|
static java.lang.String |
GITCR_PRIO |
|
static java.lang.String |
GITCR_PRIORITY |
Priority of the repository within the repository chain.
|
static java.lang.String |
GITCR_PWD |
Password for authentication at the repository
|
static java.lang.String |
GITCR_REF |
A ref to check out as active content.
|
static java.lang.String |
GITCR_ROOTS |
A comma separated list of folders in the repo to search for components.
|
static java.lang.String |
GITCR_TIMEOUT |
network timeout-value in seconds.
|
static java.lang.String |
GITCR_URI |
URI of the git source repository.
|
static java.lang.String |
GITCR_USER |
User name for authentication at the repository
|
ALL
COMPONENT_REPO_IMPLEMENTATION, COMPONENT_REPO_MODE, COMPONENT_REPO_MODE_RELAXED, COMPONENT_REPO_MODE_STRICT
PRIO, TYPE
Constructor | Description |
---|---|
GitComponentRepositoryImpl(java.lang.String name,
java.util.Properties props) |
Modifier and Type | Method | Description |
---|---|---|
protected java.util.Properties |
getExpectedConfiguration() |
provided expected repository configuration.
|
java.lang.String |
getLabel() |
|
java.io.File |
getLocalRepo() |
|
com.zfabrik.components.provider.fs.MultiRootFSComponentRepositoryDB |
scan(com.zfabrik.components.provider.fs.MultiRootFSComponentRepositoryDB current) |
Scans for changes in this GitCR which implies:
if
current is null the source repository will be cloned into the repository cache
if the repository |
java.lang.String |
toString() |
as, checkOfflineMode, complete, configure, configure, configure, findComponents, findComponents, getCacheRoot, getComponent, getComponent, getContext, getDB, getModules, getModules, getName, getRevision, getRevision, getRevision, getURL, has, isRelaxedMode, preInvalidation, preInvalidation, retrieve, retrieve, setEvictionDelay, start, stop, test_setContext, test_setDb, test_setInited
download, getRoots, setRoots
public static final java.lang.String GITCR_ROOTS
public static final java.lang.String GITCR_URI
public static final java.lang.String GITCR_PRIORITY
IComponentsRepository
.
Both gitcr.priority and gitcr.prio are valid keys.public static final java.lang.String GITCR_PRIO
public static final java.lang.String GITCR_BRANCH
GITCR_REF
with the branch name prefixed by refs/remotes/origin/
.public static final java.lang.String GITCR_REF
refs/tags/<tag name>
),
a commit (some SHA, e.g. a9c96be455a40b35ee3cd33c8de07b4de87a6240
),
or a remote (refs/remotes/origin/master
or shortened to origin/master
).
In practice this can be anything used for the JGit check out command (omitting the branch creation part) which is very similar to what may be used
in the git checkout
command (omitting anything beyond checkout, such as branch creation). Use this option, if you need more
control then given by gitcr.branch
. Note that the latter will be used with preference and hence needs to be omitted, if you want to use gitcr.ref
.public static final java.lang.String GITCR_USER
public static final java.lang.String GITCR_PWD
public static final java.lang.String GITCR_OPTIONAL
public static final java.lang.String GITCR_TIMEOUT
public GitComponentRepositoryImpl(java.lang.String name, java.util.Properties props)
protected java.util.Properties getExpectedConfiguration()
com.zfabrik.components.provider.util.AbstractExtComponentRepository
FSComponentRepositoryHelper
to make a decision on whether the repository
cache is still valid. Any change in repository configuration between repository
initialization will be taken as reason to completely purge the local repository.
By default this method returns the complete repository configuration.public com.zfabrik.components.provider.fs.MultiRootFSComponentRepositoryDB scan(com.zfabrik.components.provider.fs.MultiRootFSComponentRepositoryDB current)
current
is null
the source repository will be cloned into the repository cachescan
in class com.zfabrik.components.provider.fs.AbstractFileSystemComponentRepository
public java.io.File getLocalRepo()
public java.lang.String toString()
toString
in class com.zfabrik.components.provider.fs.AbstractFileSystemComponentRepository
public java.lang.String getLabel()