2016-05-27 8 views
0

Microsoft Azure CloudでPHP-Laravel Web Appを開発しています。バージョン管理のためにクラウドにLocal Gitを設定しました。私はまた、JetBrainsのPHP StormをIDEとして使用しています。Gitを使用してPHP/LaravelをAzureにプッシュする際の問題

コンピュータからazureにファイルをプッシュするたびに、gitはデプロイメントを遅らせるいくつかの操作を実行します。 1つのファイルを変更しても、1分ほどで完了します。私はLaravelとComposerを初めて使っているので、それは普通のことか、それとも私の間違いですか?

Counting objects: 7, done. 
Delta compression using up to 4 threads. 
Compressing objects: 100% (7/7), done. 
Writing objects: 100% (7/7), 1.35 KiB | 0 bytes/s, done. 
Total 7 (delta 6), reused 0 (delta 0) 
remote: Updating branch 'master'.   
remote: Updating submodules.   
remote: Preparing deployment for commit id '0f7a0fa743'.   
remote: Running custom deployment command...   
remote: Running deployment command...   
remote: Install Dependencies with Composer   
remote: Loading composer repositories with package information   
remote: Installing dependencies from lock file   
remote: Nothing to install or update   
remote: Generating optimized autoload files   
remote: ...........................   
remote: > Illuminate\Foundation\ComposerScripts::postInstall   
remote: > php artisan optimize   
remote: ..   
remote: Generating optimized class loader   
remote: ..............................   
remote: Handling Basic Web Site deployment.   
remote: ...   
remote: KuduSync.NET from: 'D:\home\repository' to: 'D:\home\site'   
remote: Copying file: '.idea\workspace.xml'   
remote: Copying file: 'app\Http\routes.php'   
remote: Copying file: 'vendor\autoload.php'   
remote: Copying file: 'vendor\composer\autoload_classmap.php'   
remote: Copying file: 'vendor\composer\autoload_files.php'   
remote: Copying file: 'vendor\composer\autoload_namespaces.php'   
remote: Copying file: 'vendor\composer\autoload_psr4.php'   
remote: Copying file: 'vendor\composer\autoload_real.php'   
remote: Copying file: 'vendor\composer\autoload_static.php'   
remote: Copying file: 'vendor\composer\ClassLoader.php'   
remote: Copying file: 'vendor\composer\installed.json'   
remote: Copying file: 'vendor\composer\LICENSE'   
remote: Finished successfully.   
remote: Running post deployment command(s)...   
remote: Deployment successful. 
+1

私はそれが自然だと思うし、ぼんやりと荒削りを使っていますが、私はまずギブスからギリギリまでギプスに押し込むのが好きです –

+0

どうしますか? – dimitrisdan

+1

私はgithubでアカウントを作成し、githubに私の変更をプッシュします(あなたはグーグルにすることができます)。次に私は紺碧に行き、私の展開ソースをgithubとしてセットアップします。私はgithubで紺色を認可し、時間や何か(私はそれをやってみたいです)。あなたのウェブサイトは展開後に正常に動作しますか? –

答えて

1

PHPアプリケーションをGit経由でAzure App Servicesにデプロイする場合。展開タスクでは、Azureのルートディレクトリにコードスクリプトをアップロードしてコピーするだけでなく、ルートディレクトリにcomposer.json構成ファイルがあり、Azure App Servicesでコンポーザ拡張機能を有効にすると、コンポーザコマンドも実行されます。

これは、依存関係をインストールし、scriptsセクションで設定したカスタムコマンドを実行する、composer installを実行します。

だから時間がかかります。

Azure App Servicesは、プロダクションアプリケーションをホスティングするためのPaaSとして、開発作業の完了後にコードをAzureにプッシュすることができます。

一方、@Achraf Khouadjaの提案を試して、GitHubリポジトリを中間層として活用することができます。コードをGitHubにアップロードできるのはAzureファブリックで、コードを同期してデプロイメントタスクを自動的に実行します。

IDEで応答を待つ必要はなく、時間を節約できます。

+0

素敵な説明。御時間ありがとうございます – dimitrisdan

関連する問題