From e63d65eee99ec7eddc3e29a8757d008428c55b56 Mon Sep 17 00:00:00 2001 From: wanggang <76527413@qq.com> Date: Thu, 3 Jun 2021 10:18:07 +0800 Subject: [PATCH] init --- .drone.yml | 22 ++++++++++++++++++++++ Dockerfile | 9 +++++++++ example.py | 2 ++ requirements.txt | 0 4 files changed, 33 insertions(+) create mode 100644 .drone.yml create mode 100644 Dockerfile create mode 100644 example.py create mode 100644 requirements.txt diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..b5310b9 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,22 @@ +kind: pipeline +type: docker +name: default +platform: + arch: amd64 + os: linux +steps: + - name: test + image: python:3.9.5 + commands: + - pip install -r requirements.txt + - pytest + - name: publish + image: plugins/docker:19.03.8 + environment: + PLUGIN_REGISTRY: 10.10.14.176:5000 + PLUGIN_REPO: 10.10.14.176:5000/python/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..6da3c3b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +FROM python:3.9.5 +WORKDIR /usr/src/app + +COPY requirements.txt ./ +RUN pip install --no-cache-dir -r requirements.txt + +COPY . . + +CMD [ "python", "./example.py" ] \ No newline at end of file diff --git a/example.py b/example.py new file mode 100644 index 0000000..fdefa71 --- /dev/null +++ b/example.py @@ -0,0 +1,2 @@ +#!/usr/bin/env python +print('Hello World!') \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..e69de29