Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Gitlab CI example #2627

Merged
merged 1 commit into from
Mar 27, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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