-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
♻️ 🐳 improve init execution on entrypoint
- Loading branch information
1 parent
7ae6f3c
commit b2a39f8
Showing
4 changed files
with
37 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -95,6 +95,25 @@ minitwit-minitwit-runtime-1 | Press CTRL+C to quit | |
|
||
3. Go to the browser at http://127.0.0.1:5000. | ||
|
||
> **NOTE**: When operating this server, the database file is created under the local dir `db/minitwit.db` as mapped in | ||
> docker-compose.yaml. Make sure to change the path to anything else desired. | ||
```console | ||
☁️ [email protected] | ||
☸️ [email protected] 📛 [email protected] 🎡 [email protected] 🐳 [email protected] 🐙 [email protected] | ||
👮 marcellodesales | ||
🏗 1.24.3+k3s1 🔐 rancher-desktop 🍱 default | ||
~/dev/github.com/marcellodesales/minitwit on feature/improve-experience-with-docker! 📅 03-07-2023 ⌚18:07:30 | ||
$ tree db | ||
db | ||
└── minitwit.db | ||
|
||
0 directories, 1 file | ||
|
||
$ file db/minitwit.db | ||
db/minitwit.db: SQLite 3.x database, last written using SQLite version 3040001, file counter 5, database pages 5, cookie 0x3, schema 4, UTF-8, version-valid-for 5 | ||
``` | ||
|
||
# Development | ||
|
||
> **Requirements**: Install `requirements-dev.txt` for build and testing tools. | ||
|
@@ -103,23 +122,10 @@ minitwit-minitwit-runtime-1 | Press CTRL+C to quit | |
|
||
You betcha. Run the `test_minitwit.py` file to see the tests pass. | ||
|
||
1. Initialize the database for testing | ||
2. Install the dev dependencies | ||
3. Execute the test cases | ||
1. Install the dev dependencies | ||
|
||
> **NOTE**: the runtime dependencies must have been installed as well. | ||
1. Initialize the dabase for testing | ||
* Just initialize the database with `init-db` | ||
|
||
```console | ||
$ ./init-db | ||
[2023-03-08 00:25:47,358] INFO in minitwit: Using local db sqlite:////var/minitwit/minitwit.db | ||
Initialized the database. | ||
``` | ||
|
||
2. Install the dev dependencies | ||
|
||
``` | ||
$ pip install -r requirements-dev.txt | ||
Collecting pytest==5.3.2 | ||
|
@@ -148,7 +154,7 @@ WARNING: You are using pip version 22.0.4; however, version 23.0.1 is available. | |
You should consider upgrading via the '/usr/local/bin/python -m pip install --upgrade pip' command. | ||
``` | ||
|
||
3. Execute the test cases | ||
2. Execute the test cases | ||
|
||
```console | ||
pytest test_minitwit.py | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters