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
This commit is contained in:
2023-06-01 14:14:17 +09:30
parent b713b3e6b7
commit e2852ebe29
5 changed files with 11 additions and 32 deletions

8
.gitmodules vendored
View File

@ -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

View File

@ -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