React + Elixir/Phoenix back-end

We have a React front-end (used create-react-app) with a Phoenix (Elixir) Postgres backend.

I’ve not had luck running the stock Elixir config because my Phoenix app is nested in a folder called under ~/src.

I’ve listed my config.yml below for reference. Has anyone else solved this already with a similar stack?

version: 2
# specify the version here
- image: circleci/elixir:latest-node

  # Specify service dependencies here if necessary
  # CircleCI maintains a library of pre-built images
  # documented at
  - image: circleci/postgres:10.2-alpine-ram

working_directory: ~/app_name/src/server
  - checkout

  # specify any bash command here prefixed with `run: `
  - run: mix deps.get
  - run: mix ecto.create
  - run: mix test

Can you expand on that? I guess that means “it’s not working”, but what problem did you run into specifically? Did you get errors?

Would you repair the code formatting on the above config? I doubt there is a validity problem in your YAML, but it’s good to check.

I apologize, that’s not very helpful, is it?

The error specifically is as follows:
#!/bin/bash -eo pipefail
mix deps.get
** (Mix) Could not find a Mix.Project, please ensure you are running Mix in a directory with a mix.exs file
Exited with code 1

I assume this is failing because it’s expectinga mix.exs file in the root folder, but the “backend” application is stored in a sub-folder in the solution (./src/server).

I thought I had fixed the issue by changing the working_directory to: ./src/server, but that didn’t seem to work. Stated differently, I’m not sure how to tell circleci to change to a sub-folder before performing a series of actions.

1 Like