Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/358.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java CircleCI+;格拉德尔+;Heroku部署_Java_Heroku_Gradle_Circleci - Fatal编程技术网

Java CircleCI+;格拉德尔+;Heroku部署

Java CircleCI+;格拉德尔+;Heroku部署,java,heroku,gradle,circleci,Java,Heroku,Gradle,Circleci,我试图为Gradle和Heroku提供连续部署,但由于某些原因,部署步骤没有运行 我已经用Heroku键更新了circle ci version: 2 jobs: build: docker: - image: circleci/openjdk:8-jdk working_directory: ~/repo environment: JVM_OPTS: -Xmx3200m TERM: dumb steps:

我试图为Gradle和Heroku提供连续部署,但由于某些原因,部署步骤没有运行


我已经用Heroku键更新了circle ci

version: 2
jobs:
  build:
    docker:
      - image: circleci/openjdk:8-jdk

    working_directory: ~/repo

    environment:
      JVM_OPTS: -Xmx3200m
      TERM: dumb

    steps:
      - checkout

      - restore_cache:
          keys:
          - v1-dependencies-{{ checksum "build.gradle" }}
          - v1-dependencies-

      - run: gradle dependencies

      - save_cache:
          paths:
            - ~/.m2
          key: v1-dependencies-{{ checksum "build.gradle" }}

      # run tests!
      - run: gradle test
deployment:
  staging:
    branch: master

    heroku:
      appname: my-heroku-app

你们能帮帮我吗?部署步骤是否在正确的位置?

您正在为使用部署配置,但正在使用

从CircleCI 2.0的文档中:

通过CircleCI UI的内置Heroku集成不可用 为CircleCI 2.0实现。但是,可以将其部署到 赫罗库

要使用CircleCI 2.0在heroku上部署,您需要:

  • 将环境变量HEROKU\u LOGIN、HEROKU\u API\u KEY、HEROKU\u APP\u NAME添加到CircleCI项目设置
    https://circleci.com/gh///edit#env-变量
  • 创建一个不带密码短语的私有ssh密钥,并将其添加到CircleCI项目设置中
    https://circleci.com/gh/https://circleci.com/gh///edit#ssh
    主机名git.heroku.com
  • 在.circleci/config.yml文件中添加带有ssh密钥指纹的步骤
  • -运行:
    名称:Setup Heroku
    命令:|
    ssh keyscan-H heroku.com>~/.ssh/known_hosts
    
    cat>~/.netrc>~/.ssh/config您正在为使用部署配置,但您正在使用

    从CircleCI 2.0的文档中:

    通过CircleCI UI的内置Heroku集成不可用 为CircleCI 2.0实现。但是,可以将其部署到 赫罗库

    要使用CircleCI 2.0在heroku上部署,您需要:

  • 将环境变量HEROKU\u LOGIN、HEROKU\u API\u KEY、HEROKU\u APP\u NAME添加到CircleCI项目设置
    https://circleci.com/gh///edit#env-变量
  • 创建一个不带密码短语的私有ssh密钥,并将其添加到CircleCI项目设置中
    https://circleci.com/gh/https://circleci.com/gh///edit#ssh
    主机名git.heroku.com
  • 在.circleci/config.yml文件中添加带有ssh密钥指纹的步骤
  • -运行:
    名称:Setup Heroku
    命令:|
    ssh keyscan-H heroku.com>~/.ssh/known_hosts
    cat>~/.netrc>~/.ssh/config
    
      - run:
          name: Setup Heroku
          command: |  
            ssh-keyscan -H heroku.com >> ~/.ssh/known_hosts
            cat > ~/.netrc << EOF
            machine api.heroku.com
              login $HEROKU_LOGIN
              password $HEROKU_API_KEY
            EOF
            cat >> ~/.ssh/config << EOF
            VerifyHostKeyDNS yes
            StrictHostKeyChecking no
            EOF
      - add_ssh_keys:
          fingerprints:
            - "<SSH KEY fingerprint>"
      - deploy:
          name: "Deploy to Heroku"
          command: git push --force git@heroku.com:$HEROKU_APP_NAME.git HEAD:refs/heads/master