File tree Expand file tree Collapse file tree 11 files changed +68
-62
lines changed Expand file tree Collapse file tree 11 files changed +68
-62
lines changed Original file line number Diff line number Diff line change 1- name : build-swoole -cli-windows-msys2
1+ name : build-php -cli-windows-msys2
22
33on :
44 push :
Original file line number Diff line number Diff line change 11# 升级 PHP 版本 步骤
22
3- > 1、修改 sapi/PHP-VERSION.conf 文件里版本号即可
4-
5- > 2、修改 sync-source-code.php 文件里 PHP 源码包的 sha256sum 配置
6-
7- > 3、执行同步源码脚本, 拉取 PHP 官方源码 到本项目
8-
9- > 4、sapi/cli/ 代码的升级,需要手动确认
3+ 1 . 修改 ` sapi/PHP-VERSION.conf ` 文件里版本号即可
4+ 2 . 修改 ` sync-source-code.php ` 文件里 PHP 源码包的 sha256sum 配置
5+ 3 . 执行同步源码脚本, 拉取 PHP 官方源码 到本项目
6+ 4 . sapi/cli 代码的升级,需要手动确认
107
118``` shell
129
@@ -17,8 +14,8 @@ php sync-source-code.php
1714php sync-source-code.php --action run
1815
1916
20- ./bin/ runtime/php -c ./bin/ runtime/php.ini sync-source-code.php
21- ./bin/ runtime/php -c ./bin/ runtime/php.ini sync-source-code.php --action run
17+ ./runtime/php/php -c ./runtime/php /php.ini sync-source-code.php
18+ ./runtime/php/php -c ./runtime/php /php.ini sync-source-code.php --action run
2219
2320```
2421
Original file line number Diff line number Diff line change @@ -49,12 +49,6 @@ while [ $# -gt 0 ]; do
4949 shift $(( $# > 0 ? 1 : 0 ))
5050done
5151
52- case " $MIRROR " in
53- china | openatom)
54- CONTAINER_BASE_IMAGE=" docker.io/library/alpine:3.18"
55- ;;
56- esac
57-
5852mkdir -p var/build-export-container/
5953cd ${__PROJECT__} /var/build-export-container/
6054
Original file line number Diff line number Diff line change 1- FROM nginx:1.23 -alpine
1+ FROM nginx:1.27 -alpine
22
33RUN rm -rf /usr/share/nginx/html/*
44ADD ./default.conf /etc/nginx/conf.d/default.conf
Original file line number Diff line number Diff line change 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 ${__DIR__}
13+
14+ {
15+ docker stop swoole-cli-alpine-dev
16+ sleep 5
17+ } || {
18+ echo $?
19+ }
20+ cd ${__DIR__}
21+
22+ IMAGE=alpine:3.18
23+
24+ cd ${__DIR__}
25+
26+ mkdir -p /dev/shm/swoole-cli/thirdparty/
27+ mkdir -p /dev/shm/swoole-cli/ext/
28+ mkdir -p /dev/shm/swoole-cli/var/
29+
30+ docker run --rm --name swoole-cli-alpine-dev -d \
31+ -v ${__PROJECT__} :/work \
32+ -v /dev/shm/swoole-cli/thirdparty/:/work/thirdparty/ \
33+ -v /dev/shm/swoole-cli/ext/:/work/ext/ \
34+ -v /dev/shm/swoole-cli/var/:/work/var/ \
35+ -w /work --init $IMAGE tail -f /dev/null
Original file line number Diff line number Diff line change @@ -21,20 +21,5 @@ cd ${__DIR__}
2121
2222IMAGE=alpine:3.18
2323
24- MIRROR=' '
25- while [ $# -gt 0 ]; do
26- case " $1 " in
27- --mirror)
28- MIRROR=" $2 "
29- case " $MIRROR " in
30- china | openatom)
31- IMAGE=" docker.io/library/alpine:3.18"
32- ;;
33- esac
34- ;;
35- esac
36- shift $(( $# > 0 ? 1 : 0 ))
37- done
38-
3924cd ${__DIR__}
4025docker run --rm --name swoole-cli-alpine-dev -d -v ${__PROJECT__} :/work -w /work --init $IMAGE tail -f /dev/null
Original file line number Diff line number Diff line change @@ -21,20 +21,5 @@ cd ${__DIR__}
2121
2222IMAGE=debian:12
2323
24- MIRROR=' '
25- while [ $# -gt 0 ]; do
26- case " $1 " in
27- --mirror)
28- MIRROR=" $2 "
29- case " $MIRROR " in
30- china | openatom)
31- IMAGE=" docker.io/library/debian:12"
32- ;;
33- esac
34- ;;
35- esac
36- shift $(( $# > 0 ? 1 : 0 ))
37- done
38-
3924cd ${__DIR__}
4025docker run --rm --name swoole-cli-debian-dev -d -v ${__PROJECT__} :/work -w /work --init $IMAGE tail -f /dev/null
Original file line number Diff line number Diff line change @@ -33,15 +33,15 @@ while [ $# -gt 0 ]; do
3333 shift $(( $# > 0 ? 1 : 0 ))
3434done
3535
36- if [ ! -f ${__PROJECT__} /runtime/php ]; then
36+ if [ ! -f ${__PROJECT__} /runtime/php/php ]; then
3737 {
3838 bash setup-php-runtime.sh $OPTIONS
3939 } || {
4040 echo $?
4141 }
4242fi
43- export PATH=${__PROJECT__} /runtime:$PATH
44- alias php=" php -d curl.cainfo=${__PROJECT__} /runtime/cacert.pem -d openssl.cafile=${__PROJECT__} /runtime/cacert.pem "
43+ export PATH=${__PROJECT__} /runtime/php/ :$PATH
44+ alias php=" php -d curl.cainfo=${__PROJECT__} /runtime/php/ cacert.pem -d openssl.cafile=${__PROJECT__} /runtime/php /cacert.pem "
4545
4646export COMPOSER_ALLOW_SUPERUSER=1
4747
Original file line number Diff line number Diff line change 513513if [ "$1" = "docker-build" ] ;then
514514 MIRROR=""
515515 CONTAINER_BASE_IMAGE='docker.io/library/alpine:3.18'
516- if [ -n "$2" ]; then
517- MIRROR=$2
518- case "$MIRROR" in
519- china | openatom)
520- CONTAINER_BASE_IMAGE="docker.io/library/alpine:3.18"
521- ;;
522- esac
523- fi
524516 PLATFORM=''
525517 ARCH=$(uname -m)
526518 case $ARCH in
Original file line number Diff line number Diff line change @@ -71,10 +71,12 @@ if [ $OS = 'windows' ]; then
7171fi
7272
7373MIRROR=' '
74+ CURL_OPTIONS=" "
7475while [ $# -gt 0 ]; do
7576 case " $1 " in
7677 --mirror)
7778 MIRROR=" $2 "
79+ CURL_OPTIONS+=" -H 'Referer: https://www.swoole.com/download' -H 'User-Agent: download swoole-cli runtime with setup-php-runtime.sh' -H 'X-Auth-Token: 6F0A7F038A69'"
7880 ;;
7981 --proxy)
8082 export HTTP_PROXY=" $2 "
@@ -104,6 +106,13 @@ china)
104106
105107esac
106108
109+ downloader () {
110+ local file=$1
111+ local url=$2
112+ local cmd=$( echo " curl $CURL_OPTIONS -fSLo $file $url " )
113+ eval $cmd
114+ }
115+
107116test -f composer.phar || curl -fSLo composer.phar ${COMPOSER_DOWNLOAD_URL}
108117chmod a+x composer.phar
109118
@@ -114,13 +123,13 @@ APP_RUNTIME="${APP_NAME}-${APP_VERSION}-${OS}-${ARCH}"
114123if [ $OS = ' windows' ]; then
115124 {
116125 APP_RUNTIME=" ${APP_NAME} -${APP_VERSION} -cygwin-${ARCH} "
117- test -f ${APP_RUNTIME} .zip || curl -fSLo ${APP_RUNTIME} .zip ${APP_DOWNLOAD_URL}
126+ test -f ${APP_RUNTIME} .zip || downloader ${APP_RUNTIME} .zip ${APP_DOWNLOAD_URL}
118127 test -d ${APP_RUNTIME} && rm -rf ${APP_RUNTIME}
119128 unzip " ${APP_RUNTIME} .zip"
120129 exit 0
121130 }
122131else
123- test -f ${APP_RUNTIME} .tar.xz || curl -fSLo ${APP_RUNTIME} .tar.xz ${APP_DOWNLOAD_URL}
132+ test -f ${APP_RUNTIME} .tar.xz || downloader ${APP_RUNTIME} .tar.xz ${APP_DOWNLOAD_URL}
124133 test -f ${APP_RUNTIME} .tar || xz -d -k ${APP_RUNTIME} .tar.xz
125134 test -f swoole-cli && rm -f swoole-cli
126135 tar -xvf ${APP_RUNTIME} .tar
You can’t perform that action at this time.
0 commit comments