Skip to content

Commit 7c8725e

Browse files
authored
Fix quickstart connection swoole-cli-builder bug (#902)
* fix quickstart connection continer bug * fix quickstart connection swoole-cli-buider bug * optimize
1 parent a3191b7 commit 7c8725e

5 files changed

+57
-8
lines changed

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,49 @@
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+
case "$MIRROR" in
20+
china)
21+
MIRROR="$2"
22+
OPTIONS=" --mirror china "
23+
;;
24+
esac
25+
26+
;;
27+
esac
28+
shift $(($# > 0 ? 1 : 0))
29+
done
30+
31+
bash setup-php-runtime.sh ${OPTIONS}
32+
export PATH=${__PROJECT__}/bin/runtime:$PATH
33+
alias php="php -d curl.cainfo=${__PROJECT__}/bin/runtime/cacert.pem -d openssl.cafile=${__PROJECT__}/bin/runtime/cacert.pem "
34+
35+
if [ "$MIRROR" = 'china' ]; then
36+
composer config -g repos.packagist composer https://mirrors.tencent.com/composer/
37+
fi
38+
39+
composer install --no-interaction --no-autoloader --no-scripts --prefer-dist -vv --profile # --no-dev
40+
composer dump-autoload --optimize --profile
41+
42+
if [ "$MIRROR" = 'china' ]; then
43+
composer config -g --unset repos.packagist
44+
fi
45+
46+
php ./prepare.php --skip-download=yes --without-docker=yes
47+
48+
bash make.sh docker-build ${MIRROR}
49+
bash make.sh docker-bash

0 commit comments

Comments
 (0)