diff --git a/sapi/quickstart/linux/run-alpine-container.sh b/sapi/quickstart/linux/run-alpine-container.sh index eaa0b4fb7b..b2c8f09b27 100644 --- a/sapi/quickstart/linux/run-alpine-container.sh +++ b/sapi/quickstart/linux/run-alpine-container.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -exu __DIR__=$( diff --git a/sapi/quickstart/linux/run-debian-container.sh b/sapi/quickstart/linux/run-debian-container.sh index b58527b544..c2fe991bcb 100644 --- a/sapi/quickstart/linux/run-debian-container.sh +++ b/sapi/quickstart/linux/run-debian-container.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -exu __DIR__=$( diff --git a/sapi/quickstart/linux/run-swoole-cli-builder-container.sh b/sapi/quickstart/linux/run-swoole-cli-builder-container.sh new file mode 100644 index 0000000000..4614188d61 --- /dev/null +++ b/sapi/quickstart/linux/run-swoole-cli-builder-container.sh @@ -0,0 +1,47 @@ +#!/usr/bin/env bash + +set -exu +__DIR__=$( + cd "$(dirname "$0")" + pwd +) +__PROJECT__=$( + cd ${__DIR__}/../../../ + pwd +) +cd ${__PROJECT__} + +MIRROR='' +while [ $# -gt 0 ]; do + case "$1" in + --mirror) + case "$MIRROR" in + china) + MIRROR="$2" + ;; + esac + + ;; + esac + shift $(($# > 0 ? 1 : 0)) +done + +bash setup-php-runtime.sh ${MIRROR} +export PATH=${__PROJECT__}/bin/runtime:$PATH +alias php="php -d curl.cainfo=${__PROJECT__}/bin/runtime/cacert.pem -d openssl.cafile=${__PROJECT__}/bin/runtime/cacert.pem " + +if [ "$MIRROR" = 'china' ]; then + composer config -g repos.packagist composer https://mirrors.tencent.com/composer/ +fi + +composer install --no-interaction --no-autoloader --no-scripts --prefer-dist -vv --profile # --no-dev +composer dump-autoload --optimize --profile + +if [ "$MIRROR" = 'china' ]; then + composer config -g --unset repos.packagist +fi + +php ./prepare.php --skip-download=yes --without-docker=yes + +bash make.sh docker-build ${MIRROR} +bash make.sh docker-bash