Skip to content

Commit

Permalink
Reorganize the layer files
Browse files Browse the repository at this point in the history
  • Loading branch information
mnapoli committed Jul 10, 2019
1 parent 2dfd550 commit b7db4c4
Show file tree
Hide file tree
Showing 17 changed files with 38 additions and 122 deletions.
41 changes: 38 additions & 3 deletions runtime/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
SHELL := /bin/bash

# Publish the layers on AWS Lambda
publish: layers
php publish.php
Expand All @@ -6,10 +8,43 @@ publish: layers
layers: export/console.zip export/php-%.zip

# The PHP runtimes
export/php-%.zip:
cd php && make distribution
export/php-%.zip: distribution

# The console runtime
export/console.zip: console/bootstrap
export/console.zip: layers/console/bootstrap
rm -f export/console.zip
cd console && zip ../export/console.zip bootstrap

# Build the docker container that will be used to compile PHP and its extensions
compiler: compiler.Dockerfile
docker build -f ${PWD}/compiler.Dockerfile -t bref/runtime/compiler:latest .

# Compile PHP and its extensions
build: compiler
docker build -f ${PWD}/php-intermediary.Dockerfile -t bref/php-72:latest $(shell helpers/docker_args.sh versions.ini php72) .
docker build -f ${PWD}/layers/fpm-dev/Dockerfile -t bref/php-72-fpm-dev:latest --build-arg LAYER_IMAGE=bref/php-72:latest .
docker build -f ${PWD}/php-intermediary.Dockerfile -t bref/php-73:latest $(shell helpers/docker_args.sh versions.ini php73) .
docker build -f ${PWD}/layers/fpm-dev/Dockerfile -t bref/php-73-fpm-dev:latest --build-arg LAYER_IMAGE=bref/php-73:latest .

# Export the compiled PHP artifacts into zip files that can be uploaded as Lambda layers
distribution: build
# Run the export script for PHP 7.2
docker run --rm \
--env PHP_SHORT_VERSION=72 \
--volume ${PWD}/layers:/layers:ro \
--volume ${PWD}/export:/export \
--volume ${PWD}/export.sh:/export.sh:ro \
bref/php-72:latest \
/export.sh
# Run the export script for PHP 7.3
docker run --rm \
--env PHP_SHORT_VERSION=73 \
--volume ${PWD}/layers:/layers:ro \
--volume ${PWD}/export:/export \
--volume ${PWD}/export.sh:/export.sh:ro \
bref/php-73:latest \
/export.sh

publish: build
docker push bref/php-72:latest
docker push bref/php-73:latest
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
35 changes: 0 additions & 35 deletions runtime/php/Makefile

This file was deleted.

84 changes: 0 additions & 84 deletions runtime/php/readme.md

This file was deleted.

File renamed without changes.

0 comments on commit b7db4c4

Please sign in to comment.