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

Allow overriding of the php service's image. #82

Merged
merged 2 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
26 changes: 7 additions & 19 deletions .github/workflows/build-php-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,26 +101,14 @@ jobs:
setup.skipCommonPlugins=true
setup.plugins.@lando/php=/home/runner/work/php/php
telemetry: false

# This block should eventually become use lando/actions-leia@v2
# @NOTE? Do we want a way for our leia-action to configure apparmor since
# this might break a whole bunch of tests? or is this literally just a thing
# for the Lagoon mysql/mariadb container?
- name: Configure apparmor
run: |
set -x
sudo apt-get remove mysql-server --purge
sudo apt-get install apparmor-profiles
sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld

# Test newly built images.
- name: Test Edge Images on PR
uses: lando/run-leia-action@v2
if: ${{ github.event_name == 'pull_request' }}
shell: bash
run: |
yarn leia "./examples/images-edge/${{ matrix.tag }}/README.md" -c 'Destroy tests' --stdin --shell bash
with:
leia-test: "./examples/images-edge/${{ matrix.tag }}/README.md"
- name: Test Stable Images on Push
if: ${{ github.event_name == 'push' }}
shell: bash
run: |
yarn leia "./examples/images-stable/${{ matrix.tag }}/README.md" -c 'Destroy tests' --stdin --shell bash
uses: lando/run-leia-action@v2
if: ${{ github.event_name == 'pull_request' }}
with:
leia-test: "./examples/images-stable/${{ matrix.tag }}/README.md"
7 changes: 4 additions & 3 deletions builders/php.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const parseCli = options => {
*/
const parseNginx = options => {
options.command = (process.platform !== 'win32') ? ['php-fpm'] : ['php-fpm -R'];
options.image = 'fpm';
options.phpServer = 'fpm';
options.remoteFiles.vhosts = '/opt/bitnami/nginx/conf/lando.conf';
options.defaultFiles.vhosts = (options.ssl) ? 'default-ssl.conf.tpl' : 'default.conf.tpl';
options.nginxSsl = options.ssl;
Expand Down Expand Up @@ -110,7 +110,7 @@ module.exports = {
confSrc: path.resolve(__dirname, '..', 'config'),
command: ['sh -c \'a2enmod rewrite && apache2-foreground\''],
composer_version: '2.2.18',
image: 'apache',
phpServer: 'apache',
defaultFiles: {
_php: 'php.ini',
vhosts: 'default.conf',
Expand Down Expand Up @@ -155,7 +155,8 @@ module.exports = {

// Build the php
const php = {
image: `devwithlando/php:${options.version}-${options.image}-${options.suffix}`,
image: _.get(options, 'image') ?
options.image : `devwithlando/php:${options.version}-${options.phpServer}-${options.suffix}`,
environment: _.merge({}, options.environment, {
PATH: options.path.join(':'),
LANDO_WEBROOT: `/app/${options.webroot}`,
Expand Down
Loading