commit 9b6b005ca3e7876a8c27766e6c8754de69152e85 Author: Jack Jackson Date: Tue Oct 25 13:48:24 2022 -0700 first commit diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..b47a6d5 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,18 @@ +kind: pipeline +name: auto-repo-update-drone-plugin +type: docker + +platform: + os: linux + arch: arm64 + +steps: + - name: push-built-image + image: plugins/docker + settings: + registry: gitea.scubbo.org + repo: gitea.scubbo.org/scubbo/auto-update-test-app-code + tags: ${DRONE_COMMIT_SHA:0:10} + username: scubbo + password: + from_secret: gitea_password \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..29356f5 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,6 @@ +FROM python:3 + +COPY script.py . +RUN chmod 700 ./script.py + +CMD ["python3", "./script.py"] \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 diff --git a/script.py b/script.py new file mode 100644 index 0000000..9656506 --- /dev/null +++ b/script.py @@ -0,0 +1,23 @@ +#!/usr/bin/env python3 +import http.server +from http.server import HTTPServer + + +class HelloWorldRequestHandler(http.server.BaseHTTPRequestHandler): + def do_GET(self): # noqa - it is correct for `GET` to be uppercase + self.send_response(200) + self.send_header('Content-type', 'text/html') + self.send_header('X-Clacks-Overhead', 'GNU Terry Pratchett') + self.end_headers() + + self.wfile.write(bytes('Hello world!', 'utf8')) + + +def main(): + server_address = ('', 8000) + httpd = HTTPServer(server_address, HelloWorldRequestHandler) + httpd.serve_forever() + + +if __name__ == '__main__': + main()