Git Product home page Git Product logo

bash-executor's Introduction

Сервер позволяющий собирать проекты которые нужндаются в xcode

example

Запуск

npm i
npm run start

Зависимости

  • должен быть настроен ssh доступ к запрашиваемым git проектам
  • должены быть установлены используемые утилиты, например (zip)

Запросы

/tasks Роут обрабатывающий задачи

post /task/create Создать задачу

Для выполнения задачи на машине должен быть ssh доступ к данному проекту. В запросе принимается массив команд которые будут выполняться в оболочке оболочке по умолчанию системы. Текущий путь выполнения команды будет инициализированный проект.

  • тело запроса
{
  "repository": "[email protected]:project/example.git",
  "branch": "master",
  "commands": [
    "echo \"bash command this\""
  ]
}
  • ответ

Где id уникальный идентификатор задачи

{
  "id": "XXXXX"
}

get /task/{id} Получить статус выполнения задачи

Аргументы:

  • id - идентификатор задачи

Ответ:

  • code 201 задача в работе
{
  "status": "failed/success/pending/canceled/processing",
  "repository": "[email protected]:project/example.git",
  "commands": [
    {
      "command": "echo \"example\"",
      "status": "status": "failed/success/pending/canceled/processing",
      "message": "stdout"
    }
  ]
}
  • code 200 задача выполнена
{
 "status": "failed/success/pending/canceled/processing",
 "repository": "[email protected]:project/example.git",
 "result": "path/to/project/files",
 "commands": [
   {
     "command": "echo \"example\"",
     "status": "failed/success/pending/canceled/processing",
     "message": "stdout"
   }
 ]
}
  • code 400 произошла ошибка во время выполнения
{
  "status": "failed",
  "repository": "[email protected]:project/example.git",
  "commands": [
    {
      "command": "",
      "status": "failed/success/pending/canceled/processing",
      "message": "stdout"
    }
  ]
}

delete /task/{id} Завершить задачу

После завершения работы необходимо удалить задачу, чтобы можно было переиспользовать скаченный репозиторий и не качать его еще раз.

put /task/{id}/cancel Завершить задачу

Если задачу выполнять болльше не нужно необходимо отменить задачу чтобы выполнения комманд прекратилось. И после если нужно удалить.

/results Роут получения результата

get /results/{project}/{id}/* Получить файл

Ссылку на проект и id вам вырнет метод в поле result

bash-executor's People

Contributors

zhimbura avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.