From 61b9a61e2645d422ab717dfcc587101dc0e8c5ec Mon Sep 17 00:00:00 2001 From: maliming Date: Wed, 3 Apr 2019 11:11:21 +0800 Subject: [PATCH 1/4] Added bug report template. --- docs/zh-Hans/Contribution/Index.md | 89 +++++++++++++++++++----------- 1 file changed, 58 insertions(+), 31 deletions(-) diff --git a/docs/zh-Hans/Contribution/Index.md b/docs/zh-Hans/Contribution/Index.md index b6b9839262..745a86f968 100644 --- a/docs/zh-Hans/Contribution/Index.md +++ b/docs/zh-Hans/Contribution/Index.md @@ -1,52 +1,79 @@ -## 贡献指南 +**草案**: 该文档已作为草稿创建. +请参见 https://help.github.com/en/articles/setting-guidelines-for-repository-contributors -ABP是[开源](https://github.com/abpframework)和社区驱动项目. 本指南旨在帮助任何想要为项目做出贡献的人. +# 贡献于ASP.NET Boilerplate -### 贡献代码 +ASP.NET Boilerplate是一个[开源](https://github.com/aspnetboilerplate/aspnetboilerplate)和社区驱动的项目. 本指南旨在帮助任何人想要为项目做出贡献. -你可以将Pull request(拉取请求)发送到Github存储库. +## 代码贡献 -- 从Github克隆[ABP存储库](https://github.com/abpframework/abp/). -- 进行必要的更改. -- 发送Pull request(拉取请求). +你始终可以将PR(Pull Request)发送到GitHub存储库. -在进行任何更改之前,请在[Github问题](https://github.com/abpframework/abp/issues)上进行讨论. 通过这种方式, 其他开发人员将不会处理同一个问题, 你的PR将有更好的机会被接受. + - 从GitHub克隆[ASP.NET Boilerplate存储库](https://github.com/aspnetboilerplate/aspnetboilerplate/). + - 进行必要的更改. + - 发送PR(Pull Request). -#### Bug修复 & 增强功能 +在进行任何更改之前,请在[GitHub Issue页面]((ttps://github.com/aspnetboilerplate/aspnetboilerplate/issues)上进行讨论. 因此,其他开发人员不会处理相同的问题, 你的PR将有更好的机会被接受. -你可能希望修复已知Bug或处理计划的增强功能. 请参阅Github上的[问题列表](https://github.com/abpframework/abp/issues). +### 修复BUG和增强功能 -#### 功能请求 +你可能想要修复已知BUG或处理计划的增强功能. 请参阅GitHub上的[Issue列表](https://github.com/aspnetboilerplate/aspnetboilerplate/issues) -如果你对框架或模块有功能的想法, 请在Github上[创建一个问题](https://github.com/abpframework/abp/issues/new)或参加现有的讨论. 如果它被社区所接受你就可以实现它. +### 功能请求 -### 文件翻译 +如果你有一个关于框架或模块的功能想法,在GitHub上创建一个Issue(https://github.com/aspnetboilerplate/aspnetboilerplate/issues/new)或参加现有的讨论. 然后,如果它被社区所接受,你就可以实施它. -你可能希望将完整的[文档](https://abp.io/documents/)(包括本文)翻译成你的母语. 请按照下列步骤操作: +## 文档贡献 -* 从Github克隆[ABP存储库](https://github.com/abpframework/abp/). -* 要添加新语言,请在[docs](https://github.com/abpframework/abp/tree/master/docs)文件夹中创建一个新文件夹. 文件夹名称可以是" en","es","fr","tr"等(参见[所有文化代码](https://msdn.microsoft.com/en-us/library/hh441729.aspx)). -* 获取["en"文件夹](https://github.com/abpframework/abp/tree/master/docs/en)作为文件名和文件夹结构的参考. 如果要翻译相同的文档, 请保持相同的命名. -* 翻译任何文档后发送拉取请求(PR). 请翻译文件后及时发送PR. 不要等到完成所有文件的翻译. +你可能希望改进[文档](https://aspnetboilerplate.com/Pages/Documents). 如果是,请按照下列步骤操作: -### 资源本地化 +* 从GitHub克隆[ABP存储库](https://github.com/aspnetboilerplate/aspnetboilerplate/). +* 文档位于 [/aspnetboilerplate/doc](https://github.com/aspnetboilerplate/aspnetboilerplate/tree/master/doc/WebSite)文件夹中. +* 修改文件并发送PR(Pull Request). +* 如果要添加新文档,还需要将其添加到导航文档中. 导航文档位于[doc/WebSite/Navigation.md](https://github.com/aspnetboilerplate/aspnetboilerplate/blob/master/doc/WebSite/Navigation.md). -ABP框架具有灵活的[本地化系统](https://abp.io/documents/abp/latest/Localization). 你可以为自己的应用程序创建本地化用户界面. +## 资源本地化 -除此之外,框架和预构建模块已经本地化了文本.请参阅[Volo.Abp.UI包的本地化文本](https://github.com/abpframework/abp/blob/master/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/en.json).你可以在[相同文件夹](https://github.com/abpframework/abp/tree/master/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi)中创建一个新文件进行翻译. +ASP.NET Boilerplate框架有一个[本地化系统](https://aspnetboilerplate.com/Pages/Documents/Localization). 本地化资源位于[Abp\Localization\Sources\AbpXmlSource](https://github.com/aspnetboilerplate/aspnetboilerplate/tree/dev/src/Abp/Localization/Sources/AbpXmlSource). +你可以添加新翻译或更新现有翻译. +要添加缺少的翻译,请参阅[此示例请求](https://github.com/aspnetboilerplate/aspnetboilerplate/pull/2471) -* 从Github克隆[ABP存储库](https://github.com/abpframework/abp/). -* 为本地化文本(json)文件(en.json文件同目录下)创建目标语言的新文件. -* 复制en.json文件中的所有文本. -* 翻译文本. -* 在Github上发送拉取请求(Pull request). +## 编写新模块 -ABP是一个模块化框架. 所以有很多本地化文本资源, 每个模块都有一个. 要查找所有.json文件,可以在克隆存储库后搜索"en.json". 你还可以检查[此列表](Localization-Text-Files.md)以获取本地化文本文件列表. +该框架具有预构建模块, 你还可以添加新模块. [Abp.Dapper](https://github.com/aspnetboilerplate/aspnetboilerplate/tree/dev/src/Abp.Dapper)是一个贡献模块. 你可以检查Abp.Dapper模块来制作你自己的模块. -### 博客文章和教程 +TODO:可以逐步添加模块开发指南. -如果你发布了一些ABP框架的教程或博客帖子, 请通知我们(通过创建[Github问题](https://github.com/abpframework/abp/issues)), 我们可能会在官方文档中添加指向你的教程或博客帖子的链接和在[推特](https://twitter.com/abpframework)上公布. +## 博客文章和教程 -### Bug 报告 +如果你想为ASP.NET Boilerplate编写教程或博客文章,请告诉我们(通过创建GitHub Issue)(https://github.com/aspnetboilerplate/aspnetboilerplate/issues), 以便我们添加链接到你的教程/帖子在官方文档中,我们在官方[Twitter帐户](https://twitter.com/aspboilerplate). -如果你发现任何Bug, 请[在Github存储库上创建一个问题](https://github.com/abpframework/abp/issues/new). \ No newline at end of file +## 报告BUG + +如果您想报告BUG, 请[在GitHub存储库上创建一个Issue](https://github.com/aspnetboilerplate/aspnetboilerplate/issues/new) + +你需要在发布BUG之前填写问题模板. + +```markdown +### GitHub Issues + +GitHub issues are for bug reports, feature requests and other discussions about the framework. + +If you're creating a bug/problem report, please include followings: + +* 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. + +Please write in English. + +### Stack Overflow + +Please use Stack Overflow for your questions about using the framework, templates and samples: + +https://stackoverflow.com/questions/tagged/aspnetboilerplate + +Use aspnetboilerplate tag in your questions. + +``` From ec6379c68982544b57fc33b3a3d58da1dd934b5e Mon Sep 17 00:00:00 2001 From: maliming Date: Wed, 3 Apr 2019 11:11:21 +0800 Subject: [PATCH 2/4] Revert "Added bug report template." This reverts commit 61b9a61e2645d422ab717dfcc587101dc0e8c5ec. --- docs/zh-Hans/Contribution/Index.md | 89 +++++++++++------------------- 1 file changed, 31 insertions(+), 58 deletions(-) diff --git a/docs/zh-Hans/Contribution/Index.md b/docs/zh-Hans/Contribution/Index.md index 745a86f968..b6b9839262 100644 --- a/docs/zh-Hans/Contribution/Index.md +++ b/docs/zh-Hans/Contribution/Index.md @@ -1,79 +1,52 @@ -**草案**: 该文档已作为草稿创建. -请参见 https://help.github.com/en/articles/setting-guidelines-for-repository-contributors +## 贡献指南 -# 贡献于ASP.NET Boilerplate +ABP是[开源](https://github.com/abpframework)和社区驱动项目. 本指南旨在帮助任何想要为项目做出贡献的人. -ASP.NET Boilerplate是一个[开源](https://github.com/aspnetboilerplate/aspnetboilerplate)和社区驱动的项目. 本指南旨在帮助任何人想要为项目做出贡献. +### 贡献代码 -## 代码贡献 +你可以将Pull request(拉取请求)发送到Github存储库. -你始终可以将PR(Pull Request)发送到GitHub存储库. +- 从Github克隆[ABP存储库](https://github.com/abpframework/abp/). +- 进行必要的更改. +- 发送Pull request(拉取请求). - - 从GitHub克隆[ASP.NET Boilerplate存储库](https://github.com/aspnetboilerplate/aspnetboilerplate/). - - 进行必要的更改. - - 发送PR(Pull Request). +在进行任何更改之前,请在[Github问题](https://github.com/abpframework/abp/issues)上进行讨论. 通过这种方式, 其他开发人员将不会处理同一个问题, 你的PR将有更好的机会被接受. -在进行任何更改之前,请在[GitHub Issue页面]((ttps://github.com/aspnetboilerplate/aspnetboilerplate/issues)上进行讨论. 因此,其他开发人员不会处理相同的问题, 你的PR将有更好的机会被接受. +#### Bug修复 & 增强功能 -### 修复BUG和增强功能 +你可能希望修复已知Bug或处理计划的增强功能. 请参阅Github上的[问题列表](https://github.com/abpframework/abp/issues). -你可能想要修复已知BUG或处理计划的增强功能. 请参阅GitHub上的[Issue列表](https://github.com/aspnetboilerplate/aspnetboilerplate/issues) +#### 功能请求 -### 功能请求 +如果你对框架或模块有功能的想法, 请在Github上[创建一个问题](https://github.com/abpframework/abp/issues/new)或参加现有的讨论. 如果它被社区所接受你就可以实现它. -如果你有一个关于框架或模块的功能想法,在GitHub上创建一个Issue(https://github.com/aspnetboilerplate/aspnetboilerplate/issues/new)或参加现有的讨论. 然后,如果它被社区所接受,你就可以实施它. +### 文件翻译 -## 文档贡献 +你可能希望将完整的[文档](https://abp.io/documents/)(包括本文)翻译成你的母语. 请按照下列步骤操作: -你可能希望改进[文档](https://aspnetboilerplate.com/Pages/Documents). 如果是,请按照下列步骤操作: +* 从Github克隆[ABP存储库](https://github.com/abpframework/abp/). +* 要添加新语言,请在[docs](https://github.com/abpframework/abp/tree/master/docs)文件夹中创建一个新文件夹. 文件夹名称可以是" en","es","fr","tr"等(参见[所有文化代码](https://msdn.microsoft.com/en-us/library/hh441729.aspx)). +* 获取["en"文件夹](https://github.com/abpframework/abp/tree/master/docs/en)作为文件名和文件夹结构的参考. 如果要翻译相同的文档, 请保持相同的命名. +* 翻译任何文档后发送拉取请求(PR). 请翻译文件后及时发送PR. 不要等到完成所有文件的翻译. -* 从GitHub克隆[ABP存储库](https://github.com/aspnetboilerplate/aspnetboilerplate/). -* 文档位于 [/aspnetboilerplate/doc](https://github.com/aspnetboilerplate/aspnetboilerplate/tree/master/doc/WebSite)文件夹中. -* 修改文件并发送PR(Pull Request). -* 如果要添加新文档,还需要将其添加到导航文档中. 导航文档位于[doc/WebSite/Navigation.md](https://github.com/aspnetboilerplate/aspnetboilerplate/blob/master/doc/WebSite/Navigation.md). +### 资源本地化 -## 资源本地化 +ABP框架具有灵活的[本地化系统](https://abp.io/documents/abp/latest/Localization). 你可以为自己的应用程序创建本地化用户界面. -ASP.NET Boilerplate框架有一个[本地化系统](https://aspnetboilerplate.com/Pages/Documents/Localization). 本地化资源位于[Abp\Localization\Sources\AbpXmlSource](https://github.com/aspnetboilerplate/aspnetboilerplate/tree/dev/src/Abp/Localization/Sources/AbpXmlSource). -你可以添加新翻译或更新现有翻译. -要添加缺少的翻译,请参阅[此示例请求](https://github.com/aspnetboilerplate/aspnetboilerplate/pull/2471) +除此之外,框架和预构建模块已经本地化了文本.请参阅[Volo.Abp.UI包的本地化文本](https://github.com/abpframework/abp/blob/master/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/en.json).你可以在[相同文件夹](https://github.com/abpframework/abp/tree/master/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi)中创建一个新文件进行翻译. -## 编写新模块 +* 从Github克隆[ABP存储库](https://github.com/abpframework/abp/). +* 为本地化文本(json)文件(en.json文件同目录下)创建目标语言的新文件. +* 复制en.json文件中的所有文本. +* 翻译文本. +* 在Github上发送拉取请求(Pull request). -该框架具有预构建模块, 你还可以添加新模块. [Abp.Dapper](https://github.com/aspnetboilerplate/aspnetboilerplate/tree/dev/src/Abp.Dapper)是一个贡献模块. 你可以检查Abp.Dapper模块来制作你自己的模块. +ABP是一个模块化框架. 所以有很多本地化文本资源, 每个模块都有一个. 要查找所有.json文件,可以在克隆存储库后搜索"en.json". 你还可以检查[此列表](Localization-Text-Files.md)以获取本地化文本文件列表. -TODO:可以逐步添加模块开发指南. +### 博客文章和教程 -## 博客文章和教程 +如果你发布了一些ABP框架的教程或博客帖子, 请通知我们(通过创建[Github问题](https://github.com/abpframework/abp/issues)), 我们可能会在官方文档中添加指向你的教程或博客帖子的链接和在[推特](https://twitter.com/abpframework)上公布. -如果你想为ASP.NET Boilerplate编写教程或博客文章,请告诉我们(通过创建GitHub Issue)(https://github.com/aspnetboilerplate/aspnetboilerplate/issues), 以便我们添加链接到你的教程/帖子在官方文档中,我们在官方[Twitter帐户](https://twitter.com/aspboilerplate). +### Bug 报告 -## 报告BUG - -如果您想报告BUG, 请[在GitHub存储库上创建一个Issue](https://github.com/aspnetboilerplate/aspnetboilerplate/issues/new) - -你需要在发布BUG之前填写问题模板. - -```markdown -### GitHub Issues - -GitHub issues are for bug reports, feature requests and other discussions about the framework. - -If you're creating a bug/problem report, please include followings: - -* 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. - -Please write in English. - -### Stack Overflow - -Please use Stack Overflow for your questions about using the framework, templates and samples: - -https://stackoverflow.com/questions/tagged/aspnetboilerplate - -Use aspnetboilerplate tag in your questions. - -``` +如果你发现任何Bug, 请[在Github存储库上创建一个问题](https://github.com/abpframework/abp/issues/new). \ No newline at end of file From e338db033dafaaafec7717c8790b85e3ebde1c5a Mon Sep 17 00:00:00 2001 From: Alper Ebicoglu Date: Wed, 3 Apr 2019 11:54:23 +0300 Subject: [PATCH 3/4] reverted back --- docs/en/Contribution/Index.md | 85 ++++++++++++----------------------- 1 file changed, 29 insertions(+), 56 deletions(-) diff --git a/docs/en/Contribution/Index.md b/docs/en/Contribution/Index.md index 816f1b045a..74174c97d1 100644 --- a/docs/en/Contribution/Index.md +++ b/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). From b2058277f978976414674b1bc09a5fee1caa569e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Atakan=20=C3=96zceviz?= Date: Wed, 3 Apr 2019 13:16:37 +0200 Subject: [PATCH 4/4] Migration method changed to reduce the size of the image --- templates/service/database/Dockerfile | 15 +++++++-------- templates/service/database/entrypoint.sh | 12 ++++++------ templates/service/docker-compose.migrations.yml | 9 +++++---- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/templates/service/database/Dockerfile b/templates/service/database/Dockerfile index 74bbe2c820..c5e3bcb0c1 100644 --- a/templates/service/database/Dockerfile +++ b/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 diff --git a/templates/service/database/entrypoint.sh b/templates/service/database/entrypoint.sh index 80f1b43dbc..353c7e1dc0 100644 --- a/templates/service/database/entrypoint.sh +++ b/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 \ No newline at end of file +/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 \ No newline at end of file diff --git a/templates/service/docker-compose.migrations.yml b/templates/service/docker-compose.migrations.yml index 33d32f8faf..e2937e32c6 100644 --- a/templates/service/docker-compose.migrations.yml +++ b/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