Skip to content

Commit

Permalink
master: Merge branch 'release/1.0.1' # Please enter a commit message …
Browse files Browse the repository at this point in the history
…to explain why this merge is necessary, # especially if it merges an updated upstream into a topic branch. # # Lines starting with '#' will be ignored, and an empty message aborts # the commit.
  • Loading branch information
lowitea committed Dec 27, 2020
2 parents db1b783 + 5e25104 commit 293a40a
Show file tree
Hide file tree
Showing 20 changed files with 205 additions and 211 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/gen-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Setup mdBook
uses: peaceiris/actions-mdbook@v1
with:
mdbook-version: '0.4.3'
mdbook-version: '0.4.4'

- name: Build docs
run: mdbook build docs
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
# Version history
We follow [Semantic Versions](https://semver.org/).

## 1.0.1 - Improving docs

### Important changes
- Improving docs [#91](https://github.com/Uma-Tech/parrot/pull/91)

### Updating dependencies
- django-simpleui from 2020.9.26 to 2021.1.1 [#80](https://github.com/Uma-Tech/parrot/pull/80)
- pytest from 6.1.2 to 6.2.1 [#88](https://github.com/Uma-Tech/parrot/pull/88)
- uvicorn from 0.12.3 to 0.13.2 [#89](https://github.com/Uma-Tech/parrot/pull/89)

## 1.0.0 - First stable release
### New functionality
- Custom script for each request [#70](https://github.com/Uma-Tech/parrot/pull/70)
Expand Down
116 changes: 3 additions & 113 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ Code quality:
[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=Uma-Tech_parrot&metric=reliability_rating)](https://sonarcloud.io/dashboard?id=Uma-Tech_parrot)
[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=Uma-Tech_parrot&metric=security_rating)](https://sonarcloud.io/dashboard?id=Uma-Tech_parrot)

---
<br>
<br>
<br>

<p align="center">
<img src="https://github.com/Uma-Tech/parrot/raw/master/static/parrot_icon.png">
Expand All @@ -30,118 +32,6 @@ Code quality:
1. Issue tracker: [https://github.com/Uma-Tech/parrot/issues](https://github.com/Uma-Tech/parrot/issues)
1. Changelog: [https://github.com/Uma-Tech/parrot/blob/develop/CHANGELOG.md](https://github.com/Uma-Tech/parrot/blob/develop/CHANGELOG.md)

## Quickstart (with Docker)
1. Clone the repo
```shell
git clone git@github.com:Uma-Tech/parrot.git
```

1. Build or download the docker image
_for build_
```shell
make build
```
_for download_
```shell script
docker pull umahighload/parrot-app:latest
```

1. Apply migrations and create a superuser:
```shell
make shell
# inside the container
python manage.py migrate # apply migrations
python manage.py createsuperuser # create a superuser
exit ## leave from the container
```

1. Start app with required services
```shell
make runserver
```

1. Service will be available at `http://127.0.0.1:8042/`

## Start the project for development without Docker
1. Clone the repo and go to the project directory
```shell
git clone git@github.com:Uma-Tech/parrot.git
cd parrot
```

1. Install dependencies
```shell
poetry install
```

1. Start databases
_You can start databases in any other way_
```shell
# start postgres
docker run \
--name postgres \
-d \
--rm \
-e POSTGRES_PASSWORD=parrot \
-e POSTGRES_USER=parrot \
--network host \
-v parrot_db:/var/lib/postgresql/data \
postgres
# start redis
docker run \
--name redis \
-d \
--rm \
--network host \
redis
```

1. Setting required environment variables
_Alternatively, you can create a local `.env` file with the variables_
```shell
export PARROT_DB_HOST=127.0.0.1
export PARROT_SECRET_KEY=NO_SECRET
export PARROT_CELERY_BROKER_URL=redis://127.0.0.1
```

1. Build static
```shell
poetry run python manage.py collectstatic --no-input
```

1. Apply database migrations
```shell
poetry run python manage.py migrate
```

1. Create a django superuser
```shell
poetry run python manage.py createsuperuser
```

1. Start the django app
```shell
poetry run python manage.py runserver
```

1. Start the celery worker
_Run in a separate terminal window_
```shell
poetry run celery -A parrot worker -l INFO -c 4
```


## System requirements
* docker ([https://www.docker.com/](https://www.docker.com/))
* docker-compose
([https://github.com/docker/compose](https://github.com/docker/compose))
* make
([https://www.gnu.org/software/make/](https://www.gnu.org/software/make/))
_(all commands can be viewed by calling `make` without parameters)_
* poetry _(for development)_
([https://python-poetry.org/](https://python-poetry.org/))

## Components
1. Database postgres.
1. Database redis (for background celery-tasks).
Expand Down
19 changes: 12 additions & 7 deletions docs/src/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
# Summary
# Parrot

- [About Parrot!](./index.md)
- [Quick Start](./quick_start.md)
- [System requires](./qs_system_requires.md)
- [Local run](./qs_local_run.md)
- [Usage](./qs_usage.md)
- [Contributing](./contributing.md)
- [About Parrot!](index.md)
- [Quick Start](quick-start/index.md)
- [System requires](quick-start/system-requires.md)
- [Local run](quick-start/local-run.md)
- [Usage](usage/index.md)
- [First steps](usage/first-steps.md)
- [Request scripts](usage/request-scripts.md)
- [Changelog](changelog.md)
- [Contributing](contributing.md)

---
[Contributors](./contributors.md)

[Contributors](contributors.md)
1 change: 1 addition & 0 deletions docs/src/changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{#include ../../CHANGELOG.md}}
8 changes: 1 addition & 7 deletions docs/src/contributing.md
Original file line number Diff line number Diff line change
@@ -1,7 +1 @@
# Contributing

We welcome all contributions!
See [CONTRIBUTING.md](https://github.com/Uma-Tech/parrot/blob/develop/CONTRIBUTING.md)
if you want to contribute.
You can start with [issues that need some help](https://github.com/Uma-Tech/parrot/issues)
right now.
{{#include ../../CONTRIBUTING.md}}
1 change: 1 addition & 0 deletions docs/src/contributors.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@

- Evgeniy [lowitea](https://github.com/lowitea)
- Eugene Morozov [emorozov](https://github.com/emorozov)
- Petr [PetrS](https://github.com/PetrS12)
Binary file added docs/src/images/05.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/images/06.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 1 addition & 24 deletions docs/src/index.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,4 @@
# Parrot
_Web-service for testing http requests and webhooks._

[![Docker Image Version (tag latest semver)](https://img.shields.io/docker/v/umahighload/parrot-app/latest)](https://registry.hub.docker.com/r/umahighload/parrot-app)
![Python Version](https://img.shields.io/static/v1?label=python&message=3.8&color=blue)
![License](https://img.shields.io/static/v1?label=license&message=Apache+2&color=blue)

<p align="center">
<br />
<br />
<img src="https://github.com/Uma-Tech/parrot/raw/master/static/parrot_icon.png">
<br />
</p>

## Links:
1. Repository: [https://github.com/Uma-Tech/parrot](https://github.com/Uma-Tech/parrot)
1. Documentation: [https://uma-tech.github.io/parrot/](https://uma-tech.github.io/parrot/)
1. Docker Hub: [https://registry.hub.docker.com/r/umahighload/parrot-app](https://registry.hub.docker.com/r/umahighload/parrot-app)
1. Issue tracker: [https://github.com/Uma-Tech/parrot/issues](https://github.com/Uma-Tech/parrot/issues)
1. Changelog: [https://github.com/Uma-Tech/parrot/blob/develop/CHANGELOG.md](https://github.com/Uma-Tech/parrot/blob/develop/CHANGELOG.md)

## Components
1. Postgres database.
1. Python-app based on Django Web Framework.
{{#include ../../README.md}}

## Screenshots
![](./images/01.jpg)
Expand Down
32 changes: 0 additions & 32 deletions docs/src/qs_local_run.md

This file was deleted.

4 changes: 4 additions & 0 deletions docs/src/quick-start/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Quick Start

1. [System requires](system-requires.md)
1. [Local run](local-run.md)
103 changes: 103 additions & 0 deletions docs/src/quick-start/local-run.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# Local run

## Quickstart (with Docker)
1. Clone the repo
```shell
git clone git@github.com:Uma-Tech/parrot.git
cd parrot
```

1. Build or download the docker image
_for build_
```shell
make build
```
_for download_
```shell script
docker pull umahighload/parrot-app:latest
```

1. Apply migrations and create a superuser:
```shell
make shell
# inside the container
python manage.py migrate # apply migrations
python manage.py createsuperuser # create a superuser
exit ## leave from the container
```

1. Start the app and its dependencies
```shell
make runserver
```

1. You will be able to access the service at `http://127.0.0.1:8042/`

## Start the project for development without Docker
1. Clone the repo and go to the project directory
```shell
git clone git@github.com:Uma-Tech/parrot.git
cd parrot
```

1. Install dependencies
```shell
poetry install
```

1. Start databases
_You can start databases in any other way_
```shell
# start postgres
docker run \
--name postgres \
-d \
--rm \
-e POSTGRES_PASSWORD=parrot \
-e POSTGRES_USER=parrot \
--network host \
-v parrot_db:/var/lib/postgresql/data \
postgres
# start redis
docker run \
--name redis \
-d \
--rm \
--network host \
redis
```

1. Setting required environment variables
```shell
export PARROT_DB_HOST=127.0.0.1
export PARROT_SECRET_KEY=NO_SECRET
export PARROT_CELERY_BROKER_URL=redis://127.0.0.1
```
_Alternatively, you can create a local `.env` file with the variables_

1. Build static
```shell
poetry run python manage.py collectstatic --no-input
```

1. Apply database migrations
```shell
poetry run python manage.py migrate
```

1. Create a django superuser
```shell
poetry run python manage.py createsuperuser
```

1. Start the django app
```shell
poetry run python manage.py runserver
```

1. Start the celery worker
_Run in a separate terminal window_
```shell
poetry run celery -A parrot worker -l INFO -c 4
```
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@
* make
([https://www.gnu.org/software/make/](https://www.gnu.org/software/make/))
_(all commands can be viewed by calling `make` without parameters)_
* poetry _(for development)_
([https://python-poetry.org/](https://python-poetry.org/))
5 changes: 0 additions & 5 deletions docs/src/quick_start.md

This file was deleted.

Loading

0 comments on commit 293a40a

Please sign in to comment.