Skip to content

Commit

Permalink
chore: Refactor to have every flavor in the main branch
Browse files Browse the repository at this point in the history
  • Loading branch information
LeSuisse committed Dec 5, 2024
1 parent 9336230 commit 27b79f1
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 28 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/Build_And_Publish_Docker_Images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ env:

jobs:
build:
strategy:
matrix:
os_base: ["el9"]
php_base: ["php82"]
runs-on: ubuntu-24.04
permissions:
contents: read
Expand All @@ -24,16 +28,16 @@ jobs:
- name: Get lowercase base image name
run: echo BASE_IMAGE_NAME="$(echo ${{ github.repository_owner }} | tr '[A-Z]' '[a-z]')" >> $GITHUB_ENV
- name: Build image
run: docker build -t ghcr.io/${{ env.BASE_IMAGE_NAME }}/${{ env.IMAGE_NAME }}:${GITHUB_REF#refs/heads/} --label org.opencontainers.image.revision=${{ github.sha }} --label workflow_run_id=${{ github.run_id }} .
run: docker build -t ghcr.io/${{ env.BASE_IMAGE_NAME }}/${{ env.IMAGE_NAME }}:${{ matrix.os_base }}-${{ matrix.php_base }} --label org.opencontainers.image.revision=${{ github.sha }} --label workflow_run_id=${{ github.run_id }} .
- name: Install Cosign
uses: sigstore/cosign-installer@dc72c7d5c4d10cd6bcb8cf6e3fd625a9e5e537da # tag=v3.7.0
- name: Log into ghcr.io
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Publish image
run: docker push ghcr.io/${{ env.BASE_IMAGE_NAME }}/${{ env.IMAGE_NAME }}:${GITHUB_REF#refs/heads/}
run: docker push ghcr.io/${{ env.BASE_IMAGE_NAME }}/${{ env.IMAGE_NAME }}:${{ matrix.os_base }}-${{ matrix.php_base }}
- name: Sign image
env:
VAULT_ADDR: ${{ secrets.VAULT_ADDR }}
run: |
export VAULT_TOKEN=$(curl "$VAULT_ADDR"/v1/auth/approle/login --silent --fail -X POST --data '{"role_id": "${{ secrets.VAULT_ROLE_ID_SIGNING }}", "secret_id": "${{ secrets.VAULT_SECRET_ID_SIGNING }}"}' | jq -r '.auth.client_token')
cosign sign --yes --tlog-upload=true --key hashivault://tuleap-additional-tools-signing "$(docker inspect --format='{{index .RepoDigests 0}}' ghcr.io/${{ env.BASE_IMAGE_NAME }}/${{ env.IMAGE_NAME }}:${GITHUB_REF#refs/heads/})"
cosign sign --yes --tlog-upload=true --key hashivault://tuleap-additional-tools-signing "$(docker inspect --format='{{index .RepoDigests 0}}' ghcr.io/${{ env.BASE_IMAGE_NAME }}/${{ env.IMAGE_NAME }}:${{ matrix.os_base }}-${{ matrix.php_base }})"
2 changes: 1 addition & 1 deletion .github/workflows/Build_Docker_Image_PR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ jobs:
with:
persist-credentials: false
- name: Build image
run: docker build -t test-build .
run: docker build -t test-build-${{ matrix.os_base }}-${{ matrix.php_base }} -f ${{ matrix.os_base }}.dockerfile --build-arg="PHP_BASE=${{ matrix.php_base }}" .
51 changes: 27 additions & 24 deletions Dockerfile → el9.dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
FROM rockylinux@sha256:45cc42828cc5ceeffa3a9b4f6363fb582fac3ab91f77bf403daa067f8f049f96
FROM rockylinux@sha256:d7be1c094cc5845ee815d4632fe377514ee6ebcf8efaed6892889657e5ddaaa6

ARG PHP_BASE

ENV container docker

STOPSIGNAL SIGRTMIN+3

COPY tuleap-php-fpm-override.conf /etc/systemd/system/tuleap-php-fpm.service.d/override.conf
COPY xdebug-fpm.ini /etc/opt/remi/php82/php.d/15-xdebug.ini
COPY ${PHP_BASE}-tuleap-php-fpm-override.conf /etc/systemd/system/tuleap-php-fpm.service.d/override.conf
COPY xdebug-fpm.ini /etc/opt/remi/${PHP_BASE}/php.d/15-xdebug.ini

RUN rm -f /lib/systemd/system/multi-user.target.wants/*;\
rm -f /etc/systemd/system/*.wants/*;\
Expand All @@ -16,6 +18,7 @@ RUN rm -f /lib/systemd/system/multi-user.target.wants/*;\
rm -f /lib/systemd/system/anaconda.target.wants/* && \
dnf install -y \
epel-release \
rocky-release-security \
https://rpms.remirepo.net/enterprise/remi-release-9.rpm \
https://ci.tuleap.net/yum/tuleap/rhel/9/dev/x86_64/tuleap-community-release.rpm && \
dnf install -y \
Expand All @@ -41,27 +44,27 @@ RUN rm -f /lib/systemd/system/multi-user.target.wants/*;\
vim \
mysql \
less \
php82-php-intl \
php82-php-bcmath \
php82-php-gd \
php82-php-soap \
php82-php-mysqlnd \
php82-php-xml \
php82-php-mbstring \
php82-php-cli \
php82-php-opcache \
php82-php-process \
php82-php-pdo \
php82-php-fpm \
php82-php-ldap \
php82-php-sodium \
php82-php-pecl-xdebug \
php82-php-intl \
php82-php-bcmath \
php82-php-ffi \
php82-php-pecl-zip \
php82-php-pecl-mailparse \
php82-php-pecl-redis5 && \
${PHP_BASE}-php-intl \
${PHP_BASE}-php-bcmath \
${PHP_BASE}-php-gd \
${PHP_BASE}-php-soap \
${PHP_BASE}-php-mysqlnd \
${PHP_BASE}-php-xml \
${PHP_BASE}-php-mbstring \
${PHP_BASE}-php-cli \
${PHP_BASE}-php-opcache \
${PHP_BASE}-php-process \
${PHP_BASE}-php-pdo \
${PHP_BASE}-php-fpm \
${PHP_BASE}-php-ldap \
${PHP_BASE}-php-sodium \
${PHP_BASE}-php-pecl-xdebug \
${PHP_BASE}-php-intl \
${PHP_BASE}-php-bcmath \
${PHP_BASE}-php-ffi \
${PHP_BASE}-php-pecl-zip \
${PHP_BASE}-php-pecl-mailparse \
${PHP_BASE}-php-pecl-redis5 && \
dnf clean all && \
rm -rf /usr/share/tuleap && \
sed -i 's/inet_interfaces = localhost/inet_interfaces = all/' /etc/postfix/main.cf && \
Expand Down
File renamed without changes.

0 comments on commit 27b79f1

Please sign in to comment.