開発サーバーへのIDEAワンクリックで展開

始めます

あなたに必要な最初のステップ:サービスは、開発サーバの一般的な手順に配備されwar、袋(または他の)scpサーバー上の指定した場所に、特定介してサービスの第2ステップshell命令の手順の展開。

jenkins上記の処理ステップは完璧なことができ、我々はしていないjenkinsことへの他の軽量なアプローチを持っていますか?

また、対応する二つのステップ:最初のステップは、自動化されていことができなければならないscpツール。第二段階は、リモートスクリプトを実行するためのツールを自動化しました。この2つのステップがに統合することができた場合はIDEA、ボタンになっ操作、それは非常に快適です。

ツール

SCPツール

まず、考慮に入れることはscpコマンドを使用することでlinux、直接使用することができる環境を組み込みのscpコマンド、Windows環境もオンライン対応はありscp.exeますが、パスワードソリューション、高い導入コストを入力する一切既製の自動コマンドラインがありません。

活用しないのはなぜjavaクロスプラットフォーム手書きの特徴scp.jar、それを?

彼は先に行ってきました

https://gitee.com/zkdcloud.cn/scp/releases

java -jar .\scp-1.0.0.jar -help

usage: scp -help
 -d,--dst_path <arg>   the dstPath of remote
 -h,--host <arg>       the host of remote server
 -help                 usage help
 -P,--port <arg>       the port of remote server
 -p,--password <arg>   the password of remote server
 -s,--src_path <arg>   the srcPath of local
 -u,--user <arg>       the user of remote server

非常にシンプルなscpツールが生まれた、それが含まれているscp次のようにコマンドを実行するのに必要な基本的なパラメータを:

java -jar .\scp-1.0.0.jar -s "D:\abc-project\target\abc.war" -h "192.168.27.112" -u "root" -p "111111" -d "/tmp/abc.war"

シェルのexecツール

リモート実行shell共感のツールコマンド。

https://gitee.com/zkdcloud.cn/shell-exec/releases

java -jar .\shell-exec-1.0.0.jar -help
Missing required options: h, u, p, c
usage: scp -help
 -c,--command <arg>    will exec command
 -h,--host <hello>     the host of remote server
 -help                 usage help
 -P,--port <arg>       the port of remote server
 -p,--password <arg>   the password of remote server
 -u,--user <arg>       the user of remote server
java -jar .\shell-exec-1.0.0.jar -c "mv /tmp/abc.war /home/tomcat/webapps/ && /home/tomcat/bin/startup.sh" -h 192.168.27.112 -u root -p 111111

キーの配置上のIDEA

これら2つのツールを使用すると、残りはに統合されていますIDEA

  1. 設定ジャー Edit Configurations -> new Configuration -> JAR Application
3432069-3b9bb2968c68f3e2.jpg
画像

2. [設定scp.jar


3432069-189b6c84fe003258.jpg
画像

3.同様に構成されたシェルexec.jar

4.新しい構成の構築Edit Configurations -> new Configuration -> Compound、この2つのステップの合成ステップ動作の
追加compound

3432069-78202a758bd9253f.jpg
画像

組み合わせた2つの段階


3432069-d8e9f7968b18c2f2.jpg
画像
  1. 設定が完了すると、 Run it!
3432069-7929c2887f3dea78.jpg
画像

コンソールビュー


3432069-5dff6dff7eb75ed6.jpg
画像

ます。https://www.jianshu.com/p/e6cf392347d3で再現

おすすめ

転載: blog.csdn.net/weixin_33873846/article/details/91181648