This Flask application provides endpoints to automate the git pull operation for three different repositories. It listens for HTTP POST requests and performs a git pull operation in the respective local repository directory upon receiving a valid payload.
- Three endpoints to handle
git pulloperations for three different repositories (repo1,repo2, andrepo3). - Validates the incoming payload to ensure it contains the necessary information before executing the
git pull. - Returns the output of the
git pullcommand as a JSON response.
Pulls the latest changes from the remote repository to the local repository for repo1.
Pulls the latest changes from the remote repository to the local repository for repo2.
Pulls the latest changes from the remote repository to the local repository for repo3.
- Python 3.x
- Flask
-
Clone the repository:
-
Navigate to the project directory:
cd your-repository-directory -
Install the required dependencies:
pip install Flask
- Run the Flask application:
python autogitpull-flask.py
- The application will start and listen on port
999by default.
autogitpull-flask2.py features sending a message to discord via webhook. If you want to see the commit histories on Discord, feel free to use autogitpull-flask2.
You will need to pip install requests datetime in order to properly use it.