React + Elixir/Phoenix back-end

react

#1

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
jobs:
build:
docker:
# 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 https://circleci.com/docs/2.0/circleci-images/
  - image: circleci/postgres:10.2-alpine-ram

working_directory: ~/app_name/src/server
steps:
  - checkout

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

#2

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.


#3

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.


#4