aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
blob: bacfde27a6e3ac835855ede231a583c48d06a103 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
Chained-CI
==========

Role
----
Chained-CI is a way to run a set of projects, each one as a job in a top level
pipeline.

This project, running on gitlab CE, is triggering configured projects one
after the other, or in parallele, sharing configuration through artifacts. This
allow to integrate projects managed by third parties, or running together
independent projects.

This project is hosting the pipelines and the pipeline configuration.
See [Orange CI Roles](https://gitlab.com/Orange-OpenSource/lfn/ci_cd/chained-ci-roles "Orange CI Roles") to see the
roles needed to run thoses pipelines

Input
-----
  - Environment variables:
    - __Required__:
      - POD:
          - role: pod name as defined in pod_inventory/inventory
          - example: pod1
          - default: none
    - Optional:
      - RUNNER_TAG:
        - override the default gitlab-runner tag (ta5_tnaplab)
        - "old" lab runner tag: tnaplab2
      - USER_ROLE:
        - overrides the name of the "member" role in Openstack
        - default role: "Member" (used in "old" DT lab)
      - AREYOUSURE:
        - role: disable the deployment protection on some pods
        - default: ''
        - values: '' or 'MAIS OUI !!!'
      - ansible_verbose:
          - role: verbose option for ansible
          - values: "", "-vvv"
          - default: ""
      - infra_branch:
          - role: the branch for project infra_manager
          - default: master
      - os_infra_branch:
          - role: the branch for project os_infra_manager
          - default: master
      - vim_branch:
          - role: the branch for the VIMs projects (kolla, k8s)
          - default: master
      - kolla_branch:
          - role: a value to pass to project kolla
          - default: 'stable/queens'
      - kolla_ansible_branch:
          - role: a value to pass to project kolla
          - default: 'stable/queens'
      - functest_branch:
          - role: the branch for project functest
          - default: master
      - acumos_branch:
          - role: the branch for project acumos-installer
          - default: master

Output
------
  - artifacts: each step can fetch the artifact generate by the sub-project as
      defined in the git_projects variables pull_artifacts

Details
-------
  - [Chained-CI intro](./doc/chained-ci-intro.md "Chained-CI intro")

Quick Guide to create a pipeline
--------------------------------
  - Reuse or create a inventory file-pair under pod_config/config
      - k8s*.yaml defining the VMs and their resource settings (RAM, Disk, CPUs)
      - idf-k8s*.yaml defining the inventory setting (tenant, network, node roles...)
  - Create pipeline definition file under pod_inventory/host_vars
  - Add name of the pipeline in pod_inventory/inventory
  - Update the submodules (git submodule init; git submodule update)
  - Run ansible script to regenerate .gitlab-ci.yaml
      - ansible-playbook -vvv --vault-password-file ./.vault -i ./pod_inventory/inventory ./gitlab-ci-generator.yml
  - (Workarround) add RUNNER_TAG default variable in .gitlab-ci.yaml
  ``` 
  variables:
  GIT_SUBMODULE_STRATEGY: recursive
  VAULT_FILE: .vault
  RUNNER_TAG: ta5_tnaplab
  ```
  - check-in code and create a pipeline