aboutsummaryrefslogtreecommitdiffstats
path: root/fdio.infra.ansible/roles/csit_sut_image/tasks/main.yaml
blob: f0a93c06ee3ea6e92f657ad5e68263b931dc83c3 (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
---
# file: roles/csit_sut_image/tasks/main.yaml

- name: Create a directory if it does not exist
  ansible.builtin.file:
    path: "/opt/csit-sut/"
    state: "directory"
    mode: 0755
  tags:
    - csit-sut-image

- name: Copy Build Items
  ansible.builtin.copy:
    src: "{{ item }}"
    dest: "/opt/csit-sut/"
    owner: "root"
    group: "root"
    mode: 0755
  with_items:
    - Dockerfile
    - supervisord.conf
  tags:
    - csit-sut-image

- name: Build CSIT SUT Docker Image
  ansible.builtin.shell: "docker build -t csit_sut-ubuntu2204:local ."
  args:
    chdir: "/opt/csit-sut"
  async: 3000
  poll: 0
  register: docker_built
  tags:
    - csit-sut-image

- name: Check if CSIT SUT Docker Image is Built
  async_status:
    jid: "{{ docker_built.ansible_job_id }}"
  register: docker_built
  until: docker_built.finished
  delay: 10
  retries: 300
  tags:
    - csit-sut-image