diff --git a/quickstart/connection-static-php-cli.sh b/quickstart/connection-static-php-cli.sh new file mode 100644 index 00000000..10973502 --- /dev/null +++ b/quickstart/connection-static-php-cli.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +set -exu +__DIR__=$( + cd "$(dirname "$0")" + pwd +) + +cd ${__DIR__} + +docker exec -it static-php-cli-dev-1 bash diff --git a/quickstart/debian-11-init.sh b/quickstart/debian-11-init.sh new file mode 100644 index 00000000..c5a14e37 --- /dev/null +++ b/quickstart/debian-11-init.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +set -exu +__DIR__=$( + cd "$(dirname "$0")" + pwd +) + +sed -i "s@deb.debian.org@mirrors.ustc.edu.cn@g" /etc/apt/sources.list && \ +sed -i "s@security.debian.org@mirrors.ustc.edu.cn@g" /etc/apt/sources.list + +apt update -y +apt install -y git curl wget ca-certificates +apt install -y xz-utils autoconf automake libclang-13-dev clang lld libtool cmake bison re2c gettext coreutils lzip zip unzip +apt install -y pkg-config bzip2 flex +apt install -y musl-gcc + +# apt install build-essential linux-headers-$(uname -r) \ No newline at end of file diff --git a/quickstart/prepare-php-runtime-linux-x86_64.sh b/quickstart/prepare-php-runtime-linux-x86_64.sh new file mode 100644 index 00000000..dd6e8251 --- /dev/null +++ b/quickstart/prepare-php-runtime-linux-x86_64.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +set -exu +__DIR__=$( + cd "$(dirname "$0")" + pwd +) +__PROJECT__=$( + cd ${__DIR__}/../ + pwd +) +cd ${__PROJECT__} +mkdir -p var +cd ${__PROJECT__}/var + +test -f swoole-cli-v5.0.2-linux-x64.tar.xz || wget -O swoole-cli-v5.0.2-linux-x64.tar.xz https://github.com/swoole/swoole-src/releases/download/v5.0.2/swoole-cli-v5.0.2-linux-x64.tar.xz +test -f swoole-cli-v5.0.2-linux-x64.tar || xz -d -k swoole-cli-v5.0.2-linux-x64.tar.xz +test -f swoole-cli || tar -xvf swoole-cli-v5.0.2-linux-x64.tar +chmod a+x swoole-cli + +test -f composer.phar || wget -O composer.phar https://getcomposer.org/download/2.5.5/composer.phar +chmod a+x composer.phar + +cp -f swoole-cli /usr/local/bin/ +cp -f composer.phar /usr/local/bin/ + +ln -sf /usr/local/bin//swoole-cli /usr/local/bin//php +ln -sf /usr/local/bin//composer.phar /usr/local/bin//composer + diff --git a/quickstart/prepare.sh b/quickstart/prepare.sh new file mode 100644 index 00000000..c278d338 --- /dev/null +++ b/quickstart/prepare.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +set -exu +__DIR__=$( + cd "$(dirname "$0")" + pwd +) +__PROJECT__=$( + cd ${__DIR__}/../ + pwd +) +cd ${__PROJECT__} + +composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/ + +chmod +x bin/spc + +./bin/spc fetch --all --debug + +./bin/spc list-ext +# 构建包含 bcmath,openssl,tokenizer,sqlite3,pdo_sqlite,ftp,curl 扩展的 php-cli 和 micro.sfx +./bin/spc build "bcmath,openssl,tokenizer,sqlite3,pdo_sqlite,ftp,curl" --build-all --cc=gcc --debug \ No newline at end of file diff --git a/quickstart/run-debian-11-container.sh b/quickstart/run-debian-11-container.sh new file mode 100644 index 00000000..63b75761 --- /dev/null +++ b/quickstart/run-debian-11-container.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +set -exu +__DIR__=$( + cd "$(dirname "$0")" + pwd +) +__PROJECT__=$( + cd ${__DIR__}/../ + pwd +) +cd ${__DIR__} + + +{ + docker stop static-php-cli-dev-1 +} || { + echo $? +} +cd ${__DIR__} +IMAGE=debian:11 + +cd ${__DIR__} +docker run --rm --name static-php-cli-dev-1 -d -v ${__PROJECT__}:/work -w /work $IMAGE tail -f /dev/null +