README.md 3.16 KB
Newer Older
Ansgar Burchardt's avatar
Ansgar Burchardt committed
1 2 3 4 5 6 7 8
Docker images for GitLab CI
===========================

Images
------

The current images are:

Ansgar Burchardt's avatar
Ansgar Burchardt committed
9 10 11
| image                    | parent          | description                                                |
|--------------------------|-----------------|------------------------------------------------------------|
| duneci/base:8            | debian:8        | Debian 8 with gcc 4.9.2, clang 3.5, cmake 3.0.2            |
Ansgar Burchardt's avatar
Ansgar Burchardt committed
12
| duneci/base:8-backports  | duneci/base:8   | Debian 8 with gcc 4.9.2, clang 3.8 (backport), cmake 3.0.2 |
Ansgar Burchardt's avatar
Ansgar Burchardt committed
13 14 15 16 17 18 19
| duneci/base:9            | debian:9        | Debian 9 with gcc 6.1.1, clang 3.8, cmake 3.6.2            |
| duneci/base:16.04        | ubuntu:16.04    | Ubuntu LTS 16.04 with gcc 5.4.0, clang 3.8.0, cmake 3.5.1  |
| duneci/dune:2.3          | duneci/base:8   | DUNE 2.3 core modules from Debian                          |
| duneci/dune:2.4          | duneci/base:9   | DUNE 2.4 core modules from Debian                          |
| duneci/dune:git          | duneci/base:9   | DUNE 3.0-dev snapshot                                      |
| duneci/dune-fufem:2.4    | duneci/dune:2.4 | dune-{fufem,functions,solvers,typetree} (2.4 branches)     |
| duneci/dune-fufem:git    | duneci/dune:git | dune-{fufem,functions,solvers,typetree} (master branches)  |
Ansgar Burchardt's avatar
Ansgar Burchardt committed
20 21 22 23

`.gitlab-ci.yml`
----------------

24 25 26 27 28 29 30
Installing dependencies:
```
before_script:
  - duneci-install-module https://gitlab.dune-project.org/core/dune-common.git
  - duneci-install-module https://gitlab.dune-project.org/core/dune-geometry.git
```

Ansgar Burchardt's avatar
Ansgar Burchardt committed
31 32 33
To build with several images:
```
---
Ansgar Burchardt's avatar
Ansgar Burchardt committed
34 35
dune:2.4--gcc:
  image: duneci/dune:2.4
Ansgar Burchardt's avatar
Ansgar Burchardt committed
36
  script:
Ansgar Burchardt's avatar
Ansgar Burchardt committed
37 38 39
  - dunecontrol --current all
  - dunecontrol --current make build_tests
  - cd build-cmake; duneci-ctest
Ansgar Burchardt's avatar
Ansgar Burchardt committed
40

Ansgar Burchardt's avatar
Ansgar Burchardt committed
41 42
dune:2.4--clang:
  image: duneci/dune:2.4
Ansgar Burchardt's avatar
Ansgar Burchardt committed
43
  script:
Ansgar Burchardt's avatar
Ansgar Burchardt committed
44 45 46
  - dunecontrol --current --opts=/duneci/opts.clang all
  - dunecontrol --current make build_tests
  - cd build-cmake; duneci-ctest
Ansgar Burchardt's avatar
Ansgar Burchardt committed
47 48 49 50 51
```

You can also specify a default image and use it in several jobs:

```
Ansgar Burchardt's avatar
Ansgar Burchardt committed
52
---
Ansgar Burchardt's avatar
Ansgar Burchardt committed
53 54 55 56
image: duneci/dune:2.4

dune:2.4--gcc:
  script:
Ansgar Burchardt's avatar
Ansgar Burchardt committed
57 58 59
  - dunecontrol --current all
  - dunecontrol --current make build_tests
  - cd build-cmake; duneci-ctest
Ansgar Burchardt's avatar
Ansgar Burchardt committed
60 61 62

dune:2.4--clang:
  script:
Ansgar Burchardt's avatar
Ansgar Burchardt committed
63 64 65
  - dunecontrol --current --opts=/duneci/opts.clang all
  - dunecontrol --current make build_tests
  - cd build-cmake; duneci-ctest
Ansgar Burchardt's avatar
Ansgar Burchardt committed
66
```
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81

Updating gitlab-runner
----------------------

To update `gitlab-runner` on the VM:

```
docker pull gitlab/gitlab-runner:latest
docker stop gitlab-runner
docker rm -v gitlab-runner
docker run -d --name gitlab-runner --restart always \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -v /srv/gitlab-runner/config:/etc/gitlab-runner \
  gitlab/gitlab-runner:latest
```
82 83 84 85 86 87 88 89 90 91 92
or, if a HTTP proxy is required,
```
docker run -d --name gitlab-runner --restart always \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -v /srv/gitlab-runner/config:/etc/gitlab-runner \
  -e ftp_proxy=${ftp_proxy} -e FTP_PROXY=${FTP_PROXY} \
  -e http_proxy=${http_proxy} -e HTTP_PROXY=${HTTP_PROXY} \
  -e https_proxy=${https_proxy} -e HTTPS_PROXY=${HTTPS_PROXY} \
  -e no_proxy=${no_proxy} -e NO_PROXY=${NO_PROXY} \
  gitlab/gitlab-runner:latest
```
93 94 95 96

The current version can be shown by running

```
97
docker exec gitlab-runner gitlab-runner -v
98
```