summaryrefslogtreecommitdiff
path: root/doc/ci/services
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2015-11-25 14:41:14 +0100
committerAchilleas Pipinellis <axilleas@axilleas.me>2015-12-08 18:25:24 +0200
commit4f074aaa14faa8a866f18a80f58b66cd023a141f (patch)
treee71668439dd0680336630f57dbdb356eb99e57f1 /doc/ci/services
parent033947de90163aeadf0b1ae2c0f5be1b8529088b (diff)
downloadgitlab-ce-4f074aaa14faa8a866f18a80f58b66cd023a141f.tar.gz
Introduce CI documentation for services and languages
Diffstat (limited to 'doc/ci/services')
-rw-r--r--doc/ci/services/README.md6
-rw-r--r--doc/ci/services/docker-services.md5
-rw-r--r--doc/ci/services/mysql.md72
-rw-r--r--doc/ci/services/postgres.md70
-rw-r--r--doc/ci/services/redis.md40
5 files changed, 193 insertions, 0 deletions
diff --git a/doc/ci/services/README.md b/doc/ci/services/README.md
new file mode 100644
index 00000000000..0550e9435a3
--- /dev/null
+++ b/doc/ci/services/README.md
@@ -0,0 +1,6 @@
+## GitLab CI Services
+
++ [Using MySQL](mysql.md)
++ [Using PostgreSQL](postgres.md)
++ [Using Redis](redis.md)
++ [Using Other Services](../docker/using_docker_images.html#how-to-use-other-images-as-services)
diff --git a/doc/ci/services/docker-services.md b/doc/ci/services/docker-services.md
new file mode 100644
index 00000000000..df36ebaf7d4
--- /dev/null
+++ b/doc/ci/services/docker-services.md
@@ -0,0 +1,5 @@
+## GitLab CI Services
+
++ [Using MySQL](mysql.md)
++ [Using PostgreSQL](postgres.md)
++ [Using Redis](redis.md)
diff --git a/doc/ci/services/mysql.md b/doc/ci/services/mysql.md
new file mode 100644
index 00000000000..3155af6b3e1
--- /dev/null
+++ b/doc/ci/services/mysql.md
@@ -0,0 +1,72 @@
+## Using MySQL
+
+It's possible to use MySQL database test your apps during builds.
+
+### Use MySQL with Docker executor
+
+If you are using our Docker integration you basically have everything already.
+
+1. Add this to your `.gitlab-ci.yml`:
+
+ services:
+ - mysql
+
+ variables:
+ # Configure mysql service (https://hub.docker.com/_/mysql/)
+ MYSQL_DATABASE: hello_world_test
+ MYSQL_ROOT_PASSWORD: mysql
+
+2. Configure your application to use the database:
+
+ Host: mysql
+ User: root
+ Password: mysql
+ Database: hello_world_test
+
+3. You can also use any other available on [DockerHub](https://hub.docker.com/_/mysql/). For example: `mysql:5.5`.
+
+Example: https://gitlab.com/gitlab-examples/mysql/blob/master/.gitlab-ci.yml
+
+### Use MySQL with Shell executor
+
+It's possible to use MySQL on manually configured servers that are using GitLab Runner with Shell executor.
+
+1. First install the MySQL server:
+
+ sudo apt-get install -y mysql-server mysql-client libmysqlclient-dev
+
+ # Pick a MySQL root password (can be anything), type it and press enter
+ # Retype the MySQL root password and press enter
+
+2. Create an user:
+
+ mysql -u root -p
+
+ # Create a user which will be used by your apps
+ # do not type the 'mysql>', this is part of the prompt
+ # change $password in the command below to a real password you pick
+ mysql> CREATE USER 'runner'@'localhost' IDENTIFIED BY '$password';
+
+ # Ensure you can use the InnoDB engine which is necessary to support long indexes
+ # If this fails, check your MySQL config files (e.g. `/etc/mysql/*.cnf`, `/etc/mysql/conf.d/*`) for the setting "innodb = off"
+ mysql> SET storage_engine=INNODB;
+
+ # Create the database
+ mysql> CREATE DATABASE IF NOT EXISTS `hello_world_test` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`;
+
+ # Grant necessary permissions on the database
+ mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, CREATE TEMPORARY TABLES, DROP, INDEX, ALTER, LOCK TABLES ON `hello_world_test`.* TO 'runner'@'localhost';
+
+ # Quit the database session
+ mysql> \q
+
+3. Try to connect to database:
+
+ sudo -u gitlab-runner -H mysql -u runner -p -D hello_world_test
+
+4. Configure your application to use the database:
+
+ Host: localhost
+ User: runner
+ Password: $password
+ Database: hello_world_test
diff --git a/doc/ci/services/postgres.md b/doc/ci/services/postgres.md
new file mode 100644
index 00000000000..e57f8c5944a
--- /dev/null
+++ b/doc/ci/services/postgres.md
@@ -0,0 +1,70 @@
+## Using PostgreSQL
+
+It's possible to use PostgreSQL database test your apps during builds.
+
+### Use PostgreSQL with Docker executor
+
+If you are using our Docker integration you basically have everything already.
+
+1. Add this to your `.gitlab-ci.yml`:
+
+ services:
+ - postgres
+
+ variables:
+ # Configure postgres service (https://hub.docker.com/_/postgres/)
+ POSTGRES_DB: hello_world_test
+ POSTGRES_USER: postgres
+ POSTGRES_PASSWORD: ""
+
+2. Configure your application to use the database:
+
+ Host: postgres
+ User: postgres
+ Password: postgres
+ Database: hello_world_test
+
+3. You can also use any other available on [DockerHub](https://hub.docker.com/_/postgres/). For example: `postgres:9.3`.
+
+Example: https://gitlab.com/gitlab-examples/postgres/blob/master/.gitlab-ci.yml
+
+### Use PostgreSQL with Shell executor
+
+It's possible to use PostgreSQL on manually configured servers that are using GitLab Runner with Shell executor.
+
+1. First install the PostgreSQL server:
+
+ sudo apt-get install -y postgresql postgresql-client libpq-dev
+
+2. Create an user:
+
+ # Install the database packages
+ sudo apt-get install -y postgresql postgresql-client libpq-dev
+
+ # Login to PostgreSQL
+ sudo -u postgres psql -d template1
+
+ # Create a user for runner
+ # Do not type the 'template1=#', this is part of the prompt
+ template1=# CREATE USER runner CREATEDB;
+
+ # Create the database & grant all privileges on database
+ template1=# CREATE DATABASE hello_world_test OWNER runner;
+
+ # Quit the database session
+ template1=# \q
+
+3. Try to connect to database:
+
+ # Try connecting to the new database with the new user
+ sudo -u gitlab-runner -H psql -d hello_world_test
+
+ # Quit the database session
+ hello_world_test> \q
+
+4. Configure your application to use the database:
+
+ Host: localhost
+ User: runner
+ Password:
+ Database: hello_world_test
diff --git a/doc/ci/services/redis.md b/doc/ci/services/redis.md
new file mode 100644
index 00000000000..523634a457e
--- /dev/null
+++ b/doc/ci/services/redis.md
@@ -0,0 +1,40 @@
+## Using Redis
+
+It's possible to use Redis database test your apps during builds.
+
+### Use Redis with Docker executor
+
+If you are using our Docker integration you basically have everything already.
+
+1. Add this to your `.gitlab-ci.yml`:
+
+ services:
+ - redis
+
+2. Configure your application to use the database:
+
+ Host: redis
+
+3. You can also use any other available on [DockerHub](https://hub.docker.com/_/redis/). For example: `redis:2.6`.
+
+Example: https://gitlab.com/gitlab-examples/redis/blob/master/.gitlab-ci.yml
+
+### Use Redis with Shell executor
+
+It's possible to use Redis on manually configured servers that are using GitLab Runner with Shell executor.
+
+1. First install the Redis server:
+
+ sudo apt-get install redis-server
+
+2. Try to connect to the server:
+
+ # Try connecting the the Redis server
+ sudo -u gitlab-runner -H redis-cli
+
+ # Quit the session
+ 127.0.0.1:6379> quit
+
+4. Configure your application to use the database:
+
+ Host: localhost