From 7bf2e3d12c19670f1d3bbab3258d000a5d63cbea Mon Sep 17 00:00:00 2001 From: wanggang <76527413@qq.com> Date: Wed, 2 Jun 2021 17:24:45 +0800 Subject: [PATCH] init --- .drone.yml | 22 ++++++++++++++++++++++ Dockerfile | 4 ++++ composer.json | 5 +++++ index.php | 9 +++++++++ 4 files changed, 40 insertions(+) create mode 100644 .drone.yml create mode 100644 Dockerfile create mode 100644 composer.json create mode 100644 index.php diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..e3b1efb --- /dev/null +++ b/.drone.yml @@ -0,0 +1,22 @@ +kind: pipeline +type: docker +name: default +platform: + arch: amd64 + os: linux +steps: + - name: build + image: composer:2.0.14 + commands: + - composer config repo.packagist composer https://mirrors.aliyun.com/composer/ + - composer install + # - name: publish + # image: plugins/docker:19.03.8 + # environment: + # PLUGIN_REGISTRY: 10.10.14.176:5000 + # PLUGIN_REPO: 10.10.14.176:5000/net5/example + # settings: + # insecure: true + # tags: + # - latest + # - ${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH}-${DRONE_REPO_BRANCH}-${DRONE_COMMIT_SHA:0:8} diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..fe1dfaa --- /dev/null +++ b/Dockerfile @@ -0,0 +1,4 @@ +FROM php:7.4-cli +COPY . /usr/src/myapp +WORKDIR /usr/src/myapp +CMD [ "php", "./your-script.php" ] \ No newline at end of file diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..814995b --- /dev/null +++ b/composer.json @@ -0,0 +1,5 @@ +{ + "require": { + "monolog/monolog": "2.0.*" + } +} \ No newline at end of file diff --git a/index.php b/index.php new file mode 100644 index 0000000..bc6ecc4 --- /dev/null +++ b/index.php @@ -0,0 +1,9 @@ +require 'vendor/autoload.php'; + +pushHandler(new Monolog\Handler\StreamHandler('app.log', Monolog\Logger::WARNING)); + +$log->addWarning('Foo'); +?> +

php composer

\ No newline at end of file