Skip to content

Commit 898791d

Browse files
authored
Merge pull request #904 from jingjingxyk/experiment-feature
Experiment feature
2 parents d8743c5 + bcb3d69 commit 898791d

7 files changed

+73
-12
lines changed

.github/workflows/windows-cygwin.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ jobs:
2626
git config --global core.autocrlf false
2727
git config --global core.eol lf
2828
git config --global core.ignorecase false
29+
git config --global --add safe.directory ${{ github.workspace }}
30+
ipconfig
2931
3032
- uses: actions/checkout@v4
3133
- name: Prepare submodule
@@ -77,7 +79,7 @@ jobs:
7779
run: |
7880
bash ./sapi/scripts/cygwin/install-re2c.sh
7981
80-
- name: Configure
82+
- name: Prepare
8183
shell: C:\cygwin\bin\bash.EXE --noprofile --norc -e -o pipefail -o igncr {0}
8284
run: |
8385
# git config --global --add safe.directory /cygdrive/d/a/swoole-cli/swoole-cli

sapi/quickstart/linux/connection-swoole-cli-alpine.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ __DIR__=$(
88

99
cd ${__DIR__}
1010

11-
docker exec -it woole-cli-builder sh
11+
docker exec -it swoole-cli-alpine-dev sh

sapi/quickstart/linux/run-alpine-container-full.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ __PROJECT__=$(
1212
cd ${__DIR__}
1313

1414
{
15-
docker stop swoole-cli-builder
15+
docker stop swoole-cli-alpine-dev
1616
sleep 5
1717
} || {
1818
echo $?
@@ -73,7 +73,7 @@ cd ${__DIR__}
7373
if [ $DEV_SHM -eq 1 ]; then
7474
mkdir -p /dev/shm/swoole-cli/thirdparty/
7575
mkdir -p /dev/shm/swoole-cli/ext/
76-
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
76+
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
7777
else
78-
docker run --rm --name swoole-cli-builder -d -v ${__PROJECT__}:/work -w /work --init $IMAGE tail -f /dev/null
78+
docker run --rm --name swoole-cli-alpine-dev -d -v ${__PROJECT__}:/work -w /work --init $IMAGE tail -f /dev/null
7979
fi

sapi/quickstart/linux/run-alpine-container.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

33
set -exu
44
__DIR__=$(
@@ -12,7 +12,7 @@ __PROJECT__=$(
1212
cd ${__DIR__}
1313

1414
{
15-
docker stop swoole-cli-builder
15+
docker stop swoole-cli-alpine-dev
1616
sleep 5
1717
} || {
1818
echo $?
@@ -37,4 +37,4 @@ while [ $# -gt 0 ]; do
3737
done
3838

3939
cd ${__DIR__}
40-
docker run --rm --name swoole-cli-builder -d -v ${__PROJECT__}:/work -w /work --init $IMAGE tail -f /dev/null
40+
docker run --rm --name swoole-cli-alpine-dev -d -v ${__PROJECT__}:/work -w /work --init $IMAGE tail -f /dev/null

sapi/quickstart/linux/run-debian-container.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

33
set -exu
44
__DIR__=$(
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
#!/usr/bin/env bash
2+
3+
set -exu
4+
__DIR__=$(
5+
cd "$(dirname "$0")"
6+
pwd
7+
)
8+
__PROJECT__=$(
9+
cd ${__DIR__}/../../../
10+
pwd
11+
)
12+
cd ${__PROJECT__}
13+
14+
MIRROR=''
15+
OPTIONS=''
16+
while [ $# -gt 0 ]; do
17+
case "$1" in
18+
--mirror)
19+
MIRROR="$2"
20+
case "$MIRROR" in
21+
china)
22+
OPTIONS=" --mirror china "
23+
;;
24+
*)
25+
echo "$0 parameter error"
26+
exit 0
27+
;;
28+
esac
29+
30+
;;
31+
esac
32+
shift $(($# > 0 ? 1 : 0))
33+
done
34+
35+
bash setup-php-runtime.sh ${OPTIONS}
36+
export PATH=${__PROJECT__}/bin/runtime:$PATH
37+
alias php="php -d curl.cainfo=${__PROJECT__}/bin/runtime/cacert.pem -d openssl.cafile=${__PROJECT__}/bin/runtime/cacert.pem "
38+
39+
export COMPOSER_ALLOW_SUPERUSER=1
40+
41+
if [ "$MIRROR" = 'china' ]; then
42+
composer config -g repos.packagist composer https://mirrors.tencent.com/composer/
43+
fi
44+
45+
composer install --no-interaction --no-autoloader --no-scripts --prefer-dist -vv --profile # --no-dev
46+
composer dump-autoload --optimize --profile
47+
48+
if [ "$MIRROR" = 'china' ]; then
49+
composer config -g --unset repos.packagist
50+
fi
51+
52+
php ./prepare.php --skip-download=yes --without-docker=yes
53+
54+
bash make.sh docker-build ${MIRROR}
55+
56+
{
57+
docker exec -it swoole-cli-builder which bash
58+
} || {
59+
docker exec -it swoole-cli-builder sh /work/sapi/quickstart/linux/alpine-init.sh ${OPTIONS}
60+
}
61+
62+
bash make.sh docker-bash

sapi/quickstart/windows/cygwin-build/README.md

-3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,3 @@ sapi\quickstart\windows\cygwin-build\install-cygwin.bat
1313

1414

1515
```
16-
17-
18-

0 commit comments

Comments
 (0)