httprunner -2- Linuxでhrun(下部)を構築

序文

以前の私たちが言った、Linuxのインストールのpython3はhrunは、我々が使用する、データベースに依存する必要があるドッキングウィンドウをインストールmysql5.7をデータベース接続がアクティブになるように。インストールmysql5.7は:を参照してくださいhttps://www.cnblogs.com/gsxl/p/11747493.html

まず、準備作業

  1. インストールのpython3 PIP3の環境、mysql5.7 (上記でない場合、HAに燃料を供給し続けます)。
  2. hrunのサーバーのホームディレクトリ(カスタム)にアップロードプロジェクトパッケージ:httprunnermanger_web.zip

hrunのパッケージには、このリンクからダウンロードすることができます。リンクします。https://pan.baidu.com/s/1OdwP-ngV-nenzZbMMLcTSQ 

抽出コード:oxlx

第二に、展開を開始するhrun プロジェクトを

  1. まず、圧縮されたインストールのzip (ここでは、私がオーバーインストールされている)ソフトウェアを、次のように入力しますYUM解凍zipファイルをインストール-y

[iZbp19lugf22zbsubsf1y6Z〜@ルート]#yumを-y解凍のzipインストール
ロードプラグイン:fastestmirror
最速のミラーの決定
ベースを| 3.6 kBの午前0時00分〇 〇秒
ドッキングウィンドウ-CE-安定| 3.5 kBの午前0時00分〇 〇秒
EPEL | 5.4 kBの午前0時00分〇 〇秒
エキストラ| 2.9 kBの夜12時○○分00秒
の更新| 2.9 kBの夜12時○○分00秒
(1/3):EPEL / x86_64版/ updateinfo | 1.0メガバイト夜12時○○分00秒
(2/3):アップデート/ 7 / x86_64版/ primary_db | 2.8メガバイト夜12時○○分00秒
(3/3):EPEL / x86_64版/ primary_db | 6.9メガバイト午前0時00分〇 〇秒
unzipパッケージ-6.0-20.el7.x86_64すでにインストールされ、最新バージョンの
パッケージzip-3.0-11.el7.x86_64すでにインストールされ、最新バージョン
は何の関係も

  2.ファイルのディレクトリを入力解凍 httprunnermanger_web.zipファイルを、次のように入力します解凍httprunnermanger_web.zip

#1 PWD [iZbp19lugf22zbsubsf1y6Zホーム@ルート]
/ホーム
[iZbp19lugf22zbsubsf1y6Zホーム@ルート]#解凍httprunnermanger_web.zip
アーカイブ:httprunnermanger_web.zipは
作成:httprunnermanger_web /
膨らま:httprunnermanger_web / .gitattributes
膨らま:httprunnermanger_web / .gitignoreを
作成:httprunnermanger_web / .idea /
膨らませます:httprunnermanger_web / .idea / encodings.xml
膨張:httprunnermanger_web / .idea / misc.xml
膨張:httprunnermanger_web / .idea / modules.xml
膨張:httprunnermanger_web / .idea / web.iml
膨張:httprunnermanger_web / .idea / workspace.xml
作成:httprunnermanger_web / ApiManager /
膨張:httprunnermanger_web / ApiManager / admin.py
膨らま:httprunnermanger_web / ApiManager / apps.py
膨らま:httprunnermanger_web / ApiManager / managers.py
作成:httprunnermanger_web / ApiManager /移行/
抽出:httprunnermanger_web / ApiManager /移行/ __私は

...

  3.データベース情報を変更し、viのコマンド入力: VI httprunnermanger_web \ HttpRunnerManager \ settings.py

  4.入力、データベース、ライブラリ名、IP、ポートに対応する情報、パスワードを占めています。

  ツールは、私は、ライブラリの名前の設定として、上記の必要な情報に対応するライブラリ名を作成し、作成したデータベースに接続: hrunを、その後もあるように設定する必要がありますhrun 。  

   6. PIP3は、インストール開始hrun 必要なパッケージを、最初のCD httprunnermanger_web \ HttpRunnerManager ディレクトリ入力: PIP3インストール-R&LT requirements.txt

