Browse Source

create installation

Tontowi Prasetyo 5 months ago
parent
commit
495aefcc26
2 changed files with 99 additions and 35 deletions
  1. 99 0
      .gitignore
  2. 0 35
      gogmilestone.py

+ 99 - 0
.gitignore

@@ -0,0 +1,99 @@
1
+# Byte-compiled / optimized Python files
2
+__pycache__/
3
+*.py[cod]
4
+*$py.class
5
+
6
+# C extensions
7
+*.so
8
+
9
+# Distribution / packaging
10
+.Python
11
+build/
12
+develop-eggs/
13
+dist/
14
+downloads/
15
+eggs/
16
+.eggs/
17
+lib/
18
+lib64/
19
+parts/
20
+sdist/
21
+var/
22
+wheels/
23
+pip-wheel-metadata/
24
+share/python-wheels/
25
+*.egg-info/
26
+.installed.cfg
27
+*.egg
28
+
29
+# Virtual environments
30
+env/
31
+venv/
32
+ENV/
33
+.env/
34
+.venv/
35
+
36
+# PyInstaller
37
+#  Usually these files are written by a python script from a template
38
+#  before PyInstaller builds the exe, so as to inject date/other infos into it.
39
+*.manifest
40
+*.spec
41
+
42
+# Installer logs
43
+pip-log.txt
44
+pip-delete-this-directory.txt
45
+
46
+# Unit test / coverage reports
47
+htmlcov/
48
+.tox/
49
+.nox/
50
+.coverage
51
+.coverage.*
52
+.cache
53
+nosetests.xml
54
+coverage.xml
55
+*.cover
56
+*.py,cover
57
+
58
+# Translations
59
+*.mo
60
+*.pot
61
+
62
+# Django stuff:
63
+*.log
64
+local_settings.py
65
+db.sqlite3
66
+
67
+# Flask stuff:
68
+instance/
69
+.webassets-cache
70
+
71
+# Scrapy stuff:
72
+.scrapy
73
+
74
+# Sphinx documentation
75
+docs/_build/
76
+
77
+# PyBuilder
78
+target/
79
+
80
+# Jupyter Notebook
81
+.ipynb_checkpoints
82
+
83
+# IPython
84
+profile_default/
85
+ipython_config.py
86
+
87
+# pyenv
88
+.python-version
89
+
90
+# pipenv
91
+Pipfile.lock
92
+
93
+# PEP 582; used by e.g. github.com/David-OConnor/pyflow
94
+__pypackages__/
95
+
96
+# mypy
97
+.mypy_cache/
98
+.dmypy.json
99
+dmypy.json

+ 0 - 35
gogmilestone.py

@@ -1,35 +0,0 @@
1
-from flask import Flask, request, jsonify
2
-
3
-app = Flask(__name__)
4
-
5
-@app.route('/webhook', methods=['POST'])
6
-def handle_webhook():
7
-    if request.method != 'POST':
8
-        return 'Invalid request method', 405
9
-    
10
-    try:
11
-        payload = request.get_json()
12
-        if not payload:
13
-            return 'Invalid JSON payload', 400
14
-
15
-        repo = payload.get('repository', {}).get('name')
16
-        pusher = payload.get('pusher', {}).get('name')
17
-        before = payload.get('before')
18
-        after = payload.get('after')
19
-
20
-        print(f"Webhook received from repo: {repo} by {pusher}")
21
-        print(f"Commit: {before} -> {after}")
22
-
23
-        return jsonify({'status': 'success'}), 200
24
-
25
-    except Exception as e:
26
-        print(f"Error: {e}")
27
-        return 'Internal server error', 500
28
-
29
-@app.before_request
30
-def log_request():
31
-    print(f"Incoming request: {request.method} {request.url}")
32
-
33
-if __name__ == '__main__':
34
-    app.run(host='0.0.0.0', port=4000)
35
-