Skip to content

Commit

Permalink
Merge pull request #2627 from matthewcosgrove/gitlab-ci-docs-example
Browse files Browse the repository at this point in the history
Update Gitlab CI example

Reviewed-by: https://github.com/apps/ansible-zuul
  • Loading branch information
ansible-zuul[bot] committed Mar 27, 2020
2 parents 778c6c4 + 812d680 commit ce0f02b
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions docs/ci.rst
Original file line number Diff line number Diff line change
Expand Up @@ -86,34 +86,35 @@ A ``.travis.yml`` using `Tox`_ as described below.
Gitlab CI
^^^^^^^^^

`Gitlab`_ includes its own CI. Pipelines are usually defined in a ``.gitlab-ci.yml`` file in the top folder of a repository, to be ran on Gitlab Runners.

Here is an example setting up a virtualenv and testing an Ansible role via Molecule. User-level pip is cached and so is the virtual environment to save time. And this is run over a runner tagged `pip36` and `docker`, because its a minimal CentOS 7 VM installed with pip36 from IUS repository and docker.
`Gitlab`_ includes its own CI. Pipelines are usually defined in a ``.gitlab-ci.yml`` file in the top folder of a repository, to be run on Gitlab Runners.

Here is an example using Docker in Docker

.. code-block:: yaml
---
image: docker:git
image: docker:latest
services:
- docker:dind
before_script:
- apk update && apk add --no-cache docker
python3-dev py3-pip docker gcc git curl build-base
- apk update && apk add --no-cache
python3-dev py3-pip gcc git curl build-base
autoconf automake py3-cryptography linux-headers
musl-dev libffi-dev openssl-dev openssh
- docker info
- python3 --version
- python3 -m pip install ansible molecule[docker]
- ansible --version
- molecule --version
molecule:
stage: test
script:
- python3 -m pip install ansible molecule docker
- ansible --version
- cd roles/testrole && molecule test
Jenkins Pipeline
^^^^^^^^^^^^^^^^

Expand Down

0 comments on commit ce0f02b

Please sign in to comment.