@ -1,3 +1,7 @@
|
|||||||
|
.ansible
|
||||||
.git
|
.git
|
||||||
|
CONTRIBUTING.md
|
||||||
docs/
|
docs/
|
||||||
# includes/
|
galaxy.yml
|
||||||
|
*.tmp.*
|
||||||
|
|
||||||
|
88
dockerfile
88
dockerfile
@ -1,42 +1,94 @@
|
|||||||
FROM harbor.earth.nww/docker/python:3.11-slim
|
|
||||||
|
FROM python:3.11-alpine3.22 AS Build
|
||||||
|
|
||||||
|
|
||||||
RUN apt-get update; \
|
RUN apk update; \
|
||||||
apt-get install -y \
|
apk add \
|
||||||
curl \
|
build-base \
|
||||||
openjdk-17-jdk-headless; \
|
gcc;
|
||||||
pip install ansible-core ansible-rulebook;
|
|
||||||
|
|
||||||
RUN addgroup eda; \
|
|
||||||
adduser --ingroup eda eda
|
|
||||||
|
|
||||||
# COPY extensions/eda/rulebooks/webhook.yaml /eda/
|
RUN pip install --upgrade \
|
||||||
|
setuptools \
|
||||||
|
wheel
|
||||||
|
|
||||||
RUN ansible-galaxy collection install ansible.eda
|
|
||||||
|
|
||||||
# RUN ls -la /home/eda/.ansible/collections/nofusscomputing/git_events/
|
RUN apk add openjdk21-jdk;
|
||||||
|
|
||||||
COPY . /home/eda/.ansible/collections/ansible_collections/nofusscomputing/git_events/
|
|
||||||
|
|
||||||
RUN pip install --no-cache-dir -r /home/eda/.ansible/collections/ansible_collections/nofusscomputing/git_events/requirements.txt
|
RUN apk add \
|
||||||
|
alpine-sdk \
|
||||||
|
libffi-dev \
|
||||||
|
maven \
|
||||||
|
build-base libc-dev;
|
||||||
|
|
||||||
|
|
||||||
|
ENV JAVA_HOME /usr/lib/jvm/java-21-openjdk
|
||||||
|
|
||||||
|
# ChatGPT suggestion to fix alpine version >3.19
|
||||||
|
ENV CFLAGS "-Wno-incompatible-pointer-types"
|
||||||
|
|
||||||
|
|
||||||
|
COPY requirements.txt /tmp/requirements.txt
|
||||||
|
|
||||||
|
|
||||||
|
RUN mkdir -p /tmp/python_modules; \
|
||||||
|
cd /tmp/python_modules; \
|
||||||
|
pip download --dest . \
|
||||||
|
pip \
|
||||||
|
--check-build-dependencies \
|
||||||
|
-r /tmp/requirements.txt
|
||||||
|
|
||||||
|
|
||||||
|
RUN cd /tmp/python_modules; \
|
||||||
|
mkdir -p /tmp/python_builds; \
|
||||||
|
echo "[DEBUG] PATH=$PATH"; \
|
||||||
|
ls -l; \
|
||||||
|
pip wheel --wheel-dir /tmp/python_builds --find-links . *.whl; \
|
||||||
|
pip wheel --wheel-dir /tmp/python_builds --find-links . *.tar.gz;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
FROM python:3.11-alpine3.22
|
||||||
|
|
||||||
|
|
||||||
|
RUN apk --no-cache update; \
|
||||||
|
apk --no-cache add \
|
||||||
|
openjdk21-jdk
|
||||||
|
|
||||||
|
|
||||||
|
ENV ANSIBLE_FORCE_COLOR true
|
||||||
|
|
||||||
|
ENV ANSIBLE_INVENTORY hosts.yaml
|
||||||
|
|
||||||
|
ENV JAVA_HOME /usr/lib/jvm/java-21-openjdk
|
||||||
|
|
||||||
|
|
||||||
COPY includes/ /
|
COPY includes/ /
|
||||||
|
|
||||||
RUN cp -r /root/.ansible /home/eda/; \
|
COPY . /home/eda/.ansible/collections/ansible_collections/nofusscomputing/git_events/
|
||||||
# cp -r /home/eda/.ansible/collections/ansible_collections/nofusscomputing/git_events/includes/* /; \
|
|
||||||
|
COPY --from=build /tmp/python_builds /tmp/python_builds
|
||||||
|
|
||||||
|
|
||||||
|
RUN pip install --no-cache-dir /tmp/python_builds/*; \
|
||||||
|
rm -R /tmp/python_builds; \
|
||||||
|
ansible-galaxy collection install ansible.eda; \
|
||||||
|
addgroup eda; \
|
||||||
|
adduser -D --ingroup eda eda; \
|
||||||
|
cp -r /root/.ansible /home/eda/; \
|
||||||
rm -rf /home/eda/.ansible/collections/ansible_collections/nofusscomputing/git_events/includes; \
|
rm -rf /home/eda/.ansible/collections/ansible_collections/nofusscomputing/git_events/includes; \
|
||||||
mv /usr/bin/annotations.py /usr/bin/annotations; \
|
mv /usr/bin/annotations.py /usr/bin/annotations; \
|
||||||
chmod +x /usr/bin/annotations; \
|
chmod +x /usr/bin/annotations; \
|
||||||
chown eda:eda -R /home/eda;
|
chown eda:eda -R /home/eda;
|
||||||
|
|
||||||
|
|
||||||
WORKDIR /home/eda
|
WORKDIR /home/eda
|
||||||
|
|
||||||
ENV ANSIBLE_INVENTORY hosts.yaml
|
|
||||||
|
|
||||||
# required for parser script
|
|
||||||
|
|
||||||
USER eda
|
USER eda
|
||||||
|
|
||||||
|
|
||||||
CMD [ \
|
CMD [ \
|
||||||
"ansible-rulebook", \
|
"ansible-rulebook", \
|
||||||
"-r", "nofusscomputing.git_events.webhook", \
|
"-r", "nofusscomputing.git_events.webhook", \
|
||||||
|
@ -57,7 +57,7 @@
|
|||||||
|
|
||||||
cat /tmp/job.log | annotations > /tmp/annotations.json;
|
cat /tmp/job.log | annotations > /tmp/annotations.json;
|
||||||
|
|
||||||
executable: bash
|
executable: sh
|
||||||
changed_when: false
|
changed_when: false
|
||||||
|
|
||||||
|
|
||||||
|
5
requirements.txt
Normal file
5
requirements.txt
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
|
||||||
|
ansible-core==2.18.6
|
||||||
|
ansible-rulebook==1.1.7
|
||||||
|
|
||||||
|
requests
|
Reference in New Issue
Block a user