GitFx - Create a Serverless service in Git hosting
GitFx can be used to run some functions and serve the output as a service in a Git hosting.
GitFx is a Python lib extracted from an action ActionServerless. And now the action uses this lib as a dependency to do the real job, you can run the lib locally in a same way as in the action.
Prerequisites
- Python 3.5+
- Docker
Install
pip3 install gitfx
# or
python3 -m pip install gitfx
Note: Python 2 is not supported
Usage
Let's start with a Python code that'll be used to create a Serverless service:
# function.py
import json
# GET /api/py_hello.json
print(json.dumps({"hello": "world"}))
put the program to a path under current directory, for example, test folder and run:
python3 -m gitfx test/
# you can pass more folders if you have
then the program's output is written to a file located in api/py_hello.json that you defined as a route in the comment.
You can use the ActionServerless to run functions in GitHub, and also you can run locally as above example then push the generated files to the remote.
more languages' examples you can find here.
Languages supported
| Language | Dependency Installation | Version Management | Example code |
|---|---|---|---|
| Python | ✅ requirements.txt |
✅ .python-version pyenv |
See |
| Ruby | ✅ Gemfile |
✅ .ruby-version rvm/rbenv |
See |
| Node.js | ✅ package.json |
✅ .nvmrc nvm |
See |
| Perl | ✅ cpanfile |
✅ .perl-version plenv |
See |
| PHP | ✅ composer.json |
✅ .phpenv-version phpenv |
See |
| Golang | ⬜️ | ⬜️ | See |
| Haskell | ⬜️ | ⬜️ | See |
| Elixir | ⬜️ | ⬜️ | See |
| Bash | -- | -- | See |
| Rust | ⬜️ | ⬜️ | See |
| Deno | -- | ⬜️ | See |
- ✅ Feature supported
- ⬜ Feature not supported yet
- -- N/A
Documents
Real world examples
Contributions
Contributions are welcome! You may check the following features in case you'd like to contribute but no idea what to do:
- Support to add your favorite languages
- Support dependency installation to the existing languages
- Use this action to create an application and share it
Metadata
Release files for GitFx 0.0.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| GitFx-0.0.8.tar.gz | 9.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| GitFx-0.0.8-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 20.9 kB
Release files / GitFx-0.0.8.tar.gz
| Download URL | GitFx-0.0.8.tar.gz |
|---|---|
| Size | 9.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d87d9f7d73825eef1b3a03bd3e3016b9c6557f3a9b5377cdd85d850803830208
|
|
BLAKE2b-256 checksum How to use checksums |
d7c73d7bc44a021fb0632215db452d70b8f0a9490cc410bd90c36025fba598c7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.11
|
Release files / GitFx-0.0.8-py3-none-any.whl
| Download URL | GitFx-0.0.8-py3-none-any.whl |
|---|---|
| Size | 11.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
aeae33566386dd1063b530562a94071d05a54ab12e65d4dafcd39ef43ecebc7f
|
|
BLAKE2b-256 checksum How to use checksums |
d2ee789450a5c34efa60875a7a2ab23428289ab15ce260e5b998b3db64856cde
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.11
|