2015-12-21 11 views
5

私は私の最初のテストプロジェクトをビルドするために、「https://cloud.google.com/tools/cloud-repositories/docs/push-to-deployを」フォローアップが、私はのMVNのgcloud:展開[エラーのgcloud appコマンドの終了コードである:1]

行うとき:

を「MVNのgcloudを展開」、と私はからのエラーの下に取得します

[workspace] $ /opt/bitnami/apps/jenkins/jenkins_home/tools/hudson.tasks.Maven_MavenInstallation/jenkins-maven/bin/mvn clean install gcloud:deploy 
[INFO] Scanning for projects... 
[INFO]                   
[INFO] ------------------------------------------------------------------------ 
[INFO] Building jenkins-test-java 1.0-SNAPSHOT 
[INFO] ------------------------------------------------------------------------ 
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ jenkins-test-java --- 
[INFO] Deleting /opt/bitnami/apps/jenkins/jenkins_home/jobs/dev-jenkins-test/workspace/target 
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ jenkins-test-java --- 
[INFO] Using 'UTF-8' encoding to copy filtered resources. 
[INFO] skip non existing resourceDirectory /opt/bitnami/apps/jenkins/jenkins_home/jobs/dev-jenkins-test/workspace/src/main/resources 
[INFO] 
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @ jenkins-test-java --- 
[INFO] No sources to compile 
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ jenkins-test-java --- 
[INFO] Using 'UTF-8' encoding to copy filtered resources. 
[INFO] skip non existing resourceDirectory /opt/bitnami/apps/jenkins/jenkins_home/jobs/dev-jenkins-test/workspace/src/test/resources 
[INFO] 
[INFO] --- maven-compiler-plugin:2.5.1:testCompile (default-testCompile) @ jenkins-test-java --- 
[INFO] No sources to compile 
[INFO] 
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ jenkins-test-java --- 
[INFO] No tests to run. 
[INFO] 
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ jenkins-test-java --- 
[WARNING] JAR will be empty - no content was marked for inclusion! 
[INFO] Building jar: /opt/bitnami/apps/jenkins/jenkins_home/jobs/dev-jenkins-test/workspace/target/jenkins-test-java-1.0-SNAPSHOT.jar 
[INFO] 
[INFO] --- maven-install-plugin:2.4:install (default-install) @ jenkins-test-java --- 
[INFO] Installing /opt/bitnami/apps/jenkins/jenkins_home/jobs/dev-jenkins-test/workspace/target/jenkins-test-java-1.0-SNAPSHOT.jar to /home/tomcat/.m2/repository/com/google/appengine/demos/jenkins-test-java/1.0-SNAPSHOT/jenkins-test-java-1.0-SNAPSHOT.jar 
[INFO] Installing /opt/bitnami/apps/jenkins/jenkins_home/jobs/dev-jenkins-test/workspace/pom.xml to /home/tomcat/.m2/repository/com/google/appengine/demos/jenkins-test-java/1.0-SNAPSHOT/jenkins-test-java-1.0-SNAPSHOT.pom 
[INFO] 
[INFO] >>> gcloud-maven-plugin:2.0.9.90.v20151210:deploy (default-cli) > package @ jenkins-test-java >>> 
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ jenkins-test-java --- 
[INFO] Using 'UTF-8' encoding to copy filtered resources. 
[INFO] skip non existing resourceDirectory /opt/bitnami/apps/jenkins/jenkins_home/jobs/dev-jenkins-test/workspace/src/main/resources 
[INFO] 
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @ jenkins-test-java --- 
[INFO] No sources to compile 
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ jenkins-test-java --- 
[INFO] Using 'UTF-8' encoding to copy filtered resources. 
[INFO] skip non existing resourceDirectory /opt/bitnami/apps/jenkins/jenkins_home/jobs/dev-jenkins-test/workspace/src/test/resources 
[INFO] 
[INFO] --- maven-compiler-plugin:2.5.1:testCompile (default-testCompile) @ jenkins-test-java --- 
[INFO] No sources to compile 
[INFO] 
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ jenkins-test-java --- 
[INFO] No tests to run. 
[INFO] Skipping execution of surefire because it has already been run for this configuration 
[INFO] 
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ jenkins-test-java --- 
[WARNING] JAR will be empty - no content was marked for inclusion! 
[INFO] 
[INFO] <<< gcloud-maven-plugin:2.0.9.90.v20151210:deploy (default-cli) < package @ jenkins-test-java <<< 
[INFO] 
[INFO] --- gcloud-maven-plugin:2.0.9.90.v20151210:deploy (default-cli) @ jenkins-test-java --- 
[INFO] Running gcloud app deploy... 
[INFO] Running python -S /usr/local/share/google/google-cloud-sdk/lib/googlecloudsdk/gcloud/gcloud.py --quiet --project=jenkins-test-java preview app deploy /opt/bitnami/apps/jenkins/jenkins_home/jobs/dev-jenkins-test/workspace/target/appengine-staging/app.yaml 
[INFO] You do not currently have this command group installed. Using it 
[INFO] requires the installation of components: [preview] 
[INFO] ERROR: (gcloud) You cannot perform this action because you do not have permission to modify the Google Cloud SDK installation directory [/usr/local/share/google/google-cloud-sdk]. 
[INFO] 
[INFO] Re-run the command with sudo: sudo gcloud ... 
[ERROR] Error: gcloud app command with exit code : 1 
[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD FAILURE 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 3.628 s 
[INFO] Finished at: 2015-12-21T06:29:47+00:00 
[INFO] Final Memory: 11M/56M 
[INFO] ------------------------------------------------------------------------ 
[ERROR] Failed to execute goal com.google.appengine:gcloud-maven- plugin:2.0.9.90.v20151210:deploy (default-cli) on project jenkins-test-java: Error: gcloud app command exit code is: 1 -> [Help 1] 
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. 
[ERROR] Re-run Maven using the -X switch to enable full debug logging. 
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles: 
[ERROR] [Help 1]  http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException 
Build step 'Invoke top-level Maven targets' marked build as failure 
Finished: FAILURE 

と私のpom.xmlは次のとおりです:コンソールジェンキンス

<?xml version="1.0" encoding="UTF-8"?> 
<project xmlns="http://maven.apache.org/POM/4.0.0" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0  http://maven.apache.org/xsd/maven-4.0.0.xsd"> 

    <modelVersion>4.0.0</modelVersion> 
    <groupId>com.google.appengine.demos</groupId> 
    <artifactId>jenkins-test-java</artifactId> 
    <packaging>jar</packaging> 
    <version>1.0-SNAPSHOT</version> 
    <properties> 
    <appengine.target.version>1.9.28</appengine.target.version> 
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
    </properties> 

    <dependencies> 
    <!-- Compile/runtime dependencies --> 
    <dependency> 
     <groupId>com.google.appengine</groupId> 
     <artifactId>appengine-api-1.0-sdk</artifactId> 
     <version>${appengine.target.version}</version> 
    </dependency> 
    </dependencies> 

<build> 
    <!-- needed for enabling compile/reload on save in mordern IDEs...--> 
    <plugins> 
     <plugin> 
     <groupId>org.apache.maven.plugins</groupId> 
     <version>2.5.1</version> 
     <artifactId>maven-compiler-plugin</artifactId> 
     <configuration> 
      <source>1.7</source> 
      <target>1.7</target> 
     </configuration> 
    </plugin> 
    <plugin> 
     <groupId>com.google.appengine</groupId> 
     <artifactId>gcloud-maven-plugin</artifactId> 
     <version>2.0.9.90.v20151210</version> 
     <configuration> 
      <gcloud_project>jenkins-test-java</gcloud_project> 
     </configuration> 
    </plugin> 
    </plugins> 
</build> 
</project> 

は君たちに感謝:)

