質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Jenkins

Jenkinsとは、Apache TomcatなどのServletで動作しているサーバーベースシステムです。Jenkinsはオープンソースであり、LInux,Mac OS X,Windows,Solaris,FreeBSDとOpenBSDのためのパッケージがあります。

Java

Javaは、1995年にサン・マイクロシステムズが開発したプログラミング言語です。表記法はC言語に似ていますが、既存のプログラミング言語の短所を踏まえていちから設計されており、最初からオブジェクト指向性を備えてデザインされています。セキュリティ面が強力であることや、ネットワーク環境での利用に向いていることが特徴です。Javaで作られたソフトウェアは基本的にいかなるプラットフォームでも作動します。

Apache Maven 2

Apache Mavenは、ソフトウェアプロジェクトの管理ツールです。

Azure

Azureは、マイクロソフトのクラウド プラットフォームで、旧称は Windows Azureです。PaaSとIaaSを組み合わせることで、 コンピューティング・ストレージ・データ・ネットワーキング・アプリケーションなど多くの機能を持ちます。

Q&A

0回答

467閲覧

AzureWebAppServicesにJenkinsPipelineを使ってMavenWebAppをデプロイ・公開したい

退会済みユーザー

退会済みユーザー

総合スコア0

Jenkins

Jenkinsとは、Apache TomcatなどのServletで動作しているサーバーベースシステムです。Jenkinsはオープンソースであり、LInux,Mac OS X,Windows,Solaris,FreeBSDとOpenBSDのためのパッケージがあります。

Java

Javaは、1995年にサン・マイクロシステムズが開発したプログラミング言語です。表記法はC言語に似ていますが、既存のプログラミング言語の短所を踏まえていちから設計されており、最初からオブジェクト指向性を備えてデザインされています。セキュリティ面が強力であることや、ネットワーク環境での利用に向いていることが特徴です。Javaで作られたソフトウェアは基本的にいかなるプラットフォームでも作動します。

Apache Maven 2

Apache Mavenは、ソフトウェアプロジェクトの管理ツールです。

Azure

Azureは、マイクロソフトのクラウド プラットフォームで、旧称は Windows Azureです。PaaSとIaaSを組み合わせることで、 コンピューティング・ストレージ・データ・ネットワーキング・アプリケーションなど多くの機能を持ちます。

0グッド

0クリップ

投稿2019/10/11 08:40

編集2019/10/11 09:21

前提・実現したいこと

主にサーブレットとJSPで構成された、Maven Webappプロジェクトが、
GitHubプライベートリポジトリにあります。

Azure上に、ソリューションテンプレートで作成したJenkinsサーバがあり、
GitHubからリソースを取得し、パイプラインでビルド、テストを行い
最終的に、Azure Webapp Serviceにデプロイ・公開したいです。

現段階で、テストの過程はスキップし、Azure Webapp Serviceにデプロイするところを取り組んでいます。

Jenkins Pipelineのジョブ、デプロイメント・センターのログでは,
「デプロイ成功」となっているのですが、Azure Webapp ServiceのURLにアクセスしても、マイクロソフト社の ' Hey, Java developers!...' という画面しか表示されません。

試行錯誤でここまで辿り着いたので、何が原因なのか見当がつきません。

皆様のお知恵をお貸し頂けないでしょうか。
よろしくお願いいたします。

logs

from Jenkins

