如何在Ubuntu 20.04/18.04 LTS上安装GitCrum

时间:2020-02-23 14:44:39  来源:igfitidea点击:

在本教程中,我们将介绍在Ubuntu 20.04/18.04上安装Gitcrum Agile Project Management Tool的步骤。
GitCrum是一个开发的开源软件,用于帮助开发团队使用Git和Scrum进行任务管理,让他们更加灵活。
GitCrum可以与Gitlab,GitHub或者Bitbucket版本管理平台集成。

在Ubuntu 20.04/18.04 LTS上安装GitCrum

以下是GitCrum Agile Project Management ToolNginx或者Apache Web ServerMysQL的依赖关系,或者Mariadb Database ServerPHP> = 7.1

为Ubuntu 20.04/18.04上安装GitCrum提供的步骤也将涵盖依赖性安装。

第1步:安装MySQL/MariaDB数据库服务器

GitCrum将其数据存储在关系数据库服务器中。
这可以是mysql或者mariadb。
根据选择,使用下面的任何引导件设置数据库服务器。

sudo apt install mariadb-server mariadb-client

安装数据库服务器后,请登录MySQL控制台以创建GitCrum的数据库:

$sudo mysql -u root -p
CREATE USER 'gitscrum'@'localhost' IDENTIFIED BY 'StrongPassword';
CREATE DATABASE gitscrum;
GRANT ALL ON gitscrum.* TO 'gitscrum'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;
QUIT

测试连接到数据库

$mysql  -u gitscrum -p
Enter password: <ENTER PASSWORD>
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 10
Server version: 10.3.11-MariaDB-1:10.3.11+maria~bionic-log mariadb.org binary distribution
Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> SHOW DATABASES;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| gitscrum            |
+--------------------+
2 rows in set (0.001 sec)
MariaDB [(none)]> QUIT

第2步:安装PHP和所需的PHP扩展

GitCrum所需的PHP版本是版本7.1或者更高版本,由ubuntu 18.04默认存储库上的PHP满足。

sudo apt install -y php php-cli php-mysql php-zip php-json php-gd php-mbstring php-curl php-xml php-pear php-bcmath php-pdo openssl

第3步:安装Apache2 Web服务器

既然我们已安装数据库和PHP,剩余的依赖项是Apache2 Web服务器。
运行以下命令以在Ubuntu上安装Apache2.

sudo apt -y install apache2 libapache2-mod-php unzip vim

第4步:下载Laravel Gitcrum

安装Composer PHP依赖关系管理器。

sudo apt -y install composer

创建Composer软件包:

cd /srv
composer create-project gitscrum-community-edition/laravel-gitscrum --stability=stable --keep-vcs
cd laravel-gitscrum

成功消息应该如下看:

Generating autoload files
> Illuminate\Foundation\ComposerScripts::postInstall
> php artisan optimize
Generating optimized class loader
The compiled class file has been removed.
> php artisan key:generate
Application key [base64:07Uryjh3cYE/PZV4XgLJFmGqFYMjrQ/lGMCpEE5o8yY=] set successfully.

github克隆gitcrum代码:

git clone https://github.com/GitScrum-Community/laravel-gitscrum.git
cd laravel-gitscrum
composer update
composer run-script post-root-package-install

示例

................
Writing lock file
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover
Discovered Package: laravel/socialite
Discovered Package: nesbot/carbon
Discovered Package: renatomarinho/laravel-page-speed
Discovered Package: socialiteproviders/manager
Discovered Package: spatie/laravel-fractal
Package manifest generated successfully.

第5步:配置GitCrum

现在安装了GitCrum,让我们配置它。
打开 .env文件设置数据库凭据,URL,git 等 1.配置数据库凭据

DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=gitscrum
DB_USERNAME=gitscrum
DB_PASSWORD=StrongPassword

2.设置Web URL.

APP_URL=http://gitscrum.example.com

3.配置Gitlab,GitHub或者Bitbucket

我们需要配置Git工具以与GitCrum一起使用。

配置GitHub.

对于Gitlab集成,请访问GitHub的新OAuth应用程序页面以创建新的GTihub应用程序。

Application name: gitscrum
Homepage URL: URL (Same as APP_URL at .env)
Application description: gitscrum
Authorization callback URL: http://{URL is the SAME APP_URL}/auth/provider/github/callback

抓住你的 Application ID and Secret完成后。

配置Gitlab.

访问Gitlab新应用程序以创建新的Gitlab应用程序。

name: gitscrum
Redirect URI: http://{URL is the SAME APP_URL}/auth/provider/gitlab/callback
Scopes: api and read_user

抓住你的 Application ID and Secret完成后。

配置Bitbucket.

创建一个新的Bitbucket OAuth消费者,并为其写入存储库的权限,发布等。

name: gitscrum
Callback URL: http://{URL is the SAME APP_URL}/auth/provider/bitbucket/callback
URL: http://{URL is the SAME APP_URL}
Uncheck (This is a private consumer)

完成Git应用程序创建时,编辑环境变量以设置凭据。

# For Github Credentials
GITHUB_CLIENT_ID=
GITHUB_CLIENT_SECRET=
# For Gitlab Credentials
GITLAB_KEY=
GITLAB_SECRET=
GITLAB_INSTANCE_URI=https://gitlab.com/
# For Bitbucker Credentials
BITBUCKET_CLIENT_ID=
BITBUCKET_CLIENT_SECRET=

4.我们可以选择选择代理设置。

PROXY_PORT=
PROXY_METHOD=
PROXY_SERVER=
PROXY_USER=
PROXY_PASS=

完成后保存更改并关闭文件。

第6步:为GitCrum和Configure Apache2创建数据库

通过运行创建GitCrum的数据库:

php artisan migrate

最后,运行Artisan命令。

$php artisan db:seed --class=SettingSeeder
Seeding: ConfigIssueEffortsTableSeeder
Seeding: ConfigPrioritiesTableSeeder
Seeding: IssueTypesTableSeeder
Seeding: ConfigStatusesTableSeeder

配置Apache2 VirtualHost.

启用Apache2重写模块

sudo a2enmod rewrite
sudo  systemctl restart apache2

创建GitCrum Apache VirtualHost文件

sudo vim /etc/apache2/sites-enabled/gitscrum.conf

添加

<VirtualHost *:80>
     ServerAdmin Hyman@theitroad
     DocumentRoot /srv/laravel-gitscrum/public/
     ServerName gitscrum.example.com
     ServerAlias www.gitscrum.example.com
     ErrorLog /var/log/apache2/gitscrum-error.log
     CustomLog /var/log/apache2/gitscrum-access.log combined
 
     <Directory /srv/laravel-gitscrum/public
        Options +FollowSymlinks
        AllowOverride All
        Require all granted
     </Directory>
</VirtualHost>

设置目录权限:

sudo chown -R www-data:www-data /srv/laravel-gitscrum/
sudo chmod -R 775 /srv/laravel-gitscrum/

测试配置和重新启动Apache

sudo apachectl configtest
sudo systemctl restart apache2

访问GitCrum URL以登录