1

我创建了一个 CircleCI 配置,它将针对我的 laravel 应用程序运行我的 PHPUnit 测试,并且可以 100% 运行,但是我现在正在尝试将工作流添加到 SSH 并将我的应用程序部署到 AWS EC2 服务器,我收到以下错误:

您的配置文件有错误,可能无法正确运行:发现 2 个架构违规 未找到所需的密钥 [jobs] 未找到所需的密钥 [版本]

但是我看不到我的 CircleCI 配置文件有问题,我在某处犯了错误吗?

version: 2
jobs:
  build:
    docker:
      - image: circleci/php:7.1-browsers
    working_directory: ~/laravel
    steps:
      - checkout

      - run:
         name: Download NodeJS v6
         command: curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -

      - run:
         name: Install SQLite and NodeJS 6
         command: sudo apt-get install -y libsqlite3-dev nodejs

      - run:
         name: Setup Laravel testing environment variables for CircleCI test
         command: cp .env.circleci .env

      - run:
         name: Update composer to latest version
         command: composer self-update

      - restore_cache:
          keys:
            - composer-v1-{{ checksum "composer.json" }}
            - composer-v1-
      - run: composer install -n --prefer-dist --ignore-platform-reqs
      - save_cache:
          key: composer-v1-{{ checksum "composer.json" }}
          paths:
            - vendor

      - restore_cache:
          key: dependency-cache-{{ checksum "package.json" }}
      - run:
          name: Install NodeJS Packages
          command: npm install
      - save_cache:
          key: dependency-cache-{{ checksum "package.json" }}
          paths:
            - ./node_modules

      - run:
         name: Create SQLite Database
         command: touch database/database.sqlite

      - run:
         name: Migrate Laravel Database
         command: php artisan migrate --database=sqlite --force

      - run:
         name: Run NPM
         command: npm run production

      # Run Laravel Server for front-end tests
      - run:
         name: Run Laravel Server
         command: php artisan serve
         background: true

      - run:
         name: Run PHPUnit Tests
         command: vendor/bin/phpunit
 deploy:
    machine:
      enabled: true
    steps:
      - run:
          name: Deploy Over SSH
          command: |
            ssh $SSH_USER@$SSH_HOST "cd /var/www/html"

workflows:
  version: 2
  build-and-deploy:
    jobs:
      - build
      - deploy:
          requires:
            - build
          filters:
            branches:
              only: master

任何帮助表示赞赏,谢谢!

4

1 回答 1

0

CircleCI 有 AWS 部署的文档。看这里https://circleci.com/docs/1.0/continuous-deployment-with-aws-codedeploy/

我认为您的问题在于 AWS 的 SSH 授权。您可以在本地尝试并确保您的授权成功,然后对您的 AWS 执行相同的操作。

于 2018-06-08T10:49:38.083 回答