.circleci/config.yml in qiita_trend-0.3.7 vs .circleci/config.yml in qiita_trend-0.3.8

- old
+ new

@@ -1,6 +1,8 @@ version: 2.1 +orbs: + slack: circleci/slack@3.4.2 executors: base: docker: - image: circleci/ruby:2.6.0 environment: @@ -71,17 +73,10 @@ --format RspecJunitFormatter \ --out test_results/rspec.xml \ --format progress \ $TEST_FILES - create-document: - steps: - - run: - name: Create document - command: | - bundle exec yard - collect-reports: steps: # ref:https://circleci.com/docs/ja/2.0/configuration-reference/#store_test_results - store_test_results: path: test_results @@ -91,10 +86,17 @@ destination: test-results - store_artifacts: # カバレッジの結果をcoverage-resultsディレクトリに吐き出す path: coverage destination: coverage-results + + create-document: + steps: + - run: + name: Create document + command: | + bundle exec yard - store_artifacts: # ドキュメントの結果をyard-resultsディレクトリに吐き出す path: ./doc destination: yard-results @@ -123,10 +125,16 @@ git config user.name dodonki1223 git config user.email $RUBYGEMS_EMAIL bundle exec rake build bundle exec rake release + deploy-notification: + steps: + - slack/status: + success_message: ':circleci-pass: RubyGemsにデプロイが完了しました\n:github_octocat: User: $CIRCLE_USERNAME' + failure_message: ':circleci-fail: RubyGemsにデプロイが失敗しました\n:github_octocat: User: $CIRCLE_USERNAME' + jobs: setup: executor: base steps: - checkout @@ -147,19 +155,26 @@ executor: base steps: - using-workspace - install-bundler - run-tests - - create-document - collect-reports + document: + executor: base + steps: + - using-workspace + - install-bundler + - create-document + deploy: executor: base steps: - using-workspace - install-bundler - deploy-rubygems + - deploy-notification workflows: version: 2.1 main: jobs: @@ -168,12 +183,26 @@ requires: - setup - test: requires: - setup - - deploy: + - document: requires: + - setup + - slack/approval-notification: + message: ':circleci-pass: RubyGemsへのデプロイ準備が整っています\n:github_octocat: User: $CIRCLE_USERNAME\nデプロイを実行する場合は *Approve* を押してください' + requires: - lint - test filters: branches: - only: master # masterブランチの時だけDeployJobを実行するようにする + only: master + - approval-job: + type: approval + requires: + - slack/approval-notification + - deploy: + requires: + - approval-job + filters: + branches: + only: master