Skip to content

Commit 1811276

Browse files
committed
Docs: move contributor-related info to the contributor guide
1 parent 3ddaa63 commit 1811276

6 files changed

Lines changed: 82 additions & 79 deletions

File tree

.idea/.idea.Emulsion/.idea/dictionaries/fried.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
44
and this project adheres to [Semantic
55
Versioning v2.0.0](https://semver.org/spec/v2.0.0.html).
66

7-
When considering the public API, we take into account the tool configuration and external requirements of the framework-dependent binary. Meaning that basically, breaking changes in configurations or in the runtime requirements should be causing a major version increment.
7+
When considering the public API, we take into account the tool configuration and external requirements of the framework-dependent binary. Meaning that basically, breaking changes in configuration files, command-line syntax, or in the runtime requirements should be causing a major version increment.
88

99
## [Unreleased] (3.0.0)
1010
### Changed

CONTRIBUTING.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
Contributor Guide
2+
=================
3+
4+
Prerequisites
5+
-------------
6+
To develop Emulsion, make sure you've installed the following tools:
7+
- [.NET SDK][dotnet] 8.0 or later,
8+
- [Node.js][node.js] 18:
9+
- if you use [nvm][] or [nvm-windows][], then run `nvm use 18`.
10+
11+
Build
12+
-----
13+
Build the project using the following shell command:
14+
15+
```console
16+
$ dotnet build
17+
```
18+
19+
Run
20+
---
21+
Run the application from sources using the following shell command:
22+
23+
```console
24+
$ dotnet run --project ./Emulsion [optional-path-to-json-config-file]
25+
```
26+
27+
Test
28+
----
29+
Execute the tests using the following shell command:
30+
31+
```console
32+
$ dotnet test
33+
```
34+
35+
Docker Publish
36+
--------------
37+
To build and push the container to Docker Hub, use the following shell commands:
38+
39+
```console
40+
$ docker build -t codingteam/emulsion:$EMULSION_VERSION \
41+
-t codingteam/emulsion:latest .
42+
43+
$ docker login # if necessary
44+
$ docker push codingteam/emulsion:$EMULSION_VERSION
45+
$ docker push codingteam/emulsion:latest
46+
```
47+
48+
where `$EMULSION_VERSION` is the version of the image to publish.
49+
50+
Updating the Database Structure
51+
-------------------------------
52+
If you want to update a database structure, you'll need to create a migration.
53+
54+
This article explains how to create a database migration using [EFCore.FSharp][efcore.fsharp].
55+
56+
1. Change the entity type (see `Emulsion.Database/Entities.fs`), update the `EmulsionDbContext` if required.
57+
2. Run the following shell commands:
58+
59+
```console
60+
$ dotnet tool restore
61+
$ cd Emulsion.Database
62+
$ dotnet ef migrations add <migration-name>
63+
```
64+
65+
[dotnet]: https://dot.net/
66+
[efcore.fsharp]: https://github.com/efcore/EFCore.FSharp
67+
[node.js]: https://nodejs.org/
68+
[nvm]: https://github.com/nvm-sh/nvm
69+
[nvm-windows]

Emulsion.sln

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
1616
Dockerfile = Dockerfile
1717
MAINTAINERSHIP.md = MAINTAINERSHIP.md
1818
Directory.Build.props = Directory.Build.props
19+
CONTRIBUTING.md = CONTRIBUTING.md
1920
EndProjectSection
2021
EndProject
2122
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Emulsion.Tests", "Emulsion.Tests\Emulsion.Tests.fsproj", "{1B3B65DD-FD58-45FA-B6FF-8532B513A7D9}"
@@ -36,11 +37,6 @@ ProjectSection(SolutionItems) = preProject
3637
.config\dotnet-tools.json = .config\dotnet-tools.json
3738
EndProjectSection
3839
EndProject
39-
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{12336258-82C7-4C09-A73F-8D0B146578B2}"
40-
ProjectSection(SolutionItems) = preProject
41-
docs\create-migration.md = docs\create-migration.md
42-
EndProjectSection
43-
EndProject
4440
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Emulsion.ContentProxy", "Emulsion.ContentProxy\Emulsion.ContentProxy.fsproj", "{A520FD41-A1CB-4062-AFBC-62A8BED12E81}"
4541
EndProject
4642
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Emulsion.Web", "Emulsion.Web\Emulsion.Web.fsproj", "{8EFD8F6C-43D3-4CE0-ADB8-63401E4A64FE}"

README.md

Lines changed: 10 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,18 @@ Installation
88
There are two supported Emulsion distributions: as a framework-dependent .NET application, or as a Docker image.
99

1010
### .NET Application
11-
To run Emulsion as [a framework-dependent .NET application][docs.dotnet.framework-dependent], you'll need to [install .NET runtime][dotnet.install] version 8.0 or later.
11+
To run Emulsion as [a framework-dependent .NET application][docs.dotnet.framework-dependent], you'll need to [install .NET runtime][dotnet] version 8.0 or later.
1212

1313
Then, download the required version in the [Releases][releases] section.
1414

15-
After that, configure the application, and start it using the following shell command:
15+
After that, configure the application (see the following section), and start it using the following shell command:
1616

1717
```console
18-
$ dotnet Emulsion.dll
18+
$ dotnet Emulsion.dll [optional-path-to-json-config-file]
1919
```
2020

21+
If `optional-path-to-json-config-file` is not provided, Emulsion will use the `emulsion.json` file from the current directory.
22+
2123
### Docker
2224
It is recommended to use Docker to deploy this application. To install the application from Docker, you may use the following Bash script:
2325

@@ -47,18 +49,8 @@ where
4749
- `$DATA` is the absolute path to the data directory (used by the configuration)
4850
- `$WEB_PORT` is the port on the host system which will be used to access the content proxy
4951

50-
Build
51-
-----
52-
53-
Install [.NET SDK][dotnet] 8.0 and Node.js 18 or newer for your platform, then run:
54-
55-
```console
56-
$ dotnet build
57-
```
58-
59-
Configure
60-
---------
61-
52+
Configuration
53+
-------------
6254
Copy `emulsion.example.json` to `emulsion.json` and set the settings. For some settings, there are defaults:
6355

6456
```json
@@ -130,62 +122,22 @@ Current configuration system allows the following:
130122
2. When receiving a piece of Telegram content (a file, a photo, an audio message), the bot will send a link to `https://example.com/telegram/content/<some_id>` to the XMPP chat.
131123
3. When anyone visits the link, the reverse proxy will send a request to `http://localhost/content/<some_id>`, which will take a corresponding content from the database.
132124

133-
Test
134-
----
135-
136-
To execute the tests:
137-
138-
```console
139-
$ dotnet test
140-
```
141-
142-
Run
143-
---
144-
145-
Requires [.NET Runtime][dotnet] version 8.0 or newer.
146-
147-
```console
148-
$ dotnet run --project ./Emulsion [optional-path-to-json-config-file]
149-
```
150-
151-
Docker Publish
152-
--------------
153-
To build and push the container to Docker Hub, use the following commands:
154-
155-
```console
156-
$ docker build -t codingteam/emulsion:$EMULSION_VERSION \
157-
-t codingteam/emulsion:latest .
158-
159-
$ docker login # if necessary
160-
$ docker push codingteam/emulsion:$EMULSION_VERSION
161-
$ docker push codingteam/emulsion:latest
162-
```
163-
164-
where `$EMULSION_VERSION` is the version of the image to publish.
165-
166125
Documentation
167126
-------------
168-
169-
Common documentation:
170-
171127
- [Changelog][docs.changelog]
128+
- [Contributor Guide][docs.contributing]
172129
- [License (MIT)][docs.license]
173-
174-
Developer documentation:
175-
176-
- [How to Create a Database Migration][docs.create-migration]
177130
- [Maintainership][docs.maintainership]
178131

179132
[andivionian-status-classifier]: https://github.com/ForNeVeR/andivionian-status-classifier#status-aquana-
180133
[badge.docker]: https://img.shields.io/docker/v/codingteam/emulsion?sort=semver
181134
[docker-hub]: https://hub.docker.com/r/codingteam/emulsion
182135
[docs.changelog]: ./CHANGELOG.md
183-
[docs.create-migration]: ./docs/create-migration.md
136+
[docs.contributing]: CONTRIBUTING.md
184137
[docs.dotnet.framework-dependent]: https://learn.microsoft.com/en-us/dotnet/core/deploying/#publish-framework-dependent
185138
[docs.license]: ./LICENSE.md
186139
[docs.maintainership]: MAINTAINERSHIP.md
187-
[dotnet.install]: https://dot.net
188-
[dotnet]: https://dotnet.microsoft.com/download
140+
[dotnet]: https://dot.net/
189141
[hashids.net]: https://github.com/ullmark/hashids.net
190142
[releases]: https://github.com/codingteam/emulsion/releases
191143
[status-aquana]: https://img.shields.io/badge/status-aquana-yellowgreen.svg

docs/create-migration.md

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)