Browse Source

Merge branch 'master' of https://github.com/lanpin/abp

pull/955/head
Lanpin 7 years ago
parent
commit
5b6faaec17
  1. 85
      docs/en/Contribution/Index.md
  2. 15
      templates/service/database/Dockerfile
  3. 12
      templates/service/database/entrypoint.sh
  4. 9
      templates/service/docker-compose.migrations.yml

85
docs/en/Contribution/Index.md

@ -1,79 +1,52 @@
**DRAFT**: This doc has been created as a draft.
See https://help.github.com/en/articles/setting-guidelines-for-repository-contributors
## Contribution Guide
# Contributing to ASP.NET Boilerplate
ABP is an [open source](https://github.com/abpframework) and community driven project. This guide is aims to help anyone wants to contribute to the project.
ASP.NET Boilerplate is an [open source](https://github.com/aspnetboilerplate/aspnetboilerplate) and community driven project. This guide is aims to help anyone wants to contribute to the project.
### Code Contribution
## Code Contribution
You can always send pull requests to the Github repository.
You can always send pull requests to the GitHub repository.
- Clone the [ASP.NET Boilerplate repository](https://github.com/aspnetboilerplate/aspnetboilerplate/) from GitHub.
- Clone the [ABP repository](https://github.com/abpframework/abp/) from Github.
- Make the required changes.
- Send a pull request.
Before making any change, please discuss it on the [GitHub issues page](https://github.com/aspnetboilerplate/aspnetboilerplate/issues). So that, other developers will not work on the same issue and your PR will have a better chance to be accepted.
### Bug Fixes & Enhancements
You may want to fix a known bug or work on a planned enhancement. See [the issue list](https://github.com/aspnetboilerplate/aspnetboilerplate/issues) on GitHub.
### Feature Requests
If you have a feature idea for the framework or modules, [create an issue](https://github.com/aspnetboilerplate/aspnetboilerplate/issues/new) on GitHub or attend to an existing discussion. Then you can implement it if it's embraced by the community.
## Document Contribution
You may want to improve the [documentation](https://aspnetboilerplate.com/Pages/Documents). If so, follow these steps:
* Clone the [ABP repository](https://github.com/aspnetboilerplate/aspnetboilerplate/) from GitHub.
* Documents are located in [/aspnetboilerplate/doc](https://github.com/aspnetboilerplate/aspnetboilerplate/tree/master/doc/WebSite) folder.
* Modify the documents and send pull request
* If you would like to add a new document, you need to add it to the navigation document as well. Navigation document is located in [doc/WebSite/Navigation.md](https://github.com/aspnetboilerplate/aspnetboilerplate/blob/master/doc/WebSite/Navigation.md).
## Resource Localization
ASP.NET Boilerplate framework has a [localization system](https://aspnetboilerplate.com/Pages/Documents/Localization). Localization resources are located in [Abp\Localization\Sources\AbpXmlSource](https://github.com/aspnetboilerplate/aspnetboilerplate/tree/dev/src/Abp/Localization/Sources/AbpXmlSource).
You can add a new translation or update existing ones.
To add missing translation, see [this example pull request](https://github.com/aspnetboilerplate/aspnetboilerplate/pull/2471)
## Writing a New Module
The framework has pre-build modules, you can also add a new module. [Abp.Dapper](https://github.com/aspnetboilerplate/aspnetboilerplate/tree/dev/src/Abp.Dapper) is a contributed module. You can check Abp.Dapper module to make your own.
Before making any change, please discuss it on the [Github issues](https://github.com/abpframework/abp/issues). In this way, no other developer will work on the same issue and your PR will have a better chance to be accepted.
TODO: May be added step by step module development guide.
#### Bug Fixes & Enhancements
## Blog Posts & Tutorials
You may want to fix a known bug or work on a planned enhancement. See [the issue list](https://github.com/abpframework/abp/issues) on Github.
If you would like to write tutorials or blog posts for ASP.NET Boilerplate, please let us know (by creating a GitHub issue](https://github.com/aspnetboilerplate/aspnetboilerplate/issues), so we may add a link to your tutorial/post in the official documentation and we announce it on the official [Twitter account](https://twitter.com/aspboilerplate).
#### Feature Requests
## Bug Report
If you have a feature idea for the framework or modules, [create an issue](https://github.com/abpframework/abp/issues/new) on Github or attend to an existing discussion. Then you can implement it if it's embraced by the community.
If you would like to report a bug, please [create an issue on the GitHub repository](https://github.com/aspnetboilerplate/aspnetboilerplate/issues/new)
### Document Translation
You need to fill out the issue template before posting a bug.
You may want to translate the complete [documentation](https://abp.io/documents/) (including this one) to your mother language. If so, follow these steps:
```markdown
### GitHub Issues
* Clone the [ABP repository](https://github.com/abpframework/abp/) from Github.
* To add a new language, create a new folder inside the [docs](https://github.com/abpframework/abp/tree/master/docs) folder. Folder names can be "en", "es", "fr", "tr" and so on based on the language (see [all culture codes](https://msdn.microsoft.com/en-us/library/hh441729.aspx)).
* Get the ["en" folder](https://github.com/abpframework/abp/tree/master/docs/en) as a reference for the file names and folder structure. Keep the same naming if you are translating the same documentation.
* Send a pull request (PR) once you translate any document. Please translate documents & send PRs one by one. Don't wait to finish translations for all documents.
GitHub issues are for bug reports, feature requests and other discussions about the framework.
### Resource Localization
If you're creating a bug/problem report, please include followings:
ABP framework has a flexible [localization system](https://abp.io/documents/abp/latest/Localization). You can create localized user interfaces for your own application.
* Your Abp package version.
* Your base framework: .Net Framework or .Net Core.
* Exception message and stack trace if available.
* Steps needed to reproduce the problem.
In addition to that, the framework and pre-build modules have already localized texts. As an example, see [the localization texts for the Volo.Abp.UI package](https://github.com/abpframework/abp/blob/master/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/en.json). You can create a new file in the [same folder](https://github.com/abpframework/abp/tree/master/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi) to translate it.
Please write in English.
* Clone the [ABP repository](https://github.com/abpframework/abp/) from Github.
* Create a new file for the target language for a localization text (json) file (near to the en.json file).
* Copy all texts from the en.json file.
* Translate the texts.
* Send pull request on Github.
### Stack Overflow
ABP is a modular framework. So there are many localization text resource, one per module. To find all .json files, you can search for "en.json" after cloning the repository. You can also check [this list](Localization-Text-Files.md) for a list of localization text files.
Please use Stack Overflow for your questions about using the framework, templates and samples:
### Blog Posts & Tutorials
https://stackoverflow.com/questions/tagged/aspnetboilerplate
If you decide to create some tutorials or blog posts on ABP, please inform us (by creating a [Github issue](https://github.com/abpframework/abp/issues)), so we may add a link to your tutorial/post in the official documentation and we can announce it on our [Twitter account](https://twitter.com/abpframework).
Use aspnetboilerplate tag in your questions.
### Bug Report
```
If you find any bug, please [create an issue on the Github repository](https://github.com/abpframework/abp/issues/new).

15
templates/service/database/Dockerfile

@ -1,19 +1,18 @@
FROM microsoft/dotnet:2.2-sdk-alpine AS build
RUN apk add --no-cache bash
COPY . .
WORKDIR /templates/service/host/IdentityServerHost
RUN dotnet restore -nowarn:msb3202,nu1503
RUN dotnet build --no-restore -c Release
RUN dotnet restore
RUN dotnet ef migrations script -i -o migrations-IdentityServerHost.sql
WORKDIR /templates/service/host/MyCompanyName.MyProjectName.Host
RUN dotnet restore -nowarn:msb3202,nu1503
RUN dotnet build --no-restore -c Release
RUN dotnet restore
RUN dotnet ef migrations script -i -o migrations-MyProjectName.sql
FROM build AS final
FROM mcr.microsoft.com/mssql-tools AS final
WORKDIR /src
COPY --from=build /templates/service/host/IdentityServerHost ./IdentityServerHost
COPY --from=build /templates/service/host/MyCompanyName.MyProjectName.Host ./MyCompanyName.MyProjectName.Host
COPY --from=build /templates/service/host/IdentityServerHost/migrations-IdentityServerHost.sql migrations-IdentityServerHost.sql
COPY --from=build /templates/service/host/MyCompanyName.MyProjectName.Host/migrations-MyProjectName.sql migrations-MyProjectName.sql
COPY --from=build /templates/service/database/entrypoint.sh .
RUN /bin/bash -c "sed -i $'s/\r$//' entrypoint.sh"
RUN chmod +x ./entrypoint.sh

12
templates/service/database/entrypoint.sh

@ -1,12 +1,12 @@
#!/bin/bash
cd IdentityServerHost
export ConnectionStrings__Default=$IdentityServerConnectionString
until dotnet ef database update --no-build; do
until /opt/mssql-tools/bin/sqlcmd -S sqlserver -U SA -P $SA_PASSWORD -Q 'SELECT name FROM master.sys.databases'; do
>&2 echo "SQL Server is starting up"
sleep 1
done
export ConnectionStrings__Default=$MyProjectNameConnectionString
cd MyCompanyName.MyProjectName.Host && dotnet ef database update --no-build
/opt/mssql-tools/bin/sqlcmd -S sqlserver -U SA -P $SA_PASSWORD -Q "CREATE DATABASE [$IdentityServer_DB]"
/opt/mssql-tools/bin/sqlcmd -S sqlserver -U SA -P $SA_PASSWORD -Q "CREATE DATABASE [$MyProjectName_DB]"
/opt/mssql-tools/bin/sqlcmd -d $IdentityServer_DB -S sqlserver -U sa -P $SA_PASSWORD -i migrations-IdentityServerHost.sql
/opt/mssql-tools/bin/sqlcmd -d $MyProjectName_DB -S sqlserver -U sa -P $SA_PASSWORD -i migrations-MyProjectName.sql

9
templates/service/docker-compose.migrations.yml

@ -1,12 +1,13 @@
version: '3.4'
services:
services:
migrations:
build:
context: ../../
dockerfile: templates/service/database/Dockerfile
dockerfile: templates/service/database/Dockerfile
depends_on:
- sqlserver
environment:
- IdentityServerConnectionString=Server=sqlserver;Database=MyProjectName_Identity;Trusted_Connection=True;MultipleActiveResultSets=true;User=sa;Password=yourStrong(!)Password;Integrated Security=false
- MyProjectNameConnectionString=Server=sqlserver;Database=MyProjectName_ModuleDb;Trusted_Connection=True;MultipleActiveResultSets=true;User=sa;Password=yourStrong(!)Password;Integrated Security=false
- IdentityServer_DB=MyProjectName_Identity
- MyProjectName_DB=MyProjectName_ModuleDb
- SA_PASSWORD=yourStrong(!)Password

Loading…
Cancel
Save