Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
42b6de92
Commit
42b6de92
authored
Apr 19, 2021
by
Suzanne Selhorn
Committed by
Marcel Amirault
Apr 19, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Follow up to initial MR
parent
22258c00
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
27 deletions
+23
-27
doc/ci/services/gitlab.md
doc/ci/services/gitlab.md
+23
-27
No files found.
doc/ci/services/gitlab.md
View file @
42b6de92
...
...
@@ -5,40 +5,36 @@ info: To determine the technical writer assigned to the Stage/Group associated w
type
:
reference
---
# Us
ing GitLab
# Us
e GitLab as a microservice
As many applications depend on accessing JSON apis you eventually need them in order for your tests to run.
In this example we are providing GitLab as a Microservice to be accessible for API clients.
Below you are guided how to do this with the Docker executors of GitLab Runner
.
Many applications need to access JSON APIs, so application tests might need access
to APIs too. The following example shows how to use GitLab as a microservice to give
tests access to the GitLab API
.
## Use GitLab with the Docker executor
1.
Configure a
[
runner
](
../runners/README.md
)
with the Docker or Kubernetes executor.
1.
In your
`.gitlab-ci.yml`
add:
If you're using
[
GitLab Runner
](
../runners/README.md
)
with the Docker/Kubernetes executor,
you basically have everything set up already.
First, in your
`.gitlab-ci.yml`
add:
```
yaml
services
:
```
yaml
services
:
-
name
:
gitlab/gitlab-ce:latest
alias
:
gitlab
variables
:
GITLAB_HTTPS
:
"
false"
# ensure that plain http will work
GITLAB_ROOT_PASSWORD
:
"
password"
# in order
to access the api with user root:password
```
variables
:
GITLAB_HTTPS
:
"
false"
# ensure that plain http works
GITLAB_ROOT_PASSWORD
:
"
password"
#
to access the api with user root:password
```
To set values for the
`GITLAB_HTTPS`
,
`GITLAB_ROOT_PASSWORD`
,
[
assign them to a variable in the user interface
](
../variables/README.md#project-cicd-variables
)
,
t
hen assign that variable to the corresponding variable in your
`.gitlab-ci.yml`
file.
1.
To set values for the
`GITLAB_HTTPS`
and
`GITLAB_ROOT_PASSWORD`
,
[
assign them to a variable in the user interface
](
../variables/README.md#project-cicd-variables
)
.
T
hen assign that variable to the corresponding variable in your
`.gitlab-ci.yml`
file.
From your ci
`script:`
the API will then be availible at
`http://gitlab/api/v4`
Then, commands in
`script:`
sections in your
`.gitlab-ci.yml`
file can access the API at
`http://gitlab/api/v4`
.
If you're wondering why we used
`gitlab`
for the
`Host`
, read more at
For more information about why
`gitlab`
is used for the
`Host`
, see
[
How services are linked to the job
](
../docker/using_docker_images.md#extended-docker-configuration-options
)
.
You can also use any other Docker image available on
[
Docker Hub
](
https://hub.docker.com/u/gitlab
)
.
The
`gitlab`
image can accept
some
environment variables. For more details,
see the
[
o
mnibus documentation
](
../../install/README.md
)
.
The
`gitlab`
image can accept environment variables. For more details,
see the
[
O
mnibus documentation
](
../../install/README.md
)
.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment