first commit

This commit is contained in:
Jack Jackson 2022-10-25 13:48:24 -07:00
commit 9b6b005ca3
4 changed files with 47 additions and 0 deletions

18
.drone.yml Normal file
View File

@ -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

6
Dockerfile Normal file
View File

@ -0,0 +1,6 @@
FROM python:3
COPY script.py .
RUN chmod 700 ./script.py
CMD ["python3", "./script.py"]

0
README.md Normal file
View File

23
script.py Normal file
View File

@ -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()