Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDK-4845: Add PHP 8.2 Dockerfile #472

Merged
merged 6 commits into from
Sep 19, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
matrix:
php-version: [
'7.4',
'8.1'
'8.2'
DmytroKlymanSpryker marked this conversation as resolved.
Show resolved Hide resolved
]

steps:
Expand Down Expand Up @@ -85,9 +85,9 @@ jobs:
run: composer test-qa

- name: Codecept tests with coverage
if: ${{ matrix.php-version == '8.1' }}
if: ${{ matrix.php-version == '8.2' }}
run: composer test-cover

- name: Code Coverage Report
if: success() && matrix.php-version == '8.1'
if: success() && matrix.php-version == '8.2'
uses: codecov/codecov-action@v1
30 changes: 29 additions & 1 deletion .github/workflows/post-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,34 @@ jobs:
tags: spryker/php-sdk:sprykerci-8.1
labels: SprykerCI

docker-sprykerci-82:
name: Build and push docker image for SprykerCI PHP 8.2
runs-on: ubuntu-22.04
needs: docker
steps:
# https://github.com/actions/checkout
- name: Checkout codebase
uses: actions/checkout@v2

# https://github.com/docker/login-action
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

# https://github.com/docker/build-push-action
- name: Build and push
id: docker_build
uses: docker/build-push-action@v3
with:
context: .
file: ./infrastructure/sdk.sprykerci82.Dockerfile
platforms: linux/amd64
push: true
tags: spryker/php-sdk:sprykerci-8.2
labels: SprykerCI

installer:
name: Create and publish Spryker SDK installer
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -160,7 +188,7 @@ jobs:
trigger-sprykerci:
name: Triggers SprykerCI post-release pipeline
runs-on: ubuntu-22.04
needs: [ docker-sprykerci-74, docker-sprykerci-80, docker-sprykerci-81, installer ]
needs: [ docker-sprykerci-74, docker-sprykerci-80, docker-sprykerci-81, docker-sprykerci-82, installer ]
steps:
- name: Trigger CI pipeline
shell: bash
Expand Down
79 changes: 79 additions & 0 deletions infrastructure/sdk.sprykerci82.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
ARG SPRYKER_PARENT_IMAGE=spryker/php:8.2

FROM ${SPRYKER_PARENT_IMAGE} AS application-production-dependencies

USER root

RUN apk update \
&& apk add --no-cache \
curl \
git \
graphviz \
nodejs \
npm \
rsync \
&& npm install -g [email protected]

RUN git config --add --system safe.directory /project

########################################
# New Relic Extension
# It's already in the core image.
########################################

COPY infrastructure/newrelic/newrelic.ini /usr/local/etc/php/conf.d/90-newrelic.ini

ARG SPRYKER_COMPOSER_MODE

FROM application-production-dependencies AS application-production-codebase

RUN chown spryker:spryker ${srcRoot}

USER spryker
# Authorize SSH Host
RUN mkdir -p /home/spryker/.ssh && \
chmod 0700 /home/spryker/.ssh && \
ssh-keyscan github.com > /home/spryker/.ssh/known_hosts

COPY --chown=spryker:spryker phpstan-bootstrap.php ${srcRoot}/phpstan-bootstrap.php
COPY --chown=spryker:spryker assets ${srcRoot}/assets
COPY --chown=spryker:spryker src ${srcRoot}/src
COPY --chown=spryker:spryker app ${srcRoot}/app
COPY --chown=spryker:spryker db ${srcRoot}/db
COPY --chown=spryker:spryker extension ${srcRoot}/extension
COPY --chown=spryker:spryker config ${srcRoot}/config
COPY --chown=spryker:spryker frontend ${srcRoot}/frontend
COPY --chown=spryker:spryker bin ${srcRoot}/bin
COPY --chown=spryker:spryker .env ${srcRoot}/.env
COPY --chown=spryker:spryker .env.prod ${srcRoot}/.env.prod
COPY --chown=spryker:spryker .env.sprykerci ${srcRoot}/.env.sprykerci
COPY --chown=spryker:spryker composer.json composer.lock package.json package-lock.json bootstrap.php phpstan-bootstrap.php ${srcRoot}/

COPY --chown=spryker:spryker infrastructure/newrelic/entrypoint.sh ${srcRoot}/entrypoint.sh
RUN chmod +x ${srcRoot}/entrypoint.sh

WORKDIR ${srcRoot}

ENV APP_ENV=sprykerci
ENV NRIA_ENABLE_PROCESS_METRICS=true

RUN npm install

RUN composer update \
spryker/architecture-sniffer \
laminas/laminas-config \
laminas/laminas-servicemanager \
laminas/laminas-stdlib \
laminas/laminas-filter \
laminas/laminas-code \
--no-scripts --no-interaction

RUN composer install --no-scripts --no-interaction --optimize-autoloader -vvv --no-dev

RUN composer dump-env sprykerci

RUN bin/console sdk:init:sdk -n

RUN bin/console cache:clear --no-debug

ENTRYPOINT ["/data/entrypoint.sh"]
Loading