Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
987c21f5
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
987c21f5
编写于
7月 04, 2016
作者:
M
Manthan Mallikarjun
提交者:
Rémy Coutable
10月 11, 2016
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add an example for testing a phoenix application with Gitlab CI.
Signed-off-by:
N
Rémy Coutable
<
remy@rymai.me
>
上级
73adae0f
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
54 addition
and
0 deletion
+54
-0
CHANGELOG
CHANGELOG
+1
-0
doc/ci/examples/README.md
doc/ci/examples/README.md
+1
-0
doc/ci/examples/test-phoenix-application.md
doc/ci/examples/test-phoenix-application.md
+52
-0
未找到文件。
CHANGELOG
浏览文件 @
987c21f5
...
...
@@ -9,6 +9,7 @@ v 8.13.0 (unreleased)
- Add `/projects/visible` API endpoint (Ben Boeckel)
- Fix centering of custom header logos (Ashley Dumaine)
- ExpireBuildArtifactsWorker query builds table without ordering enqueuing one job per build to cleanup
- Add an example for testing a phoenix application with Gitlab CI in the docs (Manthan Mallikarjun)
- AbstractReferenceFilter caches project_refs on RequestStore when active
- Replaced the check sign to arrow in the show build view. !6501
- Add a /wip slash command to toggle the Work In Progress status of a merge request. !6259 (tbalthazar)
...
...
doc/ci/examples/README.md
浏览文件 @
987c21f5
...
...
@@ -11,6 +11,7 @@ Apart from those, here is an collection of tutorials and guides on setting up yo
-
[
Test and deploy a Python application to Heroku
](
test-and-deploy-python-application-to-heroku.md
)
-
[
Test a Clojure application
](
test-clojure-application.md
)
-
[
Test a Scala application
](
test-scala-application.md
)
-
[
Test a Phoenix application
](
test-phoenix-application.md
)
-
[
Using `dpl` as deployment tool
](
deployment/README.md
)
-
[
Blog post about using GitLab CI for iOS projects
](
https://about.gitlab.com/2016/03/10/setting-up-gitlab-ci-for-ios-projects/
)
-
[
Repositories with examples for various languages
](
https://gitlab.com/groups/gitlab-examples
)
...
...
doc/ci/examples/test-phoenix-application.md
0 → 100644
浏览文件 @
987c21f5
## Test a Phoenix application
This example demonstrates the integration of Gitlab CI with Phoenix, elixir and
postgres.
### Add `.gitlab-ci.yml` file to project
The following
`.gitlab-ci.yml`
should be added in the root of your
repository to trigger CI:
```
yaml
image
:
elixir:1.3.1
services
:
-
postgres:9.5.3
variables
:
MIX_ENV
:
"
test"
before_script
:
# Setup phoenix dependencies
-
apt-get update
-
apt-get install -y postgresql-client
-
mix local.hex --force
-
mix deps.get --only test
-
mix ecto.reset
test
:
script
:
-
mix test
```
The variables will set the Mix environment to test. The
before_script will install
`psql`
, and other phoenix dependencies and will also
run your migrations.
Finally, the test script will run your tests.
### Update the Config Settings
In
`config/test.exs`
, update the database hostname:
```
config :my_app, MyApp.Repo,
hostname: if(System.get_env("CI"), do: "postgres", else: "localhost"),
```
### Add the Migrations Folder
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
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录