mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-05-27 14:15:26 +00:00
@@ -26,6 +26,13 @@ variable `GITBLIT_INITIAL_REPO`, such as
|
|||||||
|
|
||||||
-e GITBLIT_INITIAL_REPO=default
|
-e GITBLIT_INITIAL_REPO=default
|
||||||
|
|
||||||
|
## Create repositories with content
|
||||||
|
|
||||||
|
In addition to the approach above, you can push repostories with existing
|
||||||
|
content by attaching them to sub-directories of `/repos`, such as
|
||||||
|
|
||||||
|
docker run -v $HOME/git/example:/repos/example ...
|
||||||
|
|
||||||
## Custom configuration
|
## Custom configuration
|
||||||
|
|
||||||
You can add or override any of the `*.properties` files for configuring GitBlit,
|
You can add or override any of the `*.properties` files for configuring GitBlit,
|
||||||
|
|||||||
+32
-14
@@ -18,18 +18,8 @@ APPLYING configuration file $p
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
create_initial_repo() {
|
create_repo() {
|
||||||
if [ -d $GITBLIT_INITIAL_REPO ]; then
|
local repo_dir=$GITBLIT_BASE_FOLDER/git/$1.git
|
||||||
return
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "
|
|
||||||
CREATING initial repository '$GITBLIT_INITIAL_REPO' with:
|
|
||||||
* read/clone access for all
|
|
||||||
* push access for authenticated users
|
|
||||||
"
|
|
||||||
|
|
||||||
local repo_dir=$GITBLIT_BASE_FOLDER/git/${GITBLIT_INITIAL_REPO}.git
|
|
||||||
mkdir -p $repo_dir
|
mkdir -p $repo_dir
|
||||||
cd $repo_dir
|
cd $repo_dir
|
||||||
|
|
||||||
@@ -60,7 +50,34 @@ CREATING initial repository '$GITBLIT_INITIAL_REPO' with:
|
|||||||
|
|
||||||
git config --replace-all core.logallrefupdates false
|
git config --replace-all core.logallrefupdates false
|
||||||
|
|
||||||
cd $GITBLIT_PATH
|
echo "
|
||||||
|
CREATING repository '$1' with:
|
||||||
|
* read/clone access for all
|
||||||
|
* push access for authenticated users"
|
||||||
|
|
||||||
|
RET="file://$repo_dir"
|
||||||
|
}
|
||||||
|
|
||||||
|
apply_repos() {
|
||||||
|
for rdir in /repos/*; do
|
||||||
|
if [ -d $rdir/.git ]; then
|
||||||
|
r=$(basename $rdir)
|
||||||
|
create_repo $r
|
||||||
|
local url=$RET
|
||||||
|
cd $rdir
|
||||||
|
echo "* pushed existing content"
|
||||||
|
git push --all $url
|
||||||
|
fi
|
||||||
|
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
create_initial_repo() {
|
||||||
|
if [ -d $GITBLIT_INITIAL_REPO ]; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
create_repo $GITBLIT_INITIAL_REPO
|
||||||
}
|
}
|
||||||
|
|
||||||
shopt -s nullglob
|
shopt -s nullglob
|
||||||
@@ -73,8 +90,9 @@ fi
|
|||||||
if [[ -n $GITBLIT_INITIAL_REPO ]]; then
|
if [[ -n $GITBLIT_INITIAL_REPO ]]; then
|
||||||
create_initial_repo
|
create_initial_repo
|
||||||
fi
|
fi
|
||||||
|
apply_repos
|
||||||
|
|
||||||
|
cd $GITBLIT_PATH
|
||||||
$JAVA_HOME/bin/java -jar $GITBLIT_PATH/gitblit.jar \
|
$JAVA_HOME/bin/java -jar $GITBLIT_PATH/gitblit.jar \
|
||||||
--httpsPort $GITBLIT_HTTPS_PORT --httpPort $GITBLIT_HTTP_PORT \
|
--httpsPort $GITBLIT_HTTPS_PORT --httpPort $GITBLIT_HTTP_PORT \
|
||||||
--baseFolder $GITBLIT_BASE_FOLDER
|
--baseFolder $GITBLIT_BASE_FOLDER
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user