diff options
author | pmikus <peter.mikus@protonmail.ch> | 2023-04-28 11:27:25 +0000 |
---|---|---|
committer | pmikus <peter.mikus@protonmail.ch> | 2023-04-28 11:27:25 +0000 |
commit | d14b7a69e628582b9132abc1b6e09aada68c0077 (patch) | |
tree | 4ac651bd5240093f82580656bf5a95639c976fa3 /fdio.infra.ansible/roles/docker_images/tasks/base.yaml | |
parent | f451c7a50bc663a6727f01873b8663bfa9ae22e1 (diff) |
feat(ansible): Refactor docker-image roles
Signed-off-by: pmikus <peter.mikus@protonmail.ch>
Change-Id: I6731e55b9643f46463c16f68e4986e3cb61f843f
Diffstat (limited to 'fdio.infra.ansible/roles/docker_images/tasks/base.yaml')
-rw-r--r-- | fdio.infra.ansible/roles/docker_images/tasks/base.yaml | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/fdio.infra.ansible/roles/docker_images/tasks/base.yaml b/fdio.infra.ansible/roles/docker_images/tasks/base.yaml new file mode 100644 index 0000000000..69b3f6217d --- /dev/null +++ b/fdio.infra.ansible/roles/docker_images/tasks/base.yaml @@ -0,0 +1,63 @@ +--- +# file: tasks/base.yaml + +- name: "Create a Directory For Docker Images" + ansible.builtin.file: + path: "/opt/csit-docker-images/" + state: "directory" + mode: 0755 + tags: + - docker-base + +- name: "Copy Build Items" + ansible.builtin.copy: + src: "{{ item }}" + dest: "/opt/csit-docker-images/{{ item }}" + owner: "root" + group: "root" + mode: 0755 + with_items: + - "base/" + - "csit-sut/" + tags: + - docker-base + +- name: "Build CSIT Base Docker Image" + ansible.builtin.shell: "docker build -t base-ubuntu2204:local ." + args: + chdir: "/opt/csit-docker-images/base" + async: 3000 + poll: 0 + register: "docker_built" + tags: + - docker-base + +- name: "Check if CSIT Base Docker Image is Built" + async_status: + jid: "{{ docker_built.ansible_job_id }}" + register: "docker_built" + until: "docker_built.finished" + delay: 10 + retries: 300 + tags: + - docker-base + +- name: "Build CSIT OLD Docker Image" + ansible.builtin.shell: "docker build -t csit_sut-ubuntu2204:local ." + args: + chdir: "/opt/csit-docker-images/csit-sut" + async: 3000 + poll: 0 + register: "docker_built" + tags: + - docker-base + +- name: "Check if CSIT OLD Docker Image is Built" + async_status: + jid: "{{ docker_built.ansible_job_id }}" + register: "docker_built" + until: "docker_built.finished" + delay: 10 + retries: 300 + tags: + - docker-base
\ No newline at end of file |