.gitlab-ci.yml 2.07 KB
Newer Older
Bengt Giger's avatar
Bengt Giger committed
1
---
2
image: quay.io/ansible/toolset:0.4
Bengt Giger's avatar
Bengt Giger committed
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
services:
  - docker:19.03.0-dind

variables:
  PY_COLORS: 1
  GIT_STRATEGY: clone
  # DOCKER_HOST: tcp://localhost:2375
  DOCKER_TLS_CERTDIR: ""

stages:
  - tests

before_script:
  - docker -v
  - python -V
  - ansible --version
  - molecule --version

# Test timeservice on dedicated gitlab-runner server
Bengt Giger's avatar
Bengt Giger committed
22
timeservice-test:
Bengt Giger's avatar
Bengt Giger committed
23
24
25
26
27
28
29
  stage: tests
  tags:
    - docker
  script:
    - cd roles/timeservice;
      molecule test;
      molecule test -s ntp;
Bengt Giger's avatar
Bengt Giger committed
30
  only:
31
32
33
    changes:
      - .gitlab-ci.yml
      - roles/timeservice/**/*
Bengt Giger's avatar
Bengt Giger committed
34
35
36
37
38
39
40
41
42
43
44

# Test private_subnet_client on Kubernetes
private_subnet_client-test:
  stage: tests
  tags:
    - k8s-runner
  variables:
    DOCKER_HOST: tcp://localhost:2375
  script:
    - cd roles/private_subnet_client;
      molecule test;
45
46
47
48
  only:
    changes:
      - .gitlab-ci.yml
      - roles/private_subnet_client/**/*
Bengt Giger's avatar
Bengt Giger committed
49

Bengt Giger's avatar
Bengt Giger committed
50
# Test console_configuration on Kubernetes
Bengt Giger's avatar
Bengt Giger committed
51
52
53
54
55
56
57
58
59
console_configuration-test:
  stage: tests
  tags:
    - k8s-runner
  variables:
    DOCKER_HOST: tcp://localhost:2375
  script:
    - cd roles/console_configuration;
      molecule test;
60
61
62
63
  only:
    changes:
      - .gitlab-ci.yml
      - roles/console_configuration/**/*
Bengt Giger's avatar
Bengt Giger committed
64
65
66
67
68
69
70
71
72
73

# Test system_update_manager on Kubernetes
system_update_manager-test:
  stage: tests
  tags:
    - k8s-runner
  variables:
    DOCKER_HOST: tcp://localhost:2375
  script:
    - cd roles/system_update_manager;
Bengt Giger's avatar
Bengt Giger committed
74
      molecule test -s remove;
Bengt Giger's avatar
Bengt Giger committed
75
76
77
      molecule test;
      molecule test -s increase;
      molecule test -s decrease;
78
79
80
81
82
  only:
    changes:
      - .gitlab-ci.yml
      - roles/system_update_manager/**/*

Bengt Giger's avatar
Bengt Giger committed
83
84
85
86
87
88
89
90
91

# Test rsyslog_forwarder on dedicated runner (systemd)
rsyslog_forwarder-test:
  stage: tests
  tags:
    - docker
  script:
    - cd roles/rsyslog_forwarder;
      molecule test;
92
93
94
95
  only:
    changes:
      - .gitlab-ci.yml
      - roles/rsyslog_forwarder/**/*
Bengt Giger's avatar
Bengt Giger committed
96
97
98
99
100
101
102

# Test ansible_client on dedicated runner (systemd)
ansible_client-test:
  stage: tests
  tags:
    - docker
  script:
Bengt Giger's avatar
Bengt Giger committed
103
    - cd roles/ansible_client;
Bengt Giger's avatar
Bengt Giger committed
104
105
106
107
108
      molecule test;
  only:
    changes:
      - .gitlab-ci.yml
      - roles/ansible_client/**/*