差分
このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン | ||
python:fabric [2021/06/10 13:37] – [Windows] ともやん | python:fabric [2023/05/07 20:17] (現在) – [Fabric - シンプルな Pythonic リモート実行とデプロイメント] ともやん | ||
---|---|---|---|
行 1: | 行 1: | ||
- | < | + | ====== Fabric - シンプルな Pythonic リモート実行とデプロイメント ====== |
- | | + | {{: |
- | # | + | < |
- | height: 200px; | + | <a href=" |
- | | + | < |
- | | + | is licensed under |
- | } | + | <a href=" |
- | | + | </a></ |
- | </ | + | </ |
- | ====== | + | ファブリック(fabric) とファブリーズ(febreze) は関係ないです🤤\\ |
+ | 爽やかなお兄さんがファブ(fab)っていますけど...🤔\\ | ||
+ | |||
+ | 本家: [[https:// | ||
+ | ソースコード: [[git> | ||
+ | 関連: [[https:// | ||
+ | [[https:// | ||
+ | ドキュメント: [[https:// | ||
+ | ソースコード: | ||
+ | [[git> | ||
===== Linux ===== | ===== Linux ===== | ||
- | <code> | + | <WRAP color_term> |
- | $ pip3 install fabric | + | <WRAP color_connamd>< |
- | </code> | + | <b class=GRN> |
+ | </pre></ | ||
+ | <WRAP color_result>< | ||
+ | Collecting fabric | ||
+ | Downloading fabric-3.0.0-py3-none-any.whl (53 kB) | ||
+ | <b class=PipBAR> | ||
+ | Collecting invoke> | ||
+ | Downloading invoke-2.0.0-py3-none-any.whl (162 kB) | ||
+ | <b class=PipBAR> | ||
+ | Collecting paramiko> | ||
+ | Downloading paramiko-3.1.0-py3-none-any.whl (211 kB) | ||
+ | <b class=PipBAR> | ||
+ | Collecting bcrypt> | ||
+ | Downloading bcrypt-4.0.1-cp36-abi3-manylinux_2_28_x86_64.whl (593 kB) | ||
+ | <b class=PipBAR> | ||
+ | Collecting cryptography> | ||
+ | Downloading cryptography-40.0.1-cp36-abi3-manylinux_2_28_x86_64.whl (3.7 MB) | ||
+ | <b class=PipBAR> | ||
+ | Collecting pynacl> | ||
+ | Downloading PyNaCl-1.5.0-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl (856 kB) | ||
+ | <b class=PipBAR> | ||
+ | Requirement already satisfied: cffi> | ||
+ | Requirement already satisfied: pycparser in ./ | ||
+ | Installing collected packages: invoke, bcrypt, pynacl, cryptography, | ||
+ | Successfully installed bcrypt-4.0.1 cryptography-40.0.1 fabric-3.0.0 invoke-2.0.0 paramiko-3.1.0 pynacl-1.5.0 | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | <WRAP color_term> | ||
+ | <WRAP color_connamd>< | ||
+ | <b class=GRN> | ||
+ | </ | ||
+ | <WRAP color_result_long>< | ||
+ | Name: fabric | ||
+ | Version: 3.0.0 | ||
+ | Summary: High level SSH command execution | ||
+ | Home-page: https:// | ||
+ | Author: Jeff Forcier | ||
+ | Author-email: | ||
+ | License: BSD | ||
+ | Location: / | ||
+ | Requires: invoke, paramiko | ||
+ | Required-by: | ||
+ | --- | ||
+ | Name: invoke | ||
+ | Version: 2.0.0 | ||
+ | Summary: Pythonic task execution | ||
+ | Home-page: https:// | ||
+ | Author: Jeff Forcier | ||
+ | Author-email: | ||
+ | License: BSD | ||
+ | Location: / | ||
+ | Requires: | ||
+ | Required-by: | ||
+ | --- | ||
+ | Name: paramiko | ||
+ | Version: 3.1.0 | ||
+ | Summary: SSH2 protocol library | ||
+ | Home-page: https:// | ||
+ | Author: Jeff Forcier | ||
+ | Author-email: | ||
+ | License: LGPL | ||
+ | Location: / | ||
+ | Requires: bcrypt, cryptography, | ||
+ | Required-by: | ||
+ | </ | ||
+ | </WRAP> | ||
===== Windows ===== | ===== Windows ===== | ||
- | < | + | <WRAP color_term> |
+ | <WRAP color_command> | ||
> pip install fabric | > pip install fabric | ||
- | </ | + | </ |
- | < | + | <WRAP color_result> |
- | < | + | |
Collecting fabric | Collecting fabric | ||
Downloading fabric-2.6.0-py2.py3-none-any.whl (53 kB) | Downloading fabric-2.6.0-py2.py3-none-any.whl (53 kB) | ||
行 49: | 行 124: | ||
Installing collected packages: pycparser, six, cffi, pynacl, cryptography, | Installing collected packages: pycparser, six, cffi, pynacl, cryptography, | ||
Successfully installed bcrypt-3.2.0 cffi-1.14.5 cryptography-3.4.7 fabric-2.6.0 invoke-1.5.0 paramiko-2.7.2 pathlib2-2.3.5 pycparser-2.20 pynacl-1.4.0 six-1.16.0 | Successfully installed bcrypt-3.2.0 cffi-1.14.5 cryptography-3.4.7 fabric-2.6.0 invoke-1.5.0 paramiko-2.7.2 pathlib2-2.3.5 pycparser-2.20 pynacl-1.4.0 six-1.16.0 | ||
- | </ | + | </code></ |
</ | </ | ||
+ | |||
+ | ===== いつも混乱するかもしれない Fabric のバージョン ===== | ||
+ | fabric❓ fabric2❓ Fabric3❓❓ Version 1.x 2.x ...🤯 😅💦💦💦w\\ | ||
+ | |||
+ | **結論: fabric をインストールしよう!🤤 fabric2 は、1.x のユーザーが 2.0 への移行用で、fabric3 は不正なフォークです😅**\\ | ||
+ | |||
+ | [[https:// | ||
+ | {{: | ||
+ | |||
+ | ===== Fabric 1.x から 2.x へ再実装された経緯 ===== | ||
+ | [[https:// | ||
+ | < | ||
+ | < | ||
+ | .plugin_note { | ||
+ | text-align: left; | ||
+ | font-size: 12px; | ||
+ | } | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ==== fabric and fabric2 vs fabric3 ==== | ||
+ | < | ||
+ | **fabric and fabric2 vs fabric3**\\ | ||
+ | <wrap hi> | ||
+ | \\ | ||
+ | Unfortunately, | ||
+ | <wrap hi>// | ||
+ | Once modern Fabric gets up to 3.x, 4.x etc, we’ll likely continue distributing it via both fabric and fabric2 for convenience; | ||
+ | <wrap hi>// | ||
+ | \\ | ||
+ | In other words, fabric2 is purely there to help users of 1.x cross the 2.0 “major rewrite” barrier; future major versions will not be large rewrites and will only have small sets of backward incompatibilities.\\ | ||
+ | <wrap hi>// | ||
+ | \\ | ||
+ | 本家: [[https:// | ||
+ | GitHub: [[git> | ||
+ | </ | ||
+ | |||
+ | ==== Upgrading from 1.x ==== | ||
+ | < | ||
+ | **Upgrading from 1.x**\\ | ||
+ | <wrap hi>// | ||
+ | \\ | ||
+ | Modern Fabric (2+) represents a near-total reimplementation & reorganization of the software. It's been [[https:// | ||
+ | <wrap hi>// | ||
+ | \\ | ||
+ | [[https:// | ||
+ | </ | ||
+ | |||
+ | ==== Why was Invoke split off from the Fabric project? ==== | ||
+ | [[https:// | ||
+ | < | ||
+ | **Why was Invoke split off from the Fabric project? | ||
+ | <wrap hi>// | ||
+ | \\ | ||
+ | Fabric (1.x and earlier) was a hybrid project implementing two feature sets: task execution (organization of task functions, execution of them via CLI, and local shell commands) and high level SSH actions (organization of servers/ | ||
+ | <wrap hi>// | ||
+ | タスクの実行 (タスク関数の編成、CLI によるそれらの実行、およびローカル シェル コマンド) そして | ||
+ | 高レベルの SSH アクション (サーバー/ | ||
+ | \\ | ||
+ | However, over time it became clear many users only needed one or the other, with local-only users resenting heavy SSH/crypto install requirements, | ||
+ | <wrap hi>// | ||
+ | \\ | ||
+ | When planning Fabric 2.x, having the “local” feature set as a standalone library made sense, and it seemed plausible to design the SSH component as a separate layer above. Thus, Invoke was created to focus exclusively on local and abstract concerns, leaving Fabric 2.x concerned only with servers and network commands.\\ | ||
+ | <wrap hi>// | ||
+ | そして、SSH コンポーネントを上の別のレイヤーとして設計するのがもっともらしく思えました。したがって、Invoke は、ローカルで抽象的な問題にのみ焦点を当てるように作成され、Fabric 2.x はサーバーとネットワーク コマンドのみを考慮しました。//</ | ||
+ | \\ | ||
+ | [[https:// | ||
+ | </ | ||
+ | |||
+ | ===== タスク定義 ===== | ||
+ | [[https:// | ||
+ | |||
+ | ===== 参考文献 ===== | ||
+ | [[https:// | ||
+ | [[https:// | ||
+ | |||
+ | ==== 付録 ==== | ||
+ | [[tw> | ||
+ |