DEV Community

Discussion on: Deploy Elixir + Phoenix to AWS ECS with GitLab CI and Terraform

Collapse
 
organicnz profile image
Tarlan Isaev 🍓

Couldn't trace out this error yet when pusshing code to my GitLab repo. Have you seen it before?

$ which elixir
/usr/local/bin/elixir
$ mix --version
Erlang/OTP 22 [erts-10.7.2.4] [source] [64-bit] [smp:1:1] [ds:1:1:10] [async-threads:1]
Mix 1.10.4 (compiled with Erlang/OTP 22)
$ ln -s /usr/local/bin/mix /usr/bin/mix
$ mix local.rebar --force

  • creating /root/.mix/rebar
  • creating /root/.mix/rebar3 $ mix local.hex --force
  • creating /root/.mix/archives/hex-0.20.5 $ mix deps.get --only test ** (Mix) Could not find a Mix.Project, please ensure you are running Mix in a directory with a mix.exs file Cleaning up file based variables 00:01 ERROR: Job failed: exit code 1
Collapse
 
hlappa profile image
Aleksi Holappa • Edited

Is this output on the CI or on your local machine? If local, what OS are you using?

Collapse
 
organicnz profile image
Tarlan Isaev 🍓 • Edited

Yeah, on CI. I've already pushed that code to my repo :)
pastebin.com/vdbDW8Um
gitlab.com/organicnz/myapp-terraform

Thread Thread
 
hlappa profile image
Aleksi Holappa • Edited

I see your problem! Please place the .gitlab-ci.yml to repository which contains your Elixir + Phoenix application. It should be placed to the root of the repository.

Second thing, never push the state files publicly to any platform. They should be ignored with .gitignore, crypted with git-crypt (or other encrypting tool) or the best solution would be to use remote state.

Thread Thread
 
organicnz profile image
Tarlan Isaev 🍓 • Edited

Would it be appropriate if I use your Elixir application for the CI github.com/hlappa/microservice_exe... or anyone? :)

Jeez, that's right I completely forgot to sanitise that area, already added .gitignore file then will try to figure out how to push it to the remote state on AWS :)