2014-12-20 20 views
9

Google App Engine ile mücadele ediyorum. Ben tam takip ediyorum https://cloud.google.com/tools/repo/push-to-deploy Google App Engine'e dağıtım

bas-dağıtmak

  • ayarlama (I ziyaretçi defteri uygulamasını seçmiş)

    • https://cloud.google.com/appengine/docs/java/tools/maven den Ziyaretçi defteri uygulamasını dağıtma: Yapmak istediğim tek şey bu Öğreticilerin adımları. Şimdi birkaç kez denedim. Uygulamanın Jenkins'de iyi bir performans sergilediği (ancak onu çalıştırmayı başarabiliyorum) ancak dağıtım başarısız oluyor.

      + gcloud --project=MyProject preview app deploy target/guestbook-1.0-SNAPSHOT.war 
      ERROR: File [/var/jenkins/workspace/MyProject/target/guestbook-1.0-SNAPSHOT.war] is not a valid deployable item. 
      ERROR: (gcloud.preview.app.deploy) Errors occurred while parsing the App Engine app configuration: 
      Build step 'Execute shell' marked build as failure 
      Finished: FAILURE 
      

      Tüm yerel kalkınma web sunucusunda çalışıyor. Projem, proje kimliğidir (sadece örnek için değiştirdim). Neyi yanlış yapıyorum. Yani bir şey yapmayı unuttum mu? Java'yı beş yıldan beri yapıyorum, neden bu kadar basit bir şey yapmanın o kadar zor olduğunu anlayamıyorum. Jenkins itibaren bana

      yardım edin:

      Started by user User Name 
      Building remotely on cloud-dev-java in workspace /var/jenkins/workspace/MyGuestbook 
      > git rev-parse --is-inside-work-tree # timeout=10 
      Fetching changes from the remote Git repository 
      > git config remote.origin.url https://source.developers.google.com/p/MyProject # timeout=10 
      Fetching upstream changes from https://source.developers.google.com/p/MyProject 
      > git --version # timeout=10 
      using .gitcredentials to set credentials 
      > git config --local credential.helper store --file=/tmp/git7191806817673001841.credentials # timeout=10 
      > git fetch --tags --progress https://source.developers.google.com/p/MyProject +refs/heads/*:refs/remotes/origin/* 
      > git config --local --remove-section credential # timeout=10 
      > git rev-parse refs/remotes/origin/master^{commit} # timeout=10 
      > git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10 
      Checking out Revision 2bf8419a93275dc87adb7be00d1fda9e6efc773b (refs/remotes/origin/master) 
      > git config core.sparsecheckout # timeout=10 
      > git checkout -f 2bf8419a93275dc87adb7be00d1fda9e6efc773b 
      > git rev-list 9d2cd477ad8fcb6f210bd2418e8f708e5c5167f9 # timeout=10 
      [MyGuestbook] $ mvn clean test package 
      [INFO] Scanning for projects... 
      [INFO]                   
      [INFO] ------------------------------------------------------------------------ 
      [INFO] Building myapp 1.0-SNAPSHOT 
      [INFO] ------------------------------------------------------------------------ 
      [INFO] 
      [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ myapp --- 
      [INFO] Deleting /var/jenkins/workspace/MyGuestbook/target 
      [INFO] 
      [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ myapp --- 
      [INFO] Using 'UTF-8' encoding to copy filtered resources. 
      [INFO] skip non existing resourceDirectory /var/jenkins/workspace/MyGuestbook/src/main/resources 
      [INFO] 
      [INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ myapp --- 
      [INFO] Changes detected - recompiling the module! 
      [INFO] Compiling 2 source files to /var/jenkins/workspace/MyGuestbook/target/myapp-1.0-SNAPSHOT/WEB-INF/classes 
      [INFO] 
      [INFO] --- versions-maven-plugin:2.1:display-dependency-updates (default) @ myapp --- 
      [INFO] The following dependencies in Dependencies have newer versions: 
      [INFO] com.google.appengine:appengine-api-1.0-sdk ......... 1.9.17 -> 1.9.17a 
      [INFO] com.google.appengine:appengine-api-stubs ........... 1.9.17 -> 1.9.17a 
      [INFO] com.google.appengine:appengine-testing ............. 1.9.17 -> 1.9.17a 
      [INFO] javax.servlet:servlet-api ......................... 2.5 -> 3.0-alpha-1 
      [INFO] junit:junit ...................................... 4.12-beta-1 -> 4.12 
      [INFO] org.mockito:mockito-all ............................. 1.9.5 -> 1.10.17 
      [INFO] 
      [INFO] 
      [INFO] --- versions-maven-plugin:2.1:display-plugin-updates (default) @ myapp --- 
      [INFO] 
      [INFO] The following plugin updates are available: 
      [INFO] com.google.appengine:appengine-maven-plugin ....... 1.9.17 -> 1.9.17a 
      [INFO] maven-compiler-plugin .................................... 3.1 -> 3.2 
      [INFO] maven-war-plugin ......................................... 2.4 -> 2.5 
      [INFO] 
      [WARNING] The following plugins do not have their version specified: 
      [WARNING] maven-clean-plugin ........................ (from super-pom) 2.6.1 
      [WARNING] maven-deploy-plugin ....................... (from super-pom) 2.8.2 
      [WARNING] maven-install-plugin ...................... (from super-pom) 2.5.2 
      [WARNING] maven-resources-plugin ...................... (from super-pom) 2.7 
      [WARNING] maven-site-plugin ........................... (from super-pom) 3.4 
      [WARNING] maven-surefire-plugin ...................... (from super-pom) 2.18 
      [INFO] 
      [INFO] Project defines minimum Maven version as: 3.1.0 
      [INFO] Plugins require minimum Maven version of: 3.1.0 
      [INFO] Note: the super-pom from Maven 3.1.0 defines some of the plugin 
      [INFO]  versions and may be influencing the plugins required minimum Maven 
      [INFO]  version. 
      [INFO] 
      [INFO] No plugins require a newer version of Maven than specified by the pom. 
      [INFO] 
      [INFO] 
      [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ myapp --- 
      [INFO] Using 'UTF-8' encoding to copy filtered resources. 
      [INFO] skip non existing resourceDirectory /var/jenkins/workspace/MyGuestbook/src/test/resources 
      [INFO] 
      [INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ myapp --- 
      [INFO] Changes detected - recompiling the module! 
      [INFO] Compiling 2 source files to /var/jenkins/workspace/MyGuestbook/target/test-classes 
      [WARNING] /var/jenkins/workspace/MyGuestbook/src/test/java/com/mycompany/myapp/GuestbookServletTest.java: Some input files use or override a deprecated API. 
      [WARNING] /var/jenkins/workspace/MyGuestbook/src/test/java/com/mycompany/myapp/GuestbookServletTest.java: Recompile with -Xlint:deprecation for details. 
      [INFO] 
      [INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ myapp --- 
      [INFO] Surefire report directory: /var/jenkins/workspace/MyGuestbook/target/surefire-reports 
      
      ------------------------------------------------------- 
      T E S T S 
      ------------------------------------------------------- 
      Running com.mycompany.myapp.GuestbookServletTest 
      Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.702 sec 
      Running com.mycompany.myapp.SignGuestbookServletTest 
      Dec 22, 2014 5:32:44 PM com.google.appengine.api.datastore.dev.LocalDatastoreService init 
      INFO: Local Datastore initialized: 
          Type: Master/Slave 
          Storage: In-memory 
      Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.456 sec 
      
      Results : 
      
      Tests run: 2, Failures: 0, Errors: 0, Skipped: 0 
      
      [INFO] 
      [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ myapp --- 
      [INFO] Using 'UTF-8' encoding to copy filtered resources. 
      [INFO] skip non existing resourceDirectory /var/jenkins/workspace/MyGuestbook/src/main/resources 
      [INFO] 
      [INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ myapp --- 
      [INFO] Nothing to compile - all classes are up to date 
      [INFO] 
      [INFO] --- versions-maven-plugin:2.1:display-dependency-updates (default) @ myapp --- 
      [INFO] The following dependencies in Dependencies have newer versions: 
      [INFO] com.google.appengine:appengine-api-1.0-sdk ......... 1.9.17 -> 1.9.17a 
      [INFO] com.google.appengine:appengine-api-stubs ........... 1.9.17 -> 1.9.17a 
      [INFO] com.google.appengine:appengine-testing ............. 1.9.17 -> 1.9.17a 
      [INFO] javax.servlet:servlet-api ......................... 2.5 -> 3.0-alpha-1 
      [INFO] junit:junit ...................................... 4.12-beta-1 -> 4.12 
      [INFO] org.mockito:mockito-all ............................. 1.9.5 -> 1.10.17 
      [INFO] 
      [INFO] 
      [INFO] --- versions-maven-plugin:2.1:display-plugin-updates (default) @ myapp --- 
      [INFO] 
      [INFO] The following plugin updates are available: 
      [INFO] com.google.appengine:appengine-maven-plugin ....... 1.9.17 -> 1.9.17a 
      [INFO] maven-compiler-plugin .................................... 3.1 -> 3.2 
      [INFO] maven-war-plugin ......................................... 2.4 -> 2.5 
      [INFO] 
      [WARNING] The following plugins do not have their version specified: 
      [WARNING] maven-clean-plugin ........................ (from super-pom) 2.6.1 
      [WARNING] maven-deploy-plugin ....................... (from super-pom) 2.8.2 
      [WARNING] maven-install-plugin ...................... (from super-pom) 2.5.2 
      [WARNING] maven-resources-plugin ...................... (from super-pom) 2.7 
      [WARNING] maven-site-plugin ........................... (from super-pom) 3.4 
      [WARNING] maven-surefire-plugin ...................... (from super-pom) 2.18 
      [INFO] 
      [INFO] Project defines minimum Maven version as: 3.1.0 
      [INFO] Plugins require minimum Maven version of: 3.1.0 
      [INFO] Note: the super-pom from Maven 3.1.0 defines some of the plugin 
      [INFO]  versions and may be influencing the plugins required minimum Maven 
      [INFO]  version. 
      [INFO] 
      [INFO] No plugins require a newer version of Maven than specified by the pom. 
      [INFO] 
      [INFO] 
      [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ myapp --- 
      [INFO] Using 'UTF-8' encoding to copy filtered resources. 
      [INFO] skip non existing resourceDirectory /var/jenkins/workspace/MyGuestbook/src/test/resources 
      [INFO] 
      [INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ myapp --- 
      [INFO] Nothing to compile - all classes are up to date 
      [INFO] 
      [INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ myapp --- 
      [INFO] Skipping execution of surefire because it has already been run for this configuration 
      [INFO] 
      [INFO] --- maven-war-plugin:2.4:war (default-war) @ myapp --- 
      [INFO] Packaging webapp 
      [INFO] Assembling webapp [myapp] in [/var/jenkins/workspace/MyGuestbook/target/myapp-1.0-SNAPSHOT] 
      [INFO] Processing war project 
      [INFO] Copying webapp webResources [/var/jenkins/workspace/MyGuestbook/src/main/webapp/WEB-INF] to [/var/jenkins/workspace/MyGuestbook/target/myapp-1.0-SNAPSHOT] 
      [INFO] Copying webapp resources [/var/jenkins/workspace/MyGuestbook/src/main/webapp] 
      [INFO] Webapp assembled in [154 msecs] 
      [INFO] Building war: /var/jenkins/workspace/MyGuestbook/target/myapp-1.0-SNAPSHOT.war 
      [INFO] ------------------------------------------------------------------------ 
      [INFO] BUILD SUCCESS 
      [INFO] ------------------------------------------------------------------------ 
      [INFO] Total time: 12.355s 
      [INFO] Finished at: Mon Dec 22 17:32:47 UTC 2014 
      [INFO] Final Memory: 20M/56M 
      [INFO] ------------------------------------------------------------------------ 
      [MyGuestbook] $ /bin/sh -xe /tmp/hudson5523568617447680772.sh 
      + gcloud --project=MyProject preview app deploy target/myapp-1.0-SNAPSHOT.war 
      ERROR: File [/var/jenkins/workspace/MyGuestbook/target/myapp-1.0-SNAPSHOT.war] is not a valid deployable item. 
      ERROR: (gcloud.preview.app.deploy) Errors occurred while parsing the App Engine app configuration: 
      Build step 'Execute shell' marked build as failure 
      Finished: FAILURE 
      

      appengine-web.xml:

      Yanlış yapıyorum
      <?xml version="1.0" encoding="utf-8"?> 
      <appengine-web-app xmlns="http://appengine.google.com/ns/1.0"> 
          <application>MyProject</application> 
          <version>${appengine.app.version}</version> 
          <threadsafe>true</threadsafe> 
      
          <system-properties> 
           <property name="java.util.logging.config.file" value="WEB-INF/logging.properties"/> 
          </system-properties> 
      </appengine-web-app> 
      

      , ben eksik bir şey? Kılavuzları aynen söyledikleri gibi takip ettim.

      Google Kaynağı'nı depo ve Github olarak kullanmayı denedim. Hiç birşey çalışmıyor.

      DÜZENLEME:

      Çalışıyor:

      Updating module [default] from file [/tmp/appcfgpyASfUun/app.yaml] 
      09:15 PM Host: appengine.google.com 
      09:15 PM Application: esoteric-cab-803; version: 1 
      09:15 PM 
      Starting update of app: esoteric-cab-803, version: 1 
      09:15 PM Getting current resource limits. 
      09:15 PM Scanning files on local disk. 
      09:15 PM Cloning 6 application files. 
      09:15 PM Uploading 3 files and blobs. 
      09:15 PM Uploaded 3 files and blobs. 
      09:15 PM Compilation starting. 
      09:15 PM Compilation completed. 
      09:15 PM Starting deployment. 
      09:15 PM Checking if deployment succeeded. 
      09:15 PM Deployment successful. 
      09:15 PM Checking if updated app version is serving. 
      09:15 PM Completed update of app: esoteric-cab-803, version: 1 
      Finished: SUCCESS 
      

      Ne harika bir manzara!

  • +0

    Eğer '$ yerine çalıştım {appengine.app.version gerçek değeriyle} –

    +0

    @IgorArtamonov Evet, onu '1' ile değiştirmeye çalıştım. – LuckyLuke

    +0

    ve 'MyProject 'gerçek uygulama kimliğiyle değiştirildi, değil mi? –

    cevap

    7
    sizin Jenkins komut başarısız inşa çünkü dağıtmak için başarısız oluyor

    : adım, komut dosyası durumu 0. Başka bir şey olarak kabul edilir ile döner emin olmak zorundayız "kabuk çalıştır" sırasında

    Build step 'Execute shell' marked build as failure

    hatası. See this SO answer to a similar issue.

    sizin "kabuk çalıştır" bölümünde, bu biri olduğunu görüntülenir:

    [MyGuestbook] $ /bin/sh -xe /tmp/hudson5523568617447680772.sh 
    + gcloud --project=MyProject preview app deploy target/myapp-1.0-SNAPSHOT.war 
    ERROR: File [/var/jenkins/workspace/MyGuestbook/target/myapp-1.0-SNAPSHOT.war] is not a valid deployable item. 
    ERROR: (gcloud.preview.app.deploy) Errors occurred while parsing the App Engine app configuration: 
    Build step 'Execute shell' marked build as failure 
    Finished: FAILURE 
    

    Bu durum kodu komut döndü çünkü yapı bölümleri "kabuk Yürütme" başarısız durum kodu döndürdü gibi görünüyor gcloud komutundan. Dokümanlara here, you can see that it doesn't accept .war archives, but only unpacked war folders'u kontrol ederseniz. Sadece

    gcloud --project=MyProject preview app deploy target/myapp-1.0-SNAPSHOT 
    

    için

    gcloud --project=MyProject preview app deploy target/myapp-1.0-SNAPSHOT.war 
    

    gelen hattını değiştirebilir ve bu noktada, yapılı "kabuk çalıştır" bölümü düzgün çalışır ve bir bütün tamamlamalıdır şekilde Jenkins inşa doğru şekilde.

    Gradle

    Eğer yapı için gradle kullanıyorsanız, zaten patlatılmış uygulama dizini üreten muhtemeldir:

    build/exploded-app 
    
    +1

    Yılın adamı: @ anonymous4444! Bundan dolayı bütün günlerimi neredeyse tüm saçlarımı kaybettim. Çok teşekkür ederim. Dolayısıyla dokümantasyon Google'da yanlış. – LuckyLuke

    +1

    Ah harika! Bunun senin için çalıştığını duyduğuma çok sevindim. İlgi alanı dışında, sizi WAR-yapılandırılmış klasör yerine '.war 'dosyasını kullanmak için yönlendiren dokümanlar sayfasını bağlayabilir misiniz? (PS - punt plox gönder?) – Nick

    +1

    Ödül alacaksın (sana vermeden önce 12 saat beklemem gerekecek). Evet; https://cloud.google.com/tools/repo/push-to-deploy Ara: 'gcloud --project = önizleme uygulaması hedef dağıtın/*. war' – LuckyLuke