Table of Contents

Middleware

GitBucket



Install

Create User

useradd gitbucket
passwd gitbucket


Create Startshell

vi /home/gitbucket/start_gitbucket.sh

chmod 700 start_gitbucket.sh
#!/bin/bash
java -jar /home/gitbucket/gitbucket.war --prefix=/gitbucket --gitbucket.home=/home/gitbucket/data


Start Service

vi /usr/lib/systemd/system/gitbucket.service
[Unit]
Description = GitBucket daemon
ConditionPathExists = /home/gitbucket

[Service]
ExecStart = /home/gitbucket/start_gitbucket.sh
Restart = always
Type = simple
User=gitbucket
Group=gitbucket

[Install]
WantedBy = multi-user.target
systemctl start gitbucket
systemctl enable gitbucket

http://x.x.x.x:8080/gitbucket


Tips:Change HomeDirectory

Linux
java -jar gitbucket.war --prefix=/gitbucket --gitbucket.home=/home/gitbucket/test
Windows
java -jar gitbucket.war --prefix=/gitbucket --gitbucket.home=D:\GitBucket