ユーザ用ツール

サイト用ツール


git:gitbucket

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン前のリビジョン
次のリビジョン
前のリビジョン
git:gitbucket [2015/05/18 06:12] clownclowngit:gitbucket [2025/02/16 13:53] (現在) – 外部編集 127.0.0.1
行 22: 行 22:
  
 webappsディレクトリにgitbucket(warファイル)をDLします。 webappsディレクトリにgitbucket(warファイル)をDLします。
 +
 +the release page:https://github.com/gitbucket/gitbucket/releases/
 <code> <code>
 # cd /var/lib/tomcat7/webapps/ # cd /var/lib/tomcat7/webapps/
-# wget https://github.com/takezoe/gitbucket/releases/download/3.2/gitbucket.war+# wget https://github.com/gitbucket/gitbucket/releases/download/3.10.1/gitbucket.war
 </code> </code>
 +
 +==== gitbucket-gist-plugin ====
 +
 +the release page:https://github.com/gitbucket/gitbucket-gist-plugin/releases
 +
 +<code>
 +# mkdir -p /home/tomcat/.gitbucket/plugins
 +# cd /home/tomcat/.gitbucket/plugins/
 +# wget https://github.com/gitbucket/gitbucket-gist-plugin/releases/download/3.10.0/gitbucket-gist-plugin_2.11-3.10.0.jar
 +# chown -R tomcat:tomcat /home/tomcat/.gitbucket/plugins
 +</code>
 +
 +==== configure & start ====
 +
 apacheと連携するために、httpの8080ポートはコメントアウトして、ajpポートを8009→8089に変更します。 apacheと連携するために、httpの8080ポートはコメントアウトして、ajpポートを8009→8089に変更します。
 ※ajpポートの変更は、セットアップした環境の他のサービスと重複しているため。 ※ajpポートの変更は、セットアップした環境の他のサービスと重複しているため。
行 32: 行 48:
 # vi /etc/tomcat7/server.xml # vi /etc/tomcat7/server.xml
  
-70d69 +92c92
-<     <!-- +
-74d72 +
-<     --> +
-94d91 +
-<     <!-- +
-96,97d92 +
-<     -->+
 <     <Connector port="8089" protocol="AJP/1.3" redirectPort="8443" /> <     <Connector port="8089" protocol="AJP/1.3" redirectPort="8443" />
 +---
 +>     <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
 </code> </code>
 apacheのconfファイルを作成します。 apacheのconfファイルを作成します。
行 58: 行 69:
 http://SERVER/gitbucket/ http://SERVER/gitbucket/
 root / root root / root
 +
 +==== ユーザ設定 ====
 +
 +SSHキーを作成する。
 +<code>
 +# ssh-keygen                                                          
 +Generating public/private rsa key pair.
 +Enter file in which to save the key (/root/.ssh/id_rsa): 
 +Created directory '/root/.ssh'.
 +Enter passphrase (empty for no passphrase): ←何も入力せずにEnter
 +Enter same passphrase again: ←何も入力せずにEnter
 +Your identification has been saved in /root/.ssh/id_rsa.
 +Your public key has been saved in /root/.ssh/id_rsa.pub.
 +The key fingerprint is:
 +15:d8:0b:a9:d0:79:31:ff:7d:0d:8b:72:8c:33:51:22 root@localhost.localdomain
 +The key's randomart image is:
 ++--[ RSA 2048]----+
 +|     . .E=o .    |
 +|    . o =+.+     |
 +|     . o .+.  .  |
 +|      .  ..= o o.|
 +|        S = = o o|
 +|             . |
 +|                 |
 +|                 |
 +|                 |
 ++-----------------+
 +</code>
 +作成したSSHキーを確認する。
 +<code>
 +# cat .ssh/id_rsa.pub 
 +ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAA ~省略~ cfapXHhBTa38zp50vS546sC+JB8vBXjG1Q== root@localhost.localdomain
 +</code>
 +GitBucketにログインする
 +右上のAccount Settings(人の影)をクリック
 +左のメニューからSSH Keysをクリック
 +Add an SSH KeyのTitleは適当、Keyは作成したSSHキーを張り付ける。
 +以後のgitの操作はSSH接続で行う。
 +任意のリポジトリを開き、右の「HTTP clone URL」の項目でSSHをクリックすると、SSH接続のURLが表示されます。
  
 ===== Tips ===== ===== Tips =====
行 114: 行 164:
   * jennkinsの「シェルの実行」に定義<code>   * jennkinsの「シェルの実行」に定義<code>
 sudo tar zcf /var/backup/gitbucket-`date +%Y%m%d%H%M%S`.tar.gz /home/tomcat/.gitbucket sudo tar zcf /var/backup/gitbucket-`date +%Y%m%d%H%M%S`.tar.gz /home/tomcat/.gitbucket
 +</code>
 +
 +==== リストア ====
 +適当な場所で解凍して、オリジナルの場所に設置・上書きします。
 +<code>
 +# mkdir /tmp/_backup
 +# chmod 777 /tmp/_backup
 +# cd  /tmp/_backup
 +
 +[_backup]# tar xzvf gitbucket-20150608093100.tar.gz 
 +
 +[_backup]# /etc/init.d/tomcat7 stop
 +[_backup]# \cp -ar /tmp/_backup/home/tomcat/.gitbucket /home/tomcat/
 +[_backup]# /etc/init.d/tomcat7 start
 +[_backup]# /etc/init.d/httpd restart
 +</code>
 +
 +==== バージョンアップ ====
 +https://github.com/takezoe/gitbucket/releases
 +<code>
 +# wget -O gitbucket.war https://github.com/takezoe/gitbucket/releases/download/3.3/gitbucket.war
 +
 +# /etc/init.d/tomcat7 stop
 +
 +# mkdir -p /var/backup/
 +# tar zcf /var/backup/home_gitbucket-`cat /home/tomcat/.gitbucket/version`.tar.gz /home/tomcat/.gitbucket
 +# tar zcf /var/backup/webapps_gitbucket-`cat /home/tomcat/.gitbucket/version`.tar.gz /var/lib/tomcat7/webapps/gitbucket
 +# cp /var/lib/tomcat7/webapps/gitbucket.war /var/backup/gitbucket-`cat /home/tomcat/.gitbucket/version`.war
 +
 +# rm -f /var/lib/tomcat7/webapps/gitbucket.war
 +# rm -rf /var/lib/tomcat7/webapps/gitbucket
 +# rm -rf /var/cache/tomcat7/work/Catalina/localhost/gitbucket/*
 +# cp ./gitbucket.war /var/lib/tomcat7/webapps/
 +
 +# /etc/init.d/tomcat7 start
 +# /etc/init.d/httpd restart
 </code> </code>
git/gitbucket.1431929527.txt.gz · 最終更新: 2025/02/16 13:50 (外部編集)