Skip to content

Commit

Permalink
merge code
Browse files Browse the repository at this point in the history
  • Loading branch information
jingjingxyk committed Jan 3, 2025
2 parents 566163e + 8ebc0aa commit 0b2f3ab
Show file tree
Hide file tree
Showing 10 changed files with 77 additions and 9 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/windows-cygwin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ jobs:
git config --global core.autocrlf false
git config --global core.eol lf
git config --global core.ignorecase false
git config --global --add safe.directory ${{ github.workspace }}
ipconfig
- uses: actions/checkout@v4
- name: set php version
Expand Down Expand Up @@ -95,7 +97,7 @@ jobs:
run: |
bash ./sapi/scripts/cygwin/install-re2c.sh
- name: Configure
- name: Prepare
shell: C:\cygwin\bin\bash.EXE --noprofile --norc -e -o pipefail -o igncr {0}
run: |
# git config --global --add safe.directory /cygdrive/d/a/swoole-cli/swoole-cli
Expand Down
2 changes: 1 addition & 1 deletion sapi/quickstart/linux/connection-swoole-cli-alpine.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ __DIR__=$(

cd ${__DIR__}

docker exec -it woole-cli-builder sh
docker exec -it swoole-cli-alpine-dev sh
1 change: 1 addition & 0 deletions sapi/quickstart/linux/extra/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ bash sapi/quickstart/linux/extra/debian-php-init.sh
## 安装 `Composer`

```bash

curl -Lo /usr/local/bin/composer.phar https://getcomposer.org/download/latest-stable/composer.phar

ln -sf /usr/local/bin/composer.phar /usr/local/bin/composer
Expand Down
6 changes: 3 additions & 3 deletions sapi/quickstart/linux/run-alpine-container-full.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ __PROJECT__=$(
cd ${__DIR__}

{
docker stop swoole-cli-builder
docker stop swoole-cli-alpine-dev
sleep 5
} || {
echo $?
Expand Down Expand Up @@ -74,7 +74,7 @@ cd ${__DIR__}
if [ $DEV_SHM -eq 1 ]; then
mkdir -p /dev/shm/swoole-cli/thirdparty/
mkdir -p /dev/shm/swoole-cli/ext/
docker run --rm --name swoole-cli-builder -d -v ${__PROJECT__}:/work -v /dev/shm/swoole-cli/thirdparty/:/work/thirdparty/ -v /dev/shm/swoole-cli/ext/:/work/ext/ -w /work --init $IMAGE tail -f /dev/null
docker run --rm --name swoole-cli-alpine-dev -d -v ${__PROJECT__}:/work -v /dev/shm/swoole-cli/thirdparty/:/work/thirdparty/ -v /dev/shm/swoole-cli/ext/:/work/ext/ -w /work --init $IMAGE tail -f /dev/null
else
docker run --rm --name swoole-cli-builder -d -v ${__PROJECT__}:/work -w /work --init $IMAGE tail -f /dev/null
docker run --rm --name swoole-cli-alpine-dev -d -v ${__PROJECT__}:/work -w /work --init $IMAGE tail -f /dev/null
fi
6 changes: 3 additions & 3 deletions sapi/quickstart/linux/run-alpine-container.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -exu
__DIR__=$(
Expand All @@ -12,7 +12,7 @@ __PROJECT__=$(
cd ${__DIR__}

{
docker stop swoole-cli-builder
docker stop swoole-cli-alpine-dev
sleep 5
} || {
echo $?
Expand All @@ -37,4 +37,4 @@ while [ $# -gt 0 ]; do
done

cd ${__DIR__}
docker run --rm --name swoole-cli-builder -d -v ${__PROJECT__}:/work -w /work --init $IMAGE tail -f /dev/null
docker run --rm --name swoole-cli-alpine-dev -d -v ${__PROJECT__}:/work -w /work --init $IMAGE tail -f /dev/null
2 changes: 1 addition & 1 deletion sapi/quickstart/linux/run-debian-container.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -exu
__DIR__=$(
Expand Down
62 changes: 62 additions & 0 deletions sapi/quickstart/linux/run-swoole-cli-builder-container.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#!/usr/bin/env bash

set -exu
__DIR__=$(
cd "$(dirname "$0")"
pwd
)
__PROJECT__=$(
cd ${__DIR__}/../../../
pwd
)
cd ${__PROJECT__}

MIRROR=''
OPTIONS=''
while [ $# -gt 0 ]; do
case "$1" in
--mirror)
MIRROR="$2"
case "$MIRROR" in
china)
OPTIONS=" --mirror china "
;;
*)
echo "$0 parameter error"
exit 0
;;
esac

;;
esac
shift $(($# > 0 ? 1 : 0))
done

bash setup-php-runtime.sh ${OPTIONS}
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 "

export COMPOSER_ALLOW_SUPERUSER=1

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}

{
docker exec -it swoole-cli-builder which bash
} || {
docker exec -it swoole-cli-builder sh /work/sapi/quickstart/linux/alpine-init.sh ${OPTIONS}
}

bash make.sh docker-bash
1 change: 1 addition & 0 deletions sapi/quickstart/windows/cygwin-build/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@
### cygwin mirror

https://cygwin.com/mirrors.html

1 change: 1 addition & 0 deletions sapi/quickstart/windows/msys2-build/install-msys2.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ pacman -Syy --noconfirm git
# msys2 环境下 拉取 swoole-cli 源码
git clone --recursive https://github.com/swoole/swoole-cli.git


```

```shell
Expand Down
1 change: 1 addition & 0 deletions sapi/scripts/cygwin/cygwin-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ cd ${__PROJECT__}
cd ${__PROJECT__}/php-src

mkdir -p bin/.libs
# export LDFLAGS="-all-static"

LOGICAL_PROCESSORS=$(nproc)

Expand Down

0 comments on commit 0b2f3ab

Please sign in to comment.