# README
BashExecAPI
About the project
This project contains service that provides API to run bash scrips.
API docs
Project has configured swagger API documentation, that can be accessed by endpoint GET /swagger/
API screenshots
Status
The project is in ready for deployment.
Getting started
Download project
To download use:
git clone https://github.com/Bazhenator/bashExecAPI.git
Manual deployment
[!WARNING] You should use Manual deployment if you want to run application without Docker/make etc.
[!IMPORTANT] Follow this instruction to install PostgreSQL on (Linux).
sudo apt update
sudo apt install postgresql postgresql-contrib
Check PostgreSQL status:
service postgresql status
[!IMPORTANT] To install pgAdmin4 (web/desktop) version on Linux follow this link:
Create new server bash with database, user and password specified in configs/config.yaml
Create new table 'commands', or put schema from init.sql in query of bash_db.
[!WARNING] If your server's host or port differs from data in ./configs/config.yaml, please, replace it with actual. (postgres:5432 -> localhost:5432)
[!IMPORTANT] To run application:
cd cmd
go run server.go
Docker deployment
You can use docker deployment, to prepare docker images use:
[!IMPORTANT] You should have installed Docker and docker-compose on your machine
[!CAUTION] This will prune all unused images in the end of build to free up space after multistage Docker image build
make build-images
Then you can simply run
make start-dev
to run docker container using docker-compose, and
make stop-dev
to stop docker container
Run unit tests and update coverage bage
This will run unit tests and update link for coverage bage in README
make unit-test
You can regenerate mocks with
make gogen
Build project
You can build executable files with
make build-bash
Executables will be in /bin folder
Update swagger documentation
[!IMPORTANT] Project uses swaggo, so you should install it
To update swagger documentation after adding new endpoints use:
make swag-bash