docker, rails, postgresqlでcircleciのテストをした後herokuにデプロイできるようにしたいのですがcircleciからデプロイしたところ
[93b7b380-6668-4fbd-a3c8-9d6e51fc219d] ActionView::Template::Error (Webpacker can't find application.js in /app/public/packs/manifest.json. Possible causes: 2021-07-28T08:52:31.589457+00:00 app[web.1]: 1. You want to set webpacker.yml value of compile to true for your environment 2021-07-28T08:52:31.589457+00:00 app[web.1]: unless you are using the `webpack -w` or the webpack-dev-server. 2021-07-28T08:52:31.589457+00:00 app[web.1]: 2. webpack has not yet re-run to reflect updates. 2021-07-28T08:52:31.589458+00:00 app[web.1]: 3. You have misconfigured Webpacker's config/webpacker.yml file. 2021-07-28T08:52:31.589458+00:00 app[web.1]: 4. Your webpack configuration is not creating a manifest. 2021-07-28T08:52:31.589459+00:00 app[web.1]: Your manifest contains: 2021-07-28T08:52:31.589460+00:00 app[web.1]: { 2021-07-28T08:52:31.589460+00:00 app[web.1]: } 2021-07-28T08:52:31.589460+00:00 app[web.1]: ): 2021-07-28T08:52:31.589461+00:00 app[web.1]: [93b7b380-6668-4fbd-a3c8-9d6e51fc219d] 7: <%= csp_meta_tag %> 2021-07-28T08:52:31.589461+00:00 app[web.1]: [93b7b380-6668-4fbd-a3c8-9d6e51fc219d] 8: 2021-07-28T08:52:31.589462+00:00 app[web.1]: [93b7b380-6668-4fbd-a3c8-9d6e51fc219d] 9: <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %> 2021-07-28T08:52:31.589462+00:00 app[web.1]: [93b7b380-6668-4fbd-a3c8-9d6e51fc219d] 10: <%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %> 2021-07-28T08:52:31.589463+00:00 app[web.1]: [93b7b380-6668-4fbd-a3c8-9d6e51fc219d] 11: 2021-07-28T08:52:31.589463+00:00 app[web.1]: [93b7b380-6668-4fbd-a3c8-9d6e51fc219d] 12: <link href="https://use.fontawesome.com/releases/v5.15.3/css/all.css" rel="stylesheet"> 2021-07-28T08:52:31.589464+00:00 app[web.1]: [93b7b380-6668-4fbd-a3c8-9d6e51fc219d] 13: </head> 2021-07-28T08:52:31.589464+00:00 app[web.1]: [93b7b380-6668-4fbd-a3c8-9d6e51fc219d] 2021-07-28T08:52:31.589465+00:00 app[web.1]: [93b7b380-6668-4fbd-a3c8-9d6e51fc219d] app/views/layouts/application.html.erb:10
このようなエラーが出ます。herokuに直接デプロイした場合はこのようなエラーは出ません。
version: 2.1 orbs: ruby: circleci/ruby@1.0 node: circleci/node@2 heroku: circleci/heroku@1.2.6 jobs: build: docker: - image: cimg/ruby:2.7.3-node steps: - checkout - ruby/install-deps - node/install-packages: pkg-manager: yarn cache-key: "yarn.lock" test: docker: - image: cimg/ruby:2.7.3-node - image: circleci/postgres:9.5-alpine environment: POSTGRES_USER: postgres POSTGRES_DB: ajax_test POSTGRES_PASSWORD: postgres environment: BUNDLE_JOBS: "3" BUNDLE_RETRY: "3" PGHOST: 127.0.0.1 PGUSER: postgres PGPASSWORD: postgres RAILS_ENV: test steps: - checkout - ruby/install-deps - node/install-packages: pkg-manager: yarn cache-key: "yarn.lock" - run: name: Wait for DB command: dockerize -wait tcp://localhost:5432 -timeout 1m - run: name: Database setup command: bundle exec rails db:schema:load --trace - run: name: run tests command: | mkdir /tmp/test-results TEST_FILES="$(circleci tests glob "spec/**/*_spec.rb" | \ circleci tests split --split-by=timings)" bundle exec rspec \ --format progress \ --format RspecJunitFormatter \ --out /tmp/test-results/rspec.xml \ --format progress \ $TEST_FILES deploy: docker: - image: cimg/ruby:2.7.3-node steps: - checkout - setup_remote_docker: version: 19.03.13 - heroku/install - run: name: heroku login command: heroku container:login - run: name: push docker image command: heroku container:push web -a $HEROKU_APP_NAME - run: name: release docker image command: heroku container:release web -a $HEROKU_APP_NAME - run: name: database setup command: heroku run rails db:migrate -a $HEROKU_APP_NAME workflows: version: 2 build_test_and_deploy: jobs: - build - test: requires: - build - deploy: requires: - test filters: branches: only: main
.circleci/config.ymlは上記のようです。よろしくお願いします。
あなたの回答
tips
プレビュー