差分
このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン最新のリビジョン両方とも次のリビジョン | ||
python:fabric [2019/08/08 10:07] – ともやん | python:fabric [2023/05/07 10:37] – [Fabric - シンプルな Pythonic リモート実行とデプロイメント] ともやん | ||
---|---|---|---|
行 1: | 行 1: | ||
- | <ifauth !@loggedinusers><html> | + | ====== Fabric - シンプルな Pythonic リモート実行とデプロイメント ====== |
- | <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></ | + | {{: |
- | <script> | + | <html><span style=" |
- | | + | <a href="https://www.flickr.com/photos/154298502@N07/50242060996">" |
- | | + | <span> by <a href=" |
- | enable_page_level_ads: true | + | is licensed under |
- | }); | + | <a href=" |
- | </script></html></ifauth> | + | </a></span> |
- | < | + | </html>\\ |
- | < | + | ファブリック(fabric) とファブリーズ(febreze) は関係ないです🤤\\ |
- | # | + | 爽やかなお兄さんがファブ(fab)っていますけど...🤔\\ |
- | | + | |
- | | + | 本家: [[https:// |
- | overflow-x: hidden; | + | ソースコード: |
- | } | + | 関連: [[https:// |
- | </style> | + | [[https: |
- | </html> | + | ドキュメント: [[https:// |
- | ====== Fabric のインストール ====== | + | ソースコード: |
===== 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 | + | Downloading fabric-2.6.0-py2.py3-none-any.whl (53 kB) |
- | | + | |
- | Requirement already satisfied: cryptography> | + | Collecting pathlib2 |
- | Collecting invoke< | + | Downloading pathlib2-2.3.5-py2.py3-none-any.whl |
- | Downloading | + | Collecting invoke< |
- | | + | Downloading invoke-1.5.0-py3-none-any.whl (211 kB) |
- | Requirement already satisfied: | + | |
- | Requirement already satisfied: asn1crypto>=0.21.0 in c: | + | Collecting |
- | Requirement already satisfied: cffi!=1.11.3,>=1.8 in c: | + | Downloading paramiko-2.7.2-py2.py3-none-any.whl (206 kB) |
- | Requirement already satisfied: | + | |████████████████████████████████| 206 kB 726 kB/s |
- | Requirement already satisfied: pynacl>=1.0.1 in c: | + | Collecting pynacl>=1.0.1 |
- | Requirement already satisfied: bcrypt>=3.1.3 in c: | + | Downloading PyNaCl-1.4.0-cp35-abi3-win_amd64.whl |
- | Requirement already satisfied: pycparser in c: | + | |
- | Installing collected packages: invoke, fabric | + | Collecting bcrypt>=3.1.3 |
- | Successfully installed fabric-2.4.0 | + | Downloading bcrypt-3.2.0-cp36-abi3-win_amd64.whl (28 kB) |
- | </ | + | Collecting cryptography> |
+ | Downloading cryptography-3.4.7-cp36-abi3-win_amd64.whl | ||
+ | | ||
+ | Collecting | ||
+ | Using cached six-1.16.0-py2.py3-none-any.whl (11 kB) | ||
+ | Collecting cffi>=1.1 | ||
+ | Downloading cffi-1.14.5-cp39-cp39-win_amd64.whl | ||
+ | | ||
+ | Collecting pycparser | ||
+ | Using cached pycparser-2.20-py2.py3-none-any.whl (112 kB) | ||
+ | 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 | ||
+ | </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> | ||
+ |