From b8cbdd84d3a0225df859cd69940883e46a5d534f Mon Sep 17 00:00:00 2001 From: Greg Bowler Date: Fri, 3 Feb 2023 13:56:30 +0000 Subject: [PATCH 1/5] feature: set memory_limit to 4G --- php-build.bash | 5 ++++- php-build.ini | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 php-build.ini diff --git a/php-build.bash b/php-build.bash index 3c239d5..6197b6b 100644 --- a/php-build.bash +++ b/php-build.bash @@ -1,7 +1,7 @@ #!/bin/bash set -e -php_build_version="build2.1.0" +php_build_version="build2.1.1" # Check for required variables: if [ "$#" -lt 1 ]; then @@ -73,6 +73,9 @@ do done dockerfile_unique="${dockerfile_unique}-${php_build_version}" +dockerfile="${dockerfile} +ADD ./php-build.ini /usr/local/etc/php/conf.d" + # Remove illegal characters and make lowercase: GITHUB_REPOSITORY="${GITHUB_REPOSITORY,,}" dockerfile_unique="${dockerfile_unique// /_}" diff --git a/php-build.ini b/php-build.ini new file mode 100644 index 0000000..b50f3c9 --- /dev/null +++ b/php-build.ini @@ -0,0 +1,2 @@ +;INI settings to set within Github Action's build runner +memory_limit=4G From 57f70b21cd4e028b60348ba9b7636fe9c0152427 Mon Sep 17 00:00:00 2001 From: Greg Bowler Date: Wed, 15 Feb 2023 17:07:24 +0000 Subject: [PATCH 2/5] wip: add debug step --- php-build.bash | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/php-build.bash b/php-build.bash index 6197b6b..8479c04 100644 --- a/php-build.bash +++ b/php-build.bash @@ -108,9 +108,16 @@ echo "Building PHP $ACTION_PHP_VERSION with extensions: $ACTION_PHP_EXTENSIONS . # need to re-build, and the `docker build` step should use the cached layers of # what has just been pulled. echo "$dockerfile" > Dockerfile-php-build -echo "Dockerfile:" >> output.log 2>&1 -echo "$dockerfile" >> output.log 2>&1 -docker build --tag "$docker_tag" --cache-from "$docker_tag" --file Dockerfile-php-build . >> output.log 2>&1 +if [ ACTIONS_RUNNER_DEBUG = "true" ] +then + echo "Dockerfile:" + echo "$dockerfile" + echo docker build --tag "$docker_tag" --cache-from "$docker_tag" --file Dockerfile-php-build . + docker build --tag "$docker_tag" --cache-from "$docker_tag" --file Dockerfile-php-build . +else + docker build --tag "$docker_tag" --cache-from "$docker_tag" --file Dockerfile-php-build . >> output.log 2>&1 +fi + # Update the user's repository with the customised docker image, ready for the # next Github Actions run. if ! docker push "$docker_tag" >> output.log 2>&1; then From 97ac71b53ff6daca57e3ecd4847ece307a34cf2e Mon Sep 17 00:00:00 2001 From: Greg Bowler Date: Wed, 15 Feb 2023 17:14:41 +0000 Subject: [PATCH 3/5] wip: add debug step --- php-build.bash | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/php-build.bash b/php-build.bash index 8479c04..3a100e5 100644 --- a/php-build.bash +++ b/php-build.bash @@ -113,11 +113,11 @@ then echo "Dockerfile:" echo "$dockerfile" echo docker build --tag "$docker_tag" --cache-from "$docker_tag" --file Dockerfile-php-build . - docker build --tag "$docker_tag" --cache-from "$docker_tag" --file Dockerfile-php-build . -else - docker build --tag "$docker_tag" --cache-from "$docker_tag" --file Dockerfile-php-build . >> output.log 2>&1 + fi +docker build --tag "$docker_tag" --cache-from "$docker_tag" --file Dockerfile-php-build . #>> output.log 2>&1 + # Update the user's repository with the customised docker image, ready for the # next Github Actions run. if ! docker push "$docker_tag" >> output.log 2>&1; then From 5e45d00e4a701525bb48c3a906694bbf9a3583bd Mon Sep 17 00:00:00 2001 From: Greg Bowler Date: Wed, 15 Feb 2023 17:18:05 +0000 Subject: [PATCH 4/5] wip: inline ini --- php-build.bash | 5 +++++ php-build.ini | 2 -- 2 files changed, 5 insertions(+), 2 deletions(-) delete mode 100644 php-build.ini diff --git a/php-build.bash b/php-build.bash index 3a100e5..4ec9cf3 100644 --- a/php-build.bash +++ b/php-build.bash @@ -76,6 +76,11 @@ dockerfile_unique="${dockerfile_unique}-${php_build_version}" dockerfile="${dockerfile} ADD ./php-build.ini /usr/local/etc/php/conf.d" +cat > ./php-build.ini<< EOF +;INI settings to set within Github Action's build runner +memory_limit=4G +EOF + # Remove illegal characters and make lowercase: GITHUB_REPOSITORY="${GITHUB_REPOSITORY,,}" dockerfile_unique="${dockerfile_unique// /_}" diff --git a/php-build.ini b/php-build.ini deleted file mode 100644 index b50f3c9..0000000 --- a/php-build.ini +++ /dev/null @@ -1,2 +0,0 @@ -;INI settings to set within Github Action's build runner -memory_limit=4G From c2f6f2fb090360d81f72a067ae3b2e489eae1dcb Mon Sep 17 00:00:00 2001 From: Greg Bowler Date: Wed, 15 Feb 2023 17:23:31 +0000 Subject: [PATCH 5/5] wip: suppress output --- php-build.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php-build.bash b/php-build.bash index 4ec9cf3..b977aca 100644 --- a/php-build.bash +++ b/php-build.bash @@ -121,7 +121,7 @@ then fi -docker build --tag "$docker_tag" --cache-from "$docker_tag" --file Dockerfile-php-build . #>> output.log 2>&1 +docker build --tag "$docker_tag" --cache-from "$docker_tag" --file Dockerfile-php-build . >> output.log 2>&1 # Update the user's repository with the customised docker image, ready for the # next Github Actions run.