From e2852ebe292bc838d95048515a8dca0d93ccbc24 Mon Sep 17 00:00:00 2001 From: Jon Date: Thu, 1 Jun 2023 14:14:17 +0930 Subject: [PATCH] refactor(build): other projects included as git submodule this was done so that any rebuild due to submodule update could be tracked and viewable within the history. !15 nofusscomputing/ops#74 --- .gitmodules | 8 +++++ dockerfile | 33 +------------------ .../etc/ansible/ansible.cfg | 0 includes/etc/ansible/playbooks | 1 + includes/etc/ansible/roles | 1 + 5 files changed, 11 insertions(+), 32 deletions(-) rename ansible.cfg => includes/etc/ansible/ansible.cfg (100%) create mode 160000 includes/etc/ansible/playbooks create mode 160000 includes/etc/ansible/roles diff --git a/.gitmodules b/.gitmodules index cc4d8a5..fdabbec 100644 --- a/.gitmodules +++ b/.gitmodules @@ -2,3 +2,11 @@ path = gitlab-ci url = https://gitlab.com/nofusscomputing/projects/gitlab-ci.git branch = development +[submodule "ansible-roles"] + path = includes/etc/ansible/roles + url = https://gitlab.com/nofusscomputing/projects/ansible/ansible-roles.git + branch = development +[submodule "ansible_playbooks"] + path = includes/etc/ansible/playbooks + url = https://gitlab.com/nofusscomputing/projects/ansible/ansible_playbooks.git + branch = development diff --git a/dockerfile b/dockerfile index af07300..c88be36 100644 --- a/dockerfile +++ b/dockerfile @@ -1,29 +1,3 @@ -FROM --platform=$BUILDPLATFORM python:3.11-bullseye as fetch-ansible-roles - - -ENV LC_ALL en_US.UTF-8 - - -RUN export DEBIAN_FRONTEND=noninteractive \ - && dpkg-reconfigure debconf -f noninteractive - - -RUN apt update \ - && apt install --reinstall -yq \ - git || true - - -RUN git clone -b development --depth 1 https://gitlab.com/nofusscomputing/projects/ansible-roles.git /tmp/ansible-roles \ - && cd /tmp/ansible-roles \ - && git submodule update --init - -RUN git clone -b development --depth 1 https://gitlab.com/nofusscomputing/projects/ansible/ansible_playbooks.git /tmp/ansible_playbooks \ - && cd /tmp/ansible_playbooks \ - && git submodule update --init - - - - FROM --platform=$TARGETPLATFORM python:3.11-bullseye # Ansible chucks a wobbler without. see: https://github.com/ansible/ansible/issues/78283 @@ -32,9 +6,7 @@ ENV LC_ALL en_US.UTF-8 ENV ANSIBLE_PLAYBOOK_DIR=/etc/ansible/playbooks -COPY --from=fetch-ansible-roles /tmp/ansible-roles/roles /etc/ansible/roles - -COPY --from=fetch-ansible-roles /tmp/ansible_playbooks /etc/ansible/playbooks +COPY includes / # Ref: https://github.com/opencontainers/image-spec/blob/d86384efdb8c30770a92415c100f57a9bffbb64e/annotations.md @@ -78,9 +50,6 @@ RUN export DEBIAN_FRONTEND=noninteractive \ WORKDIR /workdir -COPY ansible.cfg /etc/ansible/ansible.cfg - - COPY requirements.txt /tmp/requirements.txt diff --git a/ansible.cfg b/includes/etc/ansible/ansible.cfg similarity index 100% rename from ansible.cfg rename to includes/etc/ansible/ansible.cfg diff --git a/includes/etc/ansible/playbooks b/includes/etc/ansible/playbooks new file mode 160000 index 0000000..bf16a59 --- /dev/null +++ b/includes/etc/ansible/playbooks @@ -0,0 +1 @@ +Subproject commit bf16a59207fc9bfe34b524a378b768b228ed0919 diff --git a/includes/etc/ansible/roles b/includes/etc/ansible/roles new file mode 160000 index 0000000..f361c09 --- /dev/null +++ b/includes/etc/ansible/roles @@ -0,0 +1 @@ +Subproject commit f361c09aca8925a281600ce8047c76111e90eaf8