毎日学習記録 9/12 circle ciのビルドで詰まった時

Share on:

概要

circle ciでブログの更新をする際に少し詰まったところを記載する

内容

デプロイであげたファイルが正しくないと言われるので、試したこと

ファイル検証

コマンドインストール

どうも調べるとcircle ciのコマンドで、ファイルの検証ができるっぽのでインストールを試みる。

$ curl -fLSs https://circle.ci/cli | bash
curl: (16) Error in the HTTP2 framing layer

無事失敗。。。。

公式を見るとbrewでのインストール方法があったので、迷わずbrewでインストールをする

brew install circleci

試して見る限り問題なく入っていることがわかった。

$ circleci
Use CircleCI from the command line.

This project is the seed for CircleCI's new command-line application.

For more help, see the documentation here: https://circleci.com/docs/2.0/local-cli/


Usage:
  circleci [command]

検証を実行

コマンド

circleci config validate

エラー内容

Error: ERROR IN CONFIG FILE:
[#/workflows/release] only 1 subschema matches out of 2
1. [#/workflows/release/jobs/1] 0 subschemas matched instead of one
|   1. [#/workflows/release/jobs/1] expected type: String, found: Mapping
|   |   SCHEMA:
|   |     type: string
|   |   INPUT:
|   |     deploy: null
|   |     requires:
|   |     - build
|   2. [#/workflows/release/jobs/1/requires] expected type: Mapping, found: Sequence
|   |   SCHEMA:
|   |     type: object
|   |   INPUT:
|   |     - build

調べてみたら、

workflows:
  version: 2
  release:
    jobs:
      - build
      # ●
      - deploy:
          requires:
            - build

      # × : requiresのインデントが足りないのが原因!
      - deploy:
        requires:
          - build 

修正後hugoをビルドしてみると、問題なくビルドできた。

$ hugo
 
                    | EN  
 -------------------+-----
   Pages            | 56  
   Paginator pages  |  2  
   Non-page files   |  0  
   Static files     | 68  
   Processed images |  0  
   Aliases          | 21  
   Sitemaps         |  1  
   Cleaned          |  0