Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
4236861d
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,发现更多精彩内容 >>
提交
4236861d
编写于
12月 07, 2015
作者:
A
Achilleas Pipinellis
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Clean up Redis CI service example [ci skip]
上级
4fc9e694
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
50 addition
and
22 deletion
+50
-22
doc/ci/services/redis.md
doc/ci/services/redis.md
+50
-22
未找到文件。
doc/ci/services/redis.md
浏览文件 @
4236861d
#
#
Using Redis
# Using Redis
It's possible to use Redis database test your apps during builds.
As many applications depend on Redis as their key-value store, you will
eventually need it in order for your tests to run. Below you are guided how to
do this with the Docker and Shell executors of GitLab Runner.
##
#
Use Redis with Docker executor
## Use Redis with Docker executor
If you are using our Docker integration you basically have everything already.
If you are using our Docker integration you basically have everything set up
already.
1.
Add this to your
`.gitlab-ci.yml`
:
First, in your
`.gitlab-ci.yml`
add
:
services:
- redis
```
yaml
services
:
-
redis:latest
```
2.
Configure your application to use the database:
Then you need to configure your application to use the Redis database, for
example:
Host: redis
```
bash
Host: redis
```
3.
You can also use any other available on
[
DockerHub
](
https://hub.docker.com/_/redis/
)
. For example:
`redis:2.6`
.
And that's it. Redis will now be available to be used within your testing
framework.
Example: https://gitlab.com/gitlab-examples/redis/blob/master/.gitlab-ci.yml
If you want to use any other version of Redis, check the available versions
on
[
Docker Hub
](
https://hub.docker.com/_/redis/
)
.
##
#
Use Redis with Shell executor
## Use Redis with Shell executor
It's possible to use Redis on manually configured servers that are using GitLab Runner with Shell executor.
Redis can also be used on manually configured servers that are using GitLab
Runner with the Shell executor.
1.
First
install the Redis server:
In your build machine
install the Redis server:
sudo apt-get install redis-server
```
bash
sudo
apt-get
install
redis-server
```
2.
Try to connect to the serv
er:
Verify that you can connect to the server with the
`gitlab-runner`
us
er:
# Try connecting the the Redis server
sudo -u gitlab-runner -H redis-cli
```
bash
# Try connecting the the Redis server
sudo
-u
gitlab-runner
-H
redis-cli
# Quit the session
127.0.0.1:6379> quit
# Quit the session
127.0.0.1:6379> quit
```
4.
Configure your application to use the databas
e:
Finally, configure your application to use the database, for exampl
e:
Host: localhost
```
bash
Host: localhost
```
## Example project
We have set up an
[
Example Redis Project
][
redis-example-repo
]
for your convenience
that runs on
[
GitLab.com
](
https://gitlab.com
)
using our publicly available
[
shared runners
](
../runners/README.md
)
.
Want to hack on it? Simply fork it, commit and push your changes. Within a few
moments the changes will be picked by a public runner and the build will begin.
[
redis-example-repo
]:
https://gitlab.com/gitlab-examples/redis
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录