[root@iZbp19lugf22zbsubsf1y6Z hrun_web]# pip3 install -r requirements.txt
Looking in indexes: http://mirrors.cloud.aliyuncs.com/pypi/simple/
Collecting Django==2.0.3
Downloading http://mirrors.cloud.aliyuncs.com/pypi/packages/3d/81/7e6cf5cb6f0f333946b5d3ee22e17c3c3f329d3bfeb86943a2a3cd861092/Django-2.0.3-py3-none-any.whl (7.1MB)
|████████████████████████████████| 7.1MB 719kB/s
Collecting PyYAML==3.12
Downloading http://mirrors.cloud.aliyuncs.com/pypi/packages/4a/85/db5a2df477072b2902b0eb892feb37d88ac635d36245a72a6a69b23b383a/PyYAML-3.12.tar.gz (253kB)
|████████████████████████████████| 256kB 4.0MB/s
Collecting requests==2.18.4
Downloading http://mirrors.cloud.aliyuncs.com/pypi/packages/49/df/50aa1999ab9bde74656c2919d9c0c085fd2b3775fd3eca826012bef76d8c/requests-2.18.4-py2.py3-none-any.whl (88kB)
|████████████████████████████████| 92kB 10.6MB/s
Collecting eventlet==0.22.1
Downloading http://mirrors.cloud.aliyuncs.com/pypi/packages/61/1a/d1ff6e4f1dc652dfdda4a674f807c842eaa15f1ed9b76938a3be313bbac9/eventlet-0.22.1-py2.py3-none-any.whl (409kB)
|████████████████████████████████| 409kB 14.0MB/s
Collecting mysqlclient==1.3.12
Downloading http://mirrors.cloud.aliyuncs.com/pypi/packages/6f/86/bad31f1c1bb0cc99e88ca2adb7cb5c71f7a6540c1bb001480513de76a931/mysqlclient-1.3.12.tar.gz (89kB)

  7.同步hrun数据库表结构到mysql5.7中,cd .. 回到httprunnermanger_web\目录下,依次运行:

  ① python3 manage.py makemigrations

  ② python3 manage.py migrate

[root@iZbp19lugf22zbsubsf1y6Z httprunnermanger_web]# python3 manage.py makemigrations
Migrations for 'ApiManager':
ApiManager/migrations/0001_initial.py
- Create model DebugTalk
- Create model EnvInfo
- Create model ModuleInfo
- Create model ProjectInfo
- Create model TestCaseInfo
- Create model TestReports
- Create model TestSuite
- Create model UserInfo
- Create model UserType
- Add field belong_project to moduleinfo
- Add field belong_project to debugtalk

[root@iZbp19lugf22zbsubsf1y6Z hrun_web]# python3 manage.py migrate
Operations to perform:
Apply all migrations: ApiManager, admin, auth, contenttypes, djcelery, sessions
Running migrations:
Applying ApiManager.0001_initial... OK
Applying contenttypes.0001_initial... OK
Applying auth.0001_initial... OK
Applying admin.0001_initial... OK
Applying admin.0002_logentry_remove_auto_add... OK
Applying contenttypes.0002_remove_content_type_name... OK
Applying auth.0002_alter_permission_name_max_length... OK
Applying auth.0003_alter_user_email_max_length... OK
Applying auth.0004_alter_user_username_opts... OK
Applying auth.0005_alter_user_last_login_null... OK
Applying auth.0006_require_contenttypes_0002... OK
Applying auth.0007_alter_validators_add_error_messages... OK
Applying auth.0008_alter_user_username_max_length... OK
Applying auth.0009_alter_user_last_name_max_length... OK
Applying djcelery.0001_initial... OK
Applying sessions.0001_initial... OK

  8.nohup命令执行后台运行hrun服务即可,运行:nohup python3 manage.py runserver 0.0.0.0:8000 >hrun.out 2>&1 &

  --hrun.out是指定控制台的日志输出文件(平时就可以在这里查看日志了)

[root@iZbp19lugf22zbsubsf1y6Z hrun_web]# nohup python3 manage.py runserver 0.0.0.0:8000 >hrun.out 2>&1 &
[2] 17473

  9.添加软链接,查看hrun版本:

  ln -s /root/python36/bin/hrun /usr/bin/hrun

  hrun -V

[root@iZbp19lugf22zbsubsf1y6Z hrun_web]# ln -s /root/python3/bin/hrun /usr/bin/hrun

[root@iZbp19lugf22zbsubsf1y6Z hrun_web]# hrun -V
1.5.8


  10.
访问前端浏览器输入:
http://47.xx.xxx.08:8000/api/login/注册用户,开始尽情享用平台吧,这里需要自己新注册一个账号。

   11.创建后台管理账号,运行:python3 manage.py createsuperuser

[root@iZbp19lugf22zbsubsf1y6Z hrun_web]# python3 manage.py createsuperuser
Username (leave blank to use 'root'): admin
Email address: [email protected]
Password:
Password (again):
Superuser created successfully.

  12.浏览器输入http://127.0.0.1:8000/admin/  输入步骤6设置的用户名、密码,登录后台运维管理系统,可后台管理数据

おすすめ

転載: www.cnblogs.com/gsxl/p/11785614.html