mirror of
https://github.com/dunglas/frankenphp.git
synced 2025-12-24 13:38:11 +08:00
shallow clone to save space in CI (#1987)
* shallow clone * also remove source dir after building in CI * formatting * pass them through? * only CI * add as variable
This commit is contained in:
@@ -201,10 +201,15 @@ if [ -f ../cache_key ] && [ "$(cat ../cache_key)" = "${cache_key}" ] && [ -f "bu
|
||||
else
|
||||
${spcCommand} doctor --auto-fix
|
||||
# shellcheck disable=SC2086
|
||||
${spcCommand} download --with-php="${PHP_VERSION}" --for-extensions="${PHP_EXTENSIONS}" --for-libs="${PHP_EXTENSION_LIBS}" ${SPC_OPT_DOWNLOAD_ARGS}
|
||||
${spcCommand} download --with-php="${PHP_VERSION}" --shallow-clone --for-extensions="${PHP_EXTENSIONS}" --for-libs="${PHP_EXTENSION_LIBS}" ${SPC_OPT_DOWNLOAD_ARGS}
|
||||
# shellcheck disable=SC2086
|
||||
${spcCommand} build --enable-zts --build-embed ${SPC_OPT_BUILD_ARGS} "${PHP_EXTENSIONS}" --with-libs="${PHP_EXTENSION_LIBS}"
|
||||
|
||||
if [ -n "$CI" ]; then
|
||||
rm -rf ./downloads
|
||||
rm -rf ./source
|
||||
fi
|
||||
|
||||
echo -n "${cache_key}" >../cache_key
|
||||
fi
|
||||
|
||||
|
||||
@@ -24,6 +24,11 @@ variable "CACHE" {
|
||||
default = ""
|
||||
}
|
||||
|
||||
variable "CI" {
|
||||
# CI flag coming from the environment or --set; empty by default
|
||||
default = ""
|
||||
}
|
||||
|
||||
variable DEFAULT_PHP_VERSION {
|
||||
default = "8.4"
|
||||
}
|
||||
@@ -141,6 +146,7 @@ target "static-builder-musl" {
|
||||
}
|
||||
args = {
|
||||
FRANKENPHP_VERSION = VERSION
|
||||
CI = CI
|
||||
}
|
||||
secret = ["id=github-token,env=GITHUB_TOKEN"]
|
||||
}
|
||||
@@ -165,6 +171,7 @@ target "static-builder-gnu" {
|
||||
args = {
|
||||
FRANKENPHP_VERSION = VERSION
|
||||
GO_VERSION = GO_VERSION
|
||||
CI = CI
|
||||
}
|
||||
secret = ["id=github-token,env=GITHUB_TOKEN"]
|
||||
}
|
||||
|
||||
@@ -29,7 +29,12 @@ ENV GOTOOLCHAIN=local
|
||||
|
||||
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
||||
|
||||
# labels, same as static-builder-musl.Dockerfile
|
||||
# Pass through CI environment flag so build-static.sh can detect CI context
|
||||
ARG CI
|
||||
ENV CI=${CI}
|
||||
|
||||
# labels, same as static-builder.Dockerfile
|
||||
|
||||
LABEL org.opencontainers.image.title=FrankenPHP
|
||||
LABEL org.opencontainers.image.description="The modern PHP app server"
|
||||
LABEL org.opencontainers.image.url=https://frankenphp.dev
|
||||
|
||||
@@ -25,6 +25,9 @@ ENV GOTOOLCHAIN=local
|
||||
|
||||
SHELL ["/bin/ash", "-eo", "pipefail", "-c"]
|
||||
|
||||
ARG CI
|
||||
ENV CI=${CI}
|
||||
|
||||
LABEL org.opencontainers.image.title=FrankenPHP
|
||||
LABEL org.opencontainers.image.description="The modern PHP app server"
|
||||
LABEL org.opencontainers.image.url=https://frankenphp.dev
|
||||
|
||||
Reference in New Issue
Block a user