2ab92296310e8ae78d07fa078b0aef887c07c00c
[barometer.git] / docker / ansible / roles / build_collectd / tasks / main.yml
1 # Copyright 2021 Anuket and others
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 #     http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14 ---
15 - name: Build stable container
16   docker_image:
17     name: opnfv/barometer-collectd
18     build:
19       path: "{{ playbook_dir }}/../barometer-collectd/"
20     source: build
21   tags:
22     - stable
23
24 - name: Build the latest container
25   docker_image:
26     name: opnfv/barometer-collectd-latest
27     build:
28       path: "{{ playbook_dir }}/../../"
29       dockerfile: "docker/barometer-collectd-latest/Dockerfile"
30     source: build
31   tags:
32     - latest
33
34 - name: Build collectd-experimental
35   docker_image:
36     name: opnfv/barometer-collectd-experimental
37     build:
38       path: "{{ playbook_dir }}/../../"
39       dockerfile: "docker/barometer-collectd-experimental/Dockerfile"
40       args:
41         COLLECTD_FLAVOR: experimental
42         COLLECTD_TAG: "{{ COLLECTD_TAG | default('main') }}"
43         COLLECTD_PULL_REQUESTS: "{{ COLLECTD_PULL_REQUESTS | default() }}"
44     source: build
45   tags:
46     - experimental
47
48 - name: Build collectd-6
49   docker_image:
50     name: "opnfv/barometer-collectd-6{{ ( '-' + COLLECTD_PULL_REQUESTS ) if COLLECTD_PULL_REQUESTS is defined else '' }}"
51     build:
52       path: "{{ playbook_dir }}/../../"
53       dockerfile: "docker/barometer-collectd-experimental/Dockerfile"
54       args:
55         COLLECTD_FLAVOR: collectd-6
56         COLLECTD_TAG: "{{ COLLECTD_TAG | default('collectd-6.0') }}"
57         COLLECTD_CONFIG_CMD_ARGS: "{{ COLLECTD_CONFIG_CMD_ARGS if COLLECTD_CONFIG_CMD_ARGS is defined }}"
58     source: build
59   tags:
60     - collectd-6
61
62 - name: Build test_app for write_http
63   docker_image:
64     name: test-collectd-write_http
65     build:
66       path: "{{ playbook_dir }}/../flask_app/"
67     source: build
68   tags:
69     - flask_test
70     - never
71