答えて

2

エラーがそれをすべて言う:

ERROR: (gcloud) You cannot perform this action because you do not have permission to modify the Google Cloud SDK installation directory
[/usr/local/share/google/google-cloud-sdk].

私は3つのオプションを参照してください。

  • は、sudoでまたはrootとしてコマンドを実行します。あなたのユーザーが書き込み権限を持っている
  • どこかにGoogleのクラウド-SDKをインストールするユーザーのための

  • 作るにGoogleクラウド-SDKディレクトリ(/ usr/local /共有/グーグル/グーグル、クラウド-SDK)を書き込み可能と(docsを参照)のようなコマンドを実行します。

    mvn gcloud:run -Dgcloud.gcloud_directory="absolute-path-to-the-gcloud-directory" 
    
  • ユーザーが許可を書いて、あなたのpom.xmlでのgcloudディレクトリを設定しているどこかにGoogleのクラウド-SDKをインストール(docsを参照してください):

    <plugin> 
        <groupId>com.google.appengine</groupId> 
        <artifactId>gcloud-maven-plugin</artifactId> 
        <version>>2.0.9.72.v20150804</version> 
        <configuration> 
        <gcloud_directory>/usr/foo/private/google-cloud-sdk</gcloud_directory> 
        ... 
    
+0

ありがとうございました。私はその理由が1. "/ usr/local/share/google/google-cloud-sdk"の権限をすべてのユーザーに書き込み可能に変更しています。 2. "pom.xml"を my_google_project_idに変更します。 –

関連する問題