diff options
author | Rémy Coutable <remy@rymai.me> | 2016-10-11 09:36:03 +0200 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-10-11 09:36:03 +0200 |
commit | 8a3f389df620570e2b51f088573b90644c53348e (patch) | |
tree | 525d31a706e85f1a8c77abca0cadc527e5bb36d9 /doc/ci | |
parent | 987c21f51ea67f1bd00fe50e61941920bc1feaa4 (diff) | |
download | gitlab-ce-8a3f389df620570e2b51f088573b90644c53348e.tar.gz |
Improve a bit the example .gitlab-ci.yml for Phoenixnahtnam/gitlab-ce-ci-test-phoenix
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'doc/ci')
-rw-r--r-- | doc/ci/examples/test-phoenix-application.md | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/doc/ci/examples/test-phoenix-application.md b/doc/ci/examples/test-phoenix-application.md index 78cab2c0aeb..150698ca04b 100644 --- a/doc/ci/examples/test-phoenix-application.md +++ b/doc/ci/examples/test-phoenix-application.md @@ -1,7 +1,7 @@ ## Test a Phoenix application -This example demonstrates the integration of Gitlab CI with Phoenix, elixir and -postgres. +This example demonstrates the integration of Gitlab CI with Phoenix, Elixir and +Postgres. ### Add `.gitlab-ci.yml` file to project @@ -9,10 +9,10 @@ The following `.gitlab-ci.yml` should be added in the root of your repository to trigger CI: ```yaml -image: elixir:1.3.1 +image: elixir:1.3 services: - - postgres:9.5.3 + - postgres:9.6 variables: MIX_ENV: "test" @@ -30,16 +30,17 @@ test: - mix test ``` -The variables will set the Mix environment to test. The -before_script will install `psql`, and other phoenix dependencies and will also +The variables will set the Mix environment to "test". The +`before_script` will install `psql`, some Phoenix dependencies, and will also run your migrations. -Finally, the test script will run your tests. +Finally, the test `script` will run your tests. ### Update the Config Settings In `config/test.exs`, update the database hostname: -``` + +```elixir config :my_app, MyApp.Repo, hostname: if(System.get_env("CI"), do: "postgres", else: "localhost"), ``` @@ -49,4 +50,7 @@ config :my_app, MyApp.Repo, If you do not have any migrations yet, you will need to create an empty `.gitkeep` file in `priv/repo/migrations`. -**Source**: https://medium.com/@nahtnam/using-phoenix-on-gitlab-ci-5a51eec81142 +### Sources + +- https://medium.com/@nahtnam/using-phoenix-on-gitlab-ci-5a51eec81142 +- https://davejlong.com/ci-with-phoenix-and-gitlab/ |