Skip to content

This application provides API for bash-commands execution.

Notifications You must be signed in to change notification settings

Bazhenator/bashExecAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Coverage

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

About

This application provides API for bash-commands execution.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published