Skip to content

Commit 54000af

Browse files
feat: add cnb script
1 parent fbf58d8 commit 54000af

4 files changed

Lines changed: 41 additions & 2 deletions

File tree

.cnb.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,26 @@ main:
2121
-f node/Dockerfile
2222
node/
2323
--push
24+
web_trigger_build_php_7_2_33_image:
25+
- runner:
26+
tags: cnb:arch:amd64:containerd-snapshotter
27+
services:
28+
- docker
29+
imports: https://cnb.cool/1Panel-dev/secrets/-/blob/main/docker-1panel-envs.yml
30+
stages:
31+
- name: set docker tag
32+
script: echo -n "${DOCKER_REGISTRY}/${DOCKER_GROUP}/php-fpm:$PHP_VERSION"
33+
exports:
34+
info: IMAGE_TAG
35+
- name: docker login
36+
script: docker login -u ${DOCKER_USER} -p "${DOCKER_PWD}" ${DOCKER_REGISTRY}
37+
38+
- name: docker build and push
39+
script: docker buildx build
40+
--platform linux/amd64,linux/arm/v7,linux/arm64,linux/ppc64le,linux/s390x
41+
--build-arg PHP_VERSION=$PHP_VERSION INSTALL_EXT_VERSION=$INSTALL_EXT_VERSION
42+
-t $IMAGE_TAG
43+
-f node/Dockerfile
44+
node/
45+
--push
2446

.cnb/web_trigger.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,21 @@
11
branch:
2+
- buttons:
3+
- name: "编译 PHP 7.2.33 镜像"
4+
event: web_trigger_build_php_7_2_33_image
5+
permissions:
6+
roles:
7+
- owner
8+
inputs:
9+
PHP_VERSION:
10+
name: "PHP 版本"
11+
description: "PHP 版本"
12+
default: "7.2.33"
13+
required: true
14+
INSTALL_EXT_VERSION:
15+
name: "install-php-extensions 版本"
16+
description: "install-php-extensions 版本"
17+
default: "2.8.5"
18+
required: true
219
- buttons:
320
- name: "编译 Node.js 镜像"
421
event: web_trigger_build_node_image

.github/workflows/php7.1.33-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
push: true
4141
build-args:
4242
PHP_VERSION=${{ github.event.inputs.php_version }}
43-
INSTALL_PHP_EXTENSIONS_VERSION=${{ github.event.inputs.install_ext_version }}
43+
INSTALL_EXT_VERSION=${{ github.event.inputs.install_ext_version }}
4444
tags: |
4545
1panel/php:${{ github.event.inputs.php_version }}-fpm
4646
cache-from: type=gha

.github/workflows/php7.2.33-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
push: true
4141
build-args:
4242
PHP_VERSION=${{ github.event.inputs.php_version }}
43-
INSTALL_PHP_EXTENSIONS_VERSION=${{ github.event.inputs.install_ext_version }}
43+
INSTALL_EXT_VERSION=${{ github.event.inputs.install_ext_version }}
4444
tags: |
4545
1panel/php:${{ github.event.inputs.php_version }}-fpm
4646
cache-from: type=gha

0 commit comments

Comments
 (0)