動作環境:
Redmineの:4.0.4
Gitのリポジトリ:Gitbilt V1.8.0
必要があります。
- Redmineのインストールと実行
- すでにインストールRedmineのを実行しているホストの中に
Git
、あなたはgitのコマンドラインコマンドを実行する必要があるため
私はRedmineののbitnamiのVirtualboxのバージョンを実行しています。アドレスは次のとおりです。BitNami Redmineの
ブートが完了した後に仮想マシンを起動した後、そこになります
- アクセスアドレス
- Redmineのデフォルトのログインユーザー名とパスワード、Redmineのデフォルトのログインパスワードは、MySQLで
root
ユーザパスワードがMySQLの資格を取得します - コンソール(SSH)デフォルトのユーザー名とパスワードへのアクセス
注:あなたが実行している場合はifconfig
、コマンドプロンプトifconfig
見つけることができないコマンドを、あなたが実行してみてくださいすることができますsudo ifconfig
私はそれがインストールされていないと思うようになったnet-tools
、コマンドを試してみてくださいsudo apt install net-tools
プロンプトがインストールされているインストールします。
仮想マシンは公式チュートリアルでデフォルトのSSHログインでは無効になってSSHサーバーを有効または無効にします
Debianの
sudo rm -f /etc/ssh/sshd_not_to_be_run
sudo systemctl enable ssh
sudo systemctl start ssh
地元の倉庫にコピーされます
bitnami@debian:~$ cd ~
bitnami@debian:~$ mkdir gitrepos
bitnami@debian:~$ sudo chown -R www-data:www-data gitrepos
bitnami@debian:~$ sudo chmod -R a+rwx gitrepos
bitnami@debian:~$ cd gitrepos
bitnami@debian:~/gitrepos$ sudo -u www-data -H git clone --mirror git://192.168.1.142/test.git test
Gitの対応する項目が(OHローカルにダウンロードされていないソースコード)ローカルにミラーリングされ
Readmine設定
- 閲覧Gitは提供されています
- プロジェクトのリポジトリへの新しいです
修正:ライブラリパスの終わりではありません.git
ので、上記の別名では、すでに使用されていますtest
通常の表示ソースかどうかをチェックします
我々は、チャートから見たソースコードを表示し、成功した歴史を提出することができます。スタートが空の倉庫であれば、それは「ディレクトリ内のエントリがありませんかファイル」に似促すことができます
- タイミングタスクタイミングプル倉庫を使用してLinux
次のようなシェルファイル、作成しgit_repo_test.sh
たコンテンツを
#!/bin/bash
cd /home/bitnami/gitrepos/test && sudo -u www-data -H git fetch
保存した後、スクリプトが正常に実行実行しようと、
次のステップは、5分ごとにこのスクリプトを実行するタイミングされます
crontab -e
在打开的crontab 编辑文件中添加
*/5 * * * * cd /home/bitnami/gitrepos/test && sudo -u www-data -H git fetch
编辑完之后,重启 cron 服务
sudo service cron restart
最后在 Redmine中,看到 仓库的更新记录,如果有新提到远程仓库,5分钟之后,会通过定时任务自动拉取提交的记录
其它 Redmine和GitBilt 集成
- 在管理,版本库,开启 Web Service,并生成key 和 对Readmine的通知
跟踪标签 | 用于解决问题的关键字 | 应用后的状态 | % 完成 |
---|---|---|---|
全部 | fixes,fixed | Resolved | 80% |
全部 | closes,closed | Closed | 100% |
全部 | developing,doing | In Progress | 20% |
开启 Readmine的API
API选项卡 里面的两个都勾选修改Gitbilt 配置文件
修改 Gitbilt 文件夹下data
的 gitblit.properties
文件
在文件夹中,添加
groovy.customFields = "redmineProject=Redmine Project Identifier"
最后我的gitblit.properties
的内容是:
#
# GITBLIT.PROPERTIES
#
# Define your custom settings in this file and/or include settings defined in
# other properties files.
#
# Include Gitblit's 'defaults.properties' within your configuration.
#
# NOTE: Gitblit will not automatically reload "included" properties. Gitblit
# only watches the 'gitblit.properties' file for modifications.
#
# Paths may be relative to the ${baseFolder} or they may be absolute.
#
# COMMA-DELIMITED
# SINCE 1.7.0
include = defaults.properties
groovy.customFields = "redmineProject=Redmine Project Identifier"
#
# Define your overrides or custom settings below
#
#git.repositoriesFolder=E:\devops\gitblit\repos
server.httpPort=10101
server.httpBindInterface=0.0.0.0
#tickets.service = com.gitblit.tickets.FileTicketService
#tickets.acceptNewTickets = true
- 修改 GitBilt 的
redmine-fetch.groovy
文件
修改 GitBilt 安装文件夹下,修改data/groovy
文件夹下的 redmine-fetch.groovy
文件,修改 redmineURL
和apiKey
2个变量的值,修改的值如下:
/*
* This script triggers automatic repo fetches in Redmine upon pushes.
* It won't work out-of-box, you need to configure a few things.
*
* Redmine
* - Go to Administration / Settings / Repositories, and make sure that the
* "Enable WS for repository management" option is checked. Also generate an
* API key and take note of it.
* - Open a project page, go to Settings / Repositories and add a repo. Take
* note of the Identifier.
*
* Gitblit
* - Set the redmineProject custom field in gitblit.properties, e.g.
* groovy.customFields = "redmineProject=Redmine Project Identifier"
* - Edit the repo you added to Redmine, go to hook scripts and add this script
* to the post-receive hooks. Also specify the Redmine project's identifier
* under custom fields.
*
* Troubleshooting
* - run Gitblit interactively and check its console output
* - on the Redmine server, tail -f log/access.log
*
* If you want your repos to work with multiple Redmine projects, you don't need
* to add the repos to all of them. Instead, add the repo to a single project,
* then go to Administration / Settings / Repositories and enable the "Allow
* issues of all the other projects to be referenced and fixed" option.
*/
/* specify the URL of your Redmine instance here */
def redmineURL = "http://192.168.1.114/"
/* specify the API key you generated in Redmine Administration here */
def apiKey = "R15mHY73KaTzUpCDmOYr"
/*
* construct the URL from global and repo properties, for more info refer to
* http://www.redmine.org/projects/redmine/wiki/RedmineSettings#Fetch-commits-automatically
*/
def triggerURL = redmineURL + "sys/fetch_changesets?id=" + repository.customFields.redmineProject + "&key=" + apiKey
/* log the action */
logger.info("Redmine Fetch hook triggered by ${user.username} for ${repository.name}: GET ${triggerURL}")
/* send the HTTP GET query */
new URL(triggerURL).getContent()
修改完之后,重启启动GitBilt
下一步,在 版本库列表,进入仓库 test
详情页,点击右上角的 "编辑"按钮
进入编辑页面之后,选择receive
选项卡,进入Receive 设置
页面
最后 给 test
仓库推送提交,GitBilt的命令窗口显示,请求Redmine的Api地址成功
bitnami redmine 程序的命令备忘
sh /opt/redmine-3.4.4-1/ctlscript.sh restart
sh /opt/redmine-3.4.4-1/ctlscript.sh restart mysql
/opt/redmine-3.4.4-1/ruby/bin/bundle install --path vendor/bundle
sudo /opt/redmine-3.4.4-1/mysql/bin/mysqld_safe --pid-file=/opt/redmine-3.4.4-1/mysql/data/mysqld.pid --datadir=/opt/redmine-3.4.4-1/mysql/data --init-file=/home/test/mysql-init 2> /dev/null &
/opt/redmine-3.4.4-1/mysql/bin/mysqldump -A -u root -p > backup.sql
References
- Debian9 ifconfig命令找不到解决办法 学习到
ifconfig
命令是属于nettools
软件的 - redmine集成git
- redmine整合gitlab版本库 学习到给仓库存放文件夹的拥有者为apache用户和分配权限,最后 定时任务 更新仓库成功啦
- Hook redmine git repository via gitblit 我安装使用的Redmine已经有自带
redmine-fetch.groovy
文件,所以不需要按文章中介绍的编辑 groovy文件 - RedmineとGitLabの連携。PushでチケットのStatusを変更 gitlab 和 redmine 整合
- redmine edit issue description
- redmine roles wiki
- redmine gitlab 整合
- Visibility level visibilitylevel|public is not allowed in a visibilitylevel|private group.
- GitLabとRedmineを連携してみるの巻
- Create And Restore Application Backups redmine创建和还原应用程序备份