Skip to content

Commit

Permalink
fix: use specific jeedom_repo for test purpose
Browse files Browse the repository at this point in the history
  • Loading branch information
pifou25 committed Apr 28, 2024
1 parent 9c1abb8 commit a98373f
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 21 deletions.
29 changes: 16 additions & 13 deletions .github/workflows/buildx-platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:

env:
REGISTRY_IMAGE: pifou25/jeedom
TAG_NAME: ${{ matrix.debian }}-${{ matrix.php }}${{ matrix.target == 'full' && '' || '-light' }}${{ matrix.jeedom == 'beta' && '-beta' || '' }}${{ matrix.xdebug && '-debug' || '' }}
TAG_NAME: tst-${{ matrix.debian }}-${{ matrix.php }}${{ matrix.target == 'full' && '' || '-light' }}${{ matrix.jeedom == 'beta' && '-beta' || '' }}${{ matrix.xdebug && '-debug' || '' }}
steps:
-
name: Prepare ${{ env.TAG_NAME }}:${{ matrix.platform }}
Expand Down Expand Up @@ -126,21 +126,34 @@ jobs:
build-args: |
DEBIAN=${{ matrix.debian }}
PHP=${{ matrix.php }}
JEEDOM_REPO=pifou25/jeedom-core
JEEDOM_VERSION=${{ matrix.jeedom }}
XDEBUG=${{ matrix.xdebug }}
platforms: ${{ matrix.platform }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true
tags: ${{ env.REGISTRY_IMAGE }}:${{ env.TAG_NAME }}

- name: Check on failures
if: steps.buildJeedom.outcome != 'success'
run: |
echo "${{ matrix.debian }} PHP${{ matrix.php }} ${{ matrix.target }} branch ${{ matrix.jeedom }} debug ${{ matrix.xdebug }} has Errors! 🚀" >> $GITHUB_STEP_SUMMARY
echo "Name: ${{ steps.buildx.outputs.name }}" >> $GITHUB_STEP_SUMMARY
echo "Endpoint: ${{ steps.buildx.outputs.endpoint }}" >> $GITHUB_STEP_SUMMARY
echo "Status: ${{ steps.buildx.outputs.status }}" >> $GITHUB_STEP_SUMMARY
echo "Flags: ${{ steps.buildx.outputs.flags }}" >> $GITHUB_STEP_SUMMARY
echo "Platforms: ${{ steps.buildx.outputs.platforms }}" >> $GITHUB_STEP_SUMMARY
-
name: Export digest
if: steps.buildJeedom.outcome == 'success'
run: |
mkdir -p /tmp/digests
digest="${{ steps.buildJeedom.outputs.digest }}"
touch "/tmp/digests/${digest#sha256:}"
-
name: Upload digest
if: steps.buildJeedom.outcome == 'success'
uses: actions/upload-artifact@v4
with:
# env.PLATFORM_PAIR from step 1
Expand All @@ -149,16 +162,6 @@ jobs:
if-no-files-found: error
retention-days: 1

- name: Check on failures
if: steps.buildJeedom.outcome != 'success'
run: |
echo "${{ matrix.debian }} PHP${{ matrix.php }} ${{ matrix.target }} branch ${{ matrix.jeedom }} debug ${{ matrix.xdebug }} has Errors! 🚀" >> $GITHUB_STEP_SUMMARY
echo "Name: ${{ steps.buildx.outputs.name }}" >> $GITHUB_STEP_SUMMARY
echo "Endpoint: ${{ steps.buildx.outputs.endpoint }}" >> $GITHUB_STEP_SUMMARY
echo "Status: ${{ steps.buildx.outputs.status }}" >> $GITHUB_STEP_SUMMARY
echo "Flags: ${{ steps.buildx.outputs.flags }}" >> $GITHUB_STEP_SUMMARY
echo "Platforms: ${{ steps.buildx.outputs.platforms }}" >> $GITHUB_STEP_SUMMARY
merge:
# https://docs.docker.com/build/ci/github-actions/multi-platform/
# merge previous builds from different runners &platforms into one common docker image
Expand Down Expand Up @@ -186,8 +189,8 @@ jobs:

env:
REGISTRY_IMAGE: pifou25/jeedom
TAG_NAME: ${{ matrix.debian }}-${{ matrix.php }}${{ matrix.target == 'full' && '' || '-light' }}${{ matrix.jeedom == 'beta' && '-beta' || '' }}${{ matrix.xdebug && '-debug' || '' }}
GHCR_NAME: ghcr.io/${{ secrets.DOCKER_USER }}/jeedom:${{ matrix.debian }}-${{ matrix.php }}${{ matrix.target == 'full' && '' || '-light' }}${{ matrix.jeedom == 'beta' && '-beta' || '' }}${{ matrix.xdebug && '-debug' || '' }}
TAG_NAME: tst-${{ matrix.debian }}-${{ matrix.php }}${{ matrix.target == 'full' && '' || '-light' }}${{ matrix.jeedom == 'beta' && '-beta' || '' }}${{ matrix.xdebug && '-debug' || '' }}
GHCR_NAME: ghcr.io/${{ secrets.DOCKER_USER }}/jeedom:tst-${{ matrix.debian }}-${{ matrix.php }}${{ matrix.target == 'full' && '' || '-light' }}${{ matrix.jeedom == 'beta' && '-beta' || '' }}${{ matrix.xdebug && '-debug' || '' }}

steps:
-
Expand Down
19 changes: 11 additions & 8 deletions build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ ARG PHP=7.3
# prepare PHP source with dependencies
FROM composer:2.7 as vendor

ARG JEEDOM_REPO=jeedom/core
ARG JEEDOM_VERSION=V4-stable
ENV JEEDOM_VERSION=${JEEDOM_VERSION}

WORKDIR /app
# Download and extract PHP sources
ADD https://github.com/jeedom/core/archive/${JEEDOM_VERSION}.zip /tmp/jeedom.zip
ADD https://github.com/${JEEDOM_REPO}/archive/${JEEDOM_VERSION}.zip /tmp/jeedom.zip
RUN unzip -q /tmp/jeedom.zip -d /root/ && \
cp -R /root/core-*/* /app && \
cp -R /root/core-*/.[!.]* /app && \
Expand Down Expand Up @@ -38,7 +39,8 @@ ARG DEBIAN=bullseye
ARG PHP=7.3
FROM php:${PHP}-apache-${DEBIAN} as base
ARG DEBIAN
ARG PHP=7.3
ARG PHP
ARG JEEDOM_REPO
# optional XDEBUG arg to add xdebug packages and configuration
ARG XDEBUG

Expand All @@ -62,7 +64,7 @@ LABEL com.jeedom.version="Jeedom ${JEEDOM_VERSION} for Debian ${DEBIAN} + PHP ${
# add motd & bashrc - link sh to bash for Docker Desktop
# add sudo for www-data
COPY motd /etc/jmotd
ADD https://raw.githubusercontent.com/jeedom/core/${JEEDOM_VERSION}/install/bashrc /root/.bashrc
ADD https://raw.githubusercontent.com/${JEEDOM_REPO}/${JEEDOM_VERSION}/install/bashrc /root/.bashrc
# Use bash as the default shell - replace ln -sf /bin/bash /bin/sh && \
SHELL ["/bin/bash", "-c"]
# shellcheck disable=SC2016
Expand Down Expand Up @@ -156,6 +158,7 @@ CMD ["/root/init.sh"]

# Second final image: full standalone
FROM base as full_jeedom
ARG JEEDOM_REPO
# localhost didn't work for mysql, should try 127.0.0.1
ENV MYSQL_HOST=localhost

Expand All @@ -173,13 +176,13 @@ RUN apt-get update && apt-get install --no-install-recommends --no-install-sugge
supervisor \
&& rm -rf /var/lib/apt/lists/*

# customization from official jeedom/core repo
# customization from official ${JEEDOM_REPO} repo
COPY standalone/supervisord.conf /etc/supervisor/supervisord.conf
COPY standalone/jeedom_my.cnf /etc/mysql/conf.d/jeedom_my.cnf
ADD https://raw.githubusercontent.com/jeedom/core/${JEEDOM_VERSION}/install/apache_security /etc/apache2/conf-available/security.conf
ADD https://raw.githubusercontent.com/jeedom/core/${JEEDOM_VERSION}/install/apache_remoteip /etc/apache2/conf-available/remoteip.conf
ADD https://raw.githubusercontent.com/jeedom/core/${JEEDOM_VERSION}/install/apache_default /etc/apache2/sites-available/000-default.conf
ADD https://raw.githubusercontent.com/jeedom/core/${JEEDOM_VERSION}/install/fail2ban.jeedom.conf /etc/fail2ban/jail.d/jeedom.conf
ADD https://raw.githubusercontent.com/${JEEDOM_REPO}/${JEEDOM_VERSION}/install/apache_security /etc/apache2/conf-available/security.conf
ADD https://raw.githubusercontent.com/${JEEDOM_REPO}/${JEEDOM_VERSION}/install/apache_remoteip /etc/apache2/conf-available/remoteip.conf
ADD https://raw.githubusercontent.com/${JEEDOM_REPO}/${JEEDOM_VERSION}/install/apache_default /etc/apache2/sites-available/000-default.conf
ADD https://raw.githubusercontent.com/${JEEDOM_REPO}/${JEEDOM_VERSION}/install/fail2ban.jeedom.conf /etc/fail2ban/jail.d/jeedom.conf
COPY php.ini /usr/local/etc/php/php.ini

RUN sed -i -e "s%WEBSERVER_HOME%${WEBSERVER_HOME}%g" /etc/apache2/conf-available/security.conf && \
Expand Down

0 comments on commit a98373f

Please sign in to comment.