Skip to content

Commit

Permalink
Merge pull request #690 from jingjingxyk/experiment-feature
Browse files Browse the repository at this point in the history
Experiment feature
  • Loading branch information
jingjingxyk committed Jul 11, 2024
2 parents 6b2e4b5 + d46f6ac commit a6a90f5
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion diff.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
->remove('core');

ob_start();
require_once __DIR__ . '/sapi/DownloadPHPSourceCode.php';
require_once __DIR__ . '/sapi/scripts/DownloadPHPSourceCode.php';
$php_source_folder = PHP_SRC_DIR;
ob_end_clean();

Expand Down
14 changes: 10 additions & 4 deletions sapi/docker/build-export-container.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/bin/bash

:<<'COMMENT'
从运行中的容器 将 /usr/local/swoole-cli/ 文件夹 拷贝出来 并生成新容器镜像 和 导出镜像到磁盘
从运行中的容器 将 /usr/local/swoole-cli/ 文件夹 拷贝出来 并生成新容器镜像 ,并把新容器镜像导出为文件
COMMENT

Expand All @@ -19,6 +20,7 @@ cd ${__PROJECT__}


CONTAINER_BASE_IMAGE='docker.io/library/alpine:3.18'
CONTAIENR_NAME='swoole-cli-builder'
MIRROR=''
PLATFORM=''
ARCH=$(uname -m)
Expand All @@ -39,6 +41,10 @@ while [ $# -gt 0 ]; do
--mirror)
MIRROR="$2"
;;
--quickstart-container)
CONTAIENR_NAME='swoole-cli-alpine-dev'
# 从quickstart 生成的容器中拷贝 /usr/local/swoole-cli/ 文件夹,并生成新容器镜像
;;
--*)
echo "Illegal option $1"
;;
Expand All @@ -58,8 +64,8 @@ cd ${__PROJECT__}/var/build-export-container/

test -d swoole-cli && rm -rf swoole-cli

container_id='swoole-cli-builder'
docker cp $container_id:/usr/local/swoole-cli/ .

docker cp ${CONTAIENR_NAME}:/usr/local/swoole-cli/ .


cat > Dockerfile <<'EOF'
Expand Down Expand Up @@ -99,7 +105,7 @@ IMAGE="docker.io/phpswoole/swoole-cli-builder:${TAG}"

echo "MIRROR=${MIRROR}"
echo "BASE_IMAGE=${CONTAINER_BASE_IMAGE}"
docker build -t ${IMAGE} -f ./Dockerfile . --progress=plain --platform ${PLATFORM} --build-arg="MIRROR=${MIRROR}" --build-arg="BASE_IMAGE=${CONTAINER_BASE_IMAGE}"
docker build --no-cache -t ${IMAGE} -f ./Dockerfile . --progress=plain --platform ${PLATFORM} --build-arg="MIRROR=${MIRROR}" --build-arg="BASE_IMAGE=${CONTAINER_BASE_IMAGE}"

echo ${IMAGE}
echo ${IMAGE} > container-image.txt
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

$poject_dir = realpath(__DIR__ . '/../');
$poject_dir = realpath(__DIR__ . '/../../');
$php_version_tag = trim(file_get_contents($poject_dir . '/sapi/PHP-VERSION.conf'));
define("PHP_SRC_DIR", $poject_dir . "/var/php-{$php_version_tag}");
$php_source_folder = PHP_SRC_DIR;
Expand Down
2 changes: 1 addition & 1 deletion sync-source-code.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
declare(strict_types=1);

$project_dir = __DIR__;
require_once __DIR__ . '/sapi/DownloadPHPSourceCode.php';
require_once __DIR__ . '/sapi/scripts/DownloadPHPSourceCode.php';
$php_source_folder = PHP_SRC_DIR;
$sync_dest_dir = $project_dir . '/var/sync-source-code-tmp';

Expand Down

0 comments on commit a6a90f5

Please sign in to comment.