Gitbucket on AS1004T

A Git platform powered by Scala with easy installation, high extensibility & GitHub API compatibility.

Default login with: root/root

Moderator: Lillian.W@AST

Post Reply
maddoxik
Posts: 4
youtube meble na wymiar Warszawa
Joined: Fri Aug 09, 2019 2:46 pm

Gitbucket on AS1004T

Post by maddoxik »

Hello,

first, thanks a lot for this working on AS1004T!

I have two comments here:
1) Gitbucket require at least MariaDB 10.2 but 10.0.28 is available on AS1004T. I didn't find way to have gitbucket with buildin MariaDB working.
2) I fixed /usr/local/AppCentral/gitbucket/CONTROL/start-stop.sh script for proper stopping the service:

Code: Select all

#!/bin/sh                                                                                                                                                                                                                                     
                                                                                                                                                                                                                                              
# set locale                                                                                                                                                                                                                                  
export LC_CTYPE=C                                                                                                                                                                                                                             
                                                                                                                                                                                                                                              
# set Gitbucket Server installation path                                                                                                                                                                                                      
export GITBUCKET_SERVER_ROOT="/usr/local/AppCentral/gitbucket"                                                                                                                                                                                
                                                                                                                                                                                                                                              
export GITBUCKET_SERVER_MAX_STACK_SIZE=3000                                                                                                                                                                                                   
                                                                                                                                                                                                                                              
# set Gitbucket Server lib path                                                                                                                                                                                                               
export LD_LIBRARY_PATH="$GITBUCKET_SERVER_ROOT/lib"                                                                                                                                                                                           
                                                                                                                                                                                                                                              
# set Gitbucket Server pid file path                                                                                                                                                                                                          
export GITBUCKET_PID_PATH="/var/run/gitbucket/gitbucket.pid"                                                                                                                                                                                  
export GITBUCKET_RUN_PATH="/var/run/gitbucket"                                                                                                                                                                                                
                                                                                                                                                                                                                                              
# set Gitbucket Server temp directory path for transcodes                                                                                                                                                                                     
export GITBUCKET_SERVER_TMPDIR=/tmp                                                                                                                                                                                                           
export TMPDIR=$GITBUCKET_SERVER_TMPDIR                                                                                                                                                                                                        
                                                                                                                                                                                                                                              
# set identification variables                                                                                                                                                                                                                
export GITBUCKET_SERVER_INFO_VENDOR=ASUSTOR                                                                                                                                                                                                   
export GITBUCKET_SERVER_INFO_DEVICE="$(cat /etc/nas.conf|awk '/Model\s/{print $3}')"                                                                                                                                                          
export GITBUCKET_SERVER_INFO_MODEL="$(uname -m)"                                                                                                                                                                                              
export GITBUCKET_SERVER_INFO_PLATFORM_VERSION="ADM $(cat /etc/nas.conf|awk '/Version/{print $3}')"                                                                                                                                            
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
do_start() {                                                                                                                                                                                                                                  
        if [ ! -d "$GITBUCKET_RUN_PATH" ]; then                                                                                                                                                                                               
                mkdir -p "$GITBUCKET_RUN_PATH"                                                                                                                                                                                                
        fi                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                              
        if [ -f "$GITBUCKET_PID_PATH" ]; then                                                                                                                                                                                                 
                echo "gitbucket already running. Exit."                                                                                                                                                                                       
                return 1                                                                                                                                                                                                                      
        fi                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                              
        ulimit -s $GITBUCKET_SERVER_MAX_STACK_SIZE                                                                                                                                                                                            
                                                                                                                                                                                                                                              
        cd $GITBUCKET_SERVER_ROOT                                                                                                                                                                                                             
        java -jar ./bin/gitbucket.war &                                                                                                                                                                                                       
        echo $! > $GITBUCKET_PID_PATH                                                                                                                                                                                                         
        return 0                                                                                                                                                                                                                              
}                                                                                                                                                                                                                                             
                                                                   
do_stop() {                                                                                                                                                                                                                                   
        # Kill Gitbucket.                                                                                                                                                                                                                     
        if [ -f "$GITBUCKET_PID_PATH" ]; then                                                                                                                                                                                                 
                kill $(cat "$GITBUCKET_PID_PATH")                                                                                                                                                                                             
        fi                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                              
        if [ -f "$GITBUCKET_PID_PATH" ]; then                                                                                                                                                                                                 
                rm $GITBUCKET_PID_PATH                                                                                                                                                                                                        
        fi                                                                                                                                                                                                                                    
        return 0                                                                                                                                                                                                                              
}                                                                                                                                                                                                                                             
                                                                                                                                                                                                                                              
do_restart() {                                                                                                                                                                                                                                
        do_stop                                                                                                                                                                                                                               
        do_start                                                                                                                                                                                                                              
}                                                                                                                                                                                                                                             
                                                                                                                                                                                                                                              
do_status() {                                                                                                                                                                                                                                 
        if [ ! -f "$GITBUCKET_PID_PATH" ]; then                                                                                                                                                                                               
                echo "Status: STOPPED"                                                                                                                                                                                                        
                return 0                                                                                                                                                                                                                      
        fi                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                              
        PID=`cat $GITBUCKET_PID_PATH`                                                                                                                                                                                                         
        running=`ps | grep $PID | grep java | cut -f 2 -d " "`                                                                                                                                                                                
        if [ "$running" != "" ]; then                                                                                                                                                                                                         
                echo "Status: RUNNING, PID: $PID"                                                                                                                                                                                             
        else                                                                                                                                                                                                                                  
                echo "Status: UNKNOWN"                                                                                                                                                                                                        
        fi                                                                                                                                                                                                                                    
}                                                                                                                                                                                                                                             
                                                                                                                                                                                                                                              
case "$1" in                                                                                                                                                                                                                                  
  start)                                                                                                                                                                                                                                      
    do_start                                                                                                                                                                                                                                  
  ;;                                                                                                                                                                                                                                          
                                                                                                                                                                                                                                              
  stop)                                                                                                                                                                                                                                       
    do_stop                                                                                                                                                                                                                                   
  ;;                                                                                                                                                                                                                                          
                                                                                                                                                                                                                                              
  restart)                                                                                                                                                                                                                                    
    do_restart                                                                                                                                                                                                                                
  ;;                                                                                                                                                                                                                                          
                                                                                                                                                                                                                                              
  status)                                                                                                                                                                                                                                     
    do_status                                                                                                                                                                                                                                 
  ;;                                                                                                                                                                                                                                          
esac                                                                                                                                                                                                                                          
exit 0
maddoxik
Posts: 4
Joined: Fri Aug 09, 2019 2:46 pm

Re: Gitbucket on AS1004T

Post by maddoxik »

Just one more thing. I moved data to second volume (RAID) to have data a bit more secured:-)
So, for that I had to create Shared folder on second volume, move existing data (/root/.gitbucket/) to new folder and added new variable into start-stop.sh script:

Code: Select all

export $GITBUCKET_HOME=/volume2/gitbucket
and restart the service.

Not sure if this is somehow possible to implement into the package...
Post Reply

Return to “Gitbucket”