Running as SYSTEM [EnvInject] - Loading node environment variables. Building in workspace /var/lib/jenkins/workspace/test using credential github-credentials > git rev-parse --is-inside-work-tree # timeout=10 Fetching changes from the remote Git repository > git config remote.origin.url https://github.com/Sec-il-n/pf.git # timeout=10 Fetching upstream changes from https://github.com/Sec-il-n/pf.git > git --version # timeout=10 using GIT_ASKPASS to set credentials password authentication information > git fetch --tags --progress https://github.com/Sec-il-n/pf.git +refs/heads/*:refs/remotes/origin/* > git rev-parse refs/remotes/origin/master^{commit} # timeout=10 > git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10 Checking out Revision 790de293e83767377a9e47a65b759c0cc382cd07 (refs/remotes/origin/master) > git config core.sparsecheckout # timeout=10 > git checkout -f 790de293e83767377a9e47a65b759c0cc382cd07 Commit message: "fixed_jenkinsfile_build_1011" > git rev-list --no-walk 0e6a66e35229f6660b8dcf46de7e9aff333b8832 # timeout=10 [Set GitHub commit status (universal)] PENDING on repos [] (sha:790de29) with context:test Starting Azure Web App Deployment Cloning repository https://uploadimagedb4.scm.azurewebsites.net:443/uploadimagedb4.git > git init /var/lib/jenkins/workspace/test/.azure-deploy # timeout=10 Fetching upstream changes from https://uploadimagedb4.scm.azurewebsites.net:443/uploadimagedb4.git > git --version # timeout=10 using GIT_ASKPASS to set credentials > git fetch --tags --progress https://uploadimagedb4.scm.azurewebsites.net:443/uploadimagedb4.git +refs/heads/*:refs/remotes/origin/* > git config remote.origin.url https://uploadimagedb4.scm.azurewebsites.net:443/uploadimagedb4.git # timeout=10 > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10 Seen branch in repository origin/master Seen 1 remote branch > git config core.sparsecheckout # timeout=10 > git checkout -f master > git add -A # timeout=10 > git commit -F /var/lib/jenkins/workspace/test/.azure-deploy@tmp/gitcommit467352537728240507.txt # timeout=10 using GIT_ASKPASS to set credentials > git push https://uploadimagedb4.scm.azurewebsites.net:443/uploadimagedb4.git master:master Deploy to app with default host https://uploadimagedb4.azurewebsites.net Done Azure Web App deployment. Finished: SUCCESS

該当WebappServiceの デプロイ センターのログ
イメージ説明

イメージ説明

上記'Running deployment command'のログ
※’Deleting file...’ になっていますが、これが原因でしょうか?(自分は一度展開したファイルをAzure側で削除しているのだと思っているのですが...)

Command: "/home/site/deployments/tools/deploy.sh" Handling Basic Web Site deployment. Kudu sync from: '/home/site/repository' to: '/home/site/wwwroot' Deleting file: '.classpath' Deleting file: '.project' Deleting file: 'pom.xml' Deleting file: '.settings/.jsdtscope' Deleting file: '.settings/org.eclipse.core.resources.prefs' Deleting file: '.settings/org.eclipse.jdt.core.prefs' Deleting file: '.settings/org.eclipse.m2e.core.prefs' Deleting file: '.settings/org.eclipse.wst.common.component' Deleting file: '.settings/org.eclipse.wst.common.project.facet.core.xml' Deleting file: '.settings/org.eclipse.wst.jsdt.ui.superType.container' Deleting file: '.settings/org.eclipse.wst.jsdt.ui.superType.name' Deleting file: '.settings/org.eclipse.wst.validation.prefs' Deleting directory: '.settings' Deleting file: 'Applications/Eclipse_2019-03.app/Contents/workspace/upload_image_db4/target/m2e-wtp/web-resources/META-INF/MANIFEST.MF' Deleting file: 'Applications/Eclipse_2019-03.app/Contents/workspace/upload_image_db4/target/m2e-wtp/web-resources/META-INF/maven/jp.sec-li-n.portfolio/upload_image_db4/pom.properties' Deleting file: 'Applications/Eclipse_2019-03.app/Contents/workspace/upload_image_db4/target/m2e-wtp/web-resources/META-INF/maven/jp.sec-li-n.portfolio/upload_image_db4/pom.xml' Deleting directory: 'Applications/Eclipse_2019-03.app/Contents/workspace/upload_image_db4/target/m2e-wtp/web-resources/META-INF/maven/jp.sec-li-n.portfolio/upload_image_db4' Deleting directory: 'Applications/Eclipse_2019-03.app/Contents/workspace/upload_image_db4/target/m2e-wtp/web-resources/META-INF/maven/jp.sec-li-n.portfolio' Deleting directory: 'Applications/Eclipse_2019-03.app/Contents/workspace/upload_image_db4/target/m2e-wtp/web-resources/META-INF/maven' Deleting directory: 'Applications/Eclipse_2019-03.app/Contents/workspace/upload_image_db4/target/m2e-wtp/web-resources/META-INF' Deleting directory: 'Applications/Eclipse_2019-03.app/Contents/workspace/upload_image_db4/target/m2e-wtp/web-resources' Deleting directory: 'Applications/Eclipse_2019-03.app/Contents/workspace/upload_image_db4/target/m2e-wtp' Deleting directory: 'Applications/Eclipse_2019-03.app/Contents/workspace/upload_image_db4/target' Deleting directory: 'Applications/Eclipse_2019-03.app/Contents/workspace/upload_image_db4' Deleting directory: 'Applications/Eclipse_2019-03.app/Contents/workspace' Deleting directory: 'Applications/Eclipse_2019-03.app/Contents' Deleting directory: 'Applications/Eclipse_2019-03.app' Deleting file: 'Applications/README.txt/Readme.adoc' Deleting directory: 'Applications/README.txt' Deleting directory: 'Applications' Deleting file: 'data/s3/bucket/1563136435347_test_1563136435347' Deleting file: 'data/s3/bucket/1563138540835_test_1563138540835' Deleting file: 'data/s3/bucket/1563146159167_test_1563146159167' Deleting file: 'data/s3/bucket/1563166159083_test_1563166159083' Deleting file: 'data/s3/bucket/1563166159167_test_1563166159167' Deleting file: 'data/s3/bucket/1563166159183_test_1563166159183' Deleting file: 'data/s3/bucket/1563167159173_test_1563167159173' Deleting file: 'data/s3/bucket/__ninja_1563136435347_test_1563136435347.properties' Deleting file: 'data/s3/bucket/__ninja_1563138540835_test_1563138540835.properties' Deleting file: 'data/s3/bucket/__ninja_1563146159167_test_1563146159167.properties' Deleting file: 'data/s3/bucket/__ninja_1563166159083_test_1563166159083.properties' Deleting file: 'data/s3/bucket/__ninja_1563166159167_test_1563166159167.properties' Deleting file: 'data/s3/bucket/__ninja_1563166159183_test_1563166159183.properties' Deleting file: 'data/s3/bucket/__ninja_1563167159173_test_1563167159173.properties' Deleting file: 'data/s3/bucket/__ninja_null_test_null.properties' Deleting file: 'data/s3/bucket/__ninja_s3test2.jpg.properties' Deleting file: 'data/s3/bucket/null_test_null' Deleting file: 'data/s3/bucket/s3test2.jpg' Deleting directory: 'data/s3/bucket' Omitting next output lines... Finished successfully.

###気になる点
Jenkinsサーバーとして使用しているVMに、

  • Tomcatのinstallが必要?
  • プラグインが足りない?
  • デプロイは成功しているが、JenkinsとWebapp Service が結びついていない

状態で成功している?

  • プロジェクト内ではなくデプロイされたWAR内に、何か設定ファイル、変更等が必要?

補足情報(FW/ツールのバージョンなど)

Azure
Solution template
で作成したJenkinsサーバー : LinuxVM(Linux (ubuntu 16.04))
・ここへはlocalからsshで接続・ログインし、パイプラインを作成しました。

local
Eclipse
Maven 3.6
Tomcat 9
Java 11

その他
・JenkinsFileはプロジェクトのsrc/main/resourcesにあります。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだ回答がついていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問