-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Release v.0.2.2
- Loading branch information
Showing
42 changed files
with
148 additions
and
62 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
TEST_PROJ_NAME:MyProject | ||
|
||
TEMPL_DOTNET_NAME:asp-awesome-spa | ||
TEMPL_NAME:Asp.AwesomeTemplates.Spa | ||
NUGET_FILE:Asp.AwesomeTemplates.Spa.0.2.2.nupkg |
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 |
---|---|---|
|
@@ -6,3 +6,5 @@ MainTemplate/.vs | |
MainTemplate/nupkg | ||
Level X/.vs | ||
Level X/nupkg | ||
.env.prod | ||
Asp.AwesomeTemplates.Spa/nupkg |
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
21 changes: 21 additions & 0 deletions
21
Asp.AwesomeTemplates.Spa/Template/.template.config/dotnetcli.host.json
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"$schema": "http://json.schemastore.org/dotnetcli.host", | ||
"symbolInfo": { | ||
"EnableSwaggerSupport": { | ||
"longName": "swagger", | ||
"shortName": "sw" | ||
}, | ||
"UseEfDatabase": { | ||
"longName": "database", | ||
"shortName": "db" | ||
}, | ||
"UseSpaFrontendFramework": { | ||
"longName": "frontend", | ||
"shortName": "f" | ||
}, | ||
"AddExampleController": { | ||
"longName": "with-examples", | ||
"shortName": "e" | ||
} | ||
} | ||
} |
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
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...Template/Controllers/ExampleController.cs → ...OME_SPA_/Controllers/ExampleController.cs
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
2 changes: 1 addition & 1 deletion
2
...late/Data/Asp.AwesomeTemplateDbContext.cs → ...ESOME_SPA_/Data/_AWESOME_SPA_DbContext.cs
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
20 changes: 20 additions & 0 deletions
20
Asp.AwesomeTemplates.Spa/Template/_AWESOME_SPA_/Dockerfile
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
FROM mcr.microsoft.com/dotnet/aspnet:6.0-bullseye-slim AS base | ||
WORKDIR /app | ||
EXPOSE 80 | ||
EXPOSE 443 | ||
|
||
FROM mcr.microsoft.com/dotnet/sdk:6.0-bullseye-slim AS build | ||
WORKDIR /src | ||
COPY ["_AWESOME_SPA_.csproj", "_AWESOME_SPA_/"] | ||
RUN dotnet restore "_AWESOME_SPA_/_AWESOME_SPA_.csproj" | ||
COPY . ./_AWESOME_SPA_ | ||
WORKDIR "/src/_AWESOME_SPA_" | ||
RUN dotnet build "_AWESOME_SPA_.csproj" -c Release -o /app/build | ||
|
||
FROM build AS publish | ||
RUN dotnet publish "_AWESOME_SPA_.csproj" -c Release -o /app/publish | ||
|
||
FROM base AS final | ||
WORKDIR /app | ||
COPY --from=publish /app/publish . | ||
ENTRYPOINT ["dotnet", "_AWESOME_SPA_.dll"] |
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
24 changes: 15 additions & 9 deletions
24
Level X/Template/README.md → ...ates.Spa/Template/_AWESOME_SPA_/README.md
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 |
---|---|---|
@@ -1,39 +1,45 @@ | ||
# Asp.AwesomeTemplate Project | ||
# _AWESOME_SPA_ Project | ||
|
||
## Develop | ||
|
||
*** | ||
--- | ||
|
||
### First Run | ||
At first, you need to create TLS certificate. You can make it with this command: | ||
|
||
At first, you need to create TLS certificate. You can make it with this command: | ||
|
||
```sh | ||
dotnet dev-certs https -ep ${HOME}/.aspnet/https/Asp.AwesomeTemplate.pfx -p PASSWORD | ||
``` | ||
dotnet dev-certs https -ep ${HOME}/.aspnet/https/_AWESOME_SPA_.pfx -p PASSWORD | ||
``` | ||
|
||
> (You can change PASSWORD to your custom certificate password, but then you need also to change it in `docker-compose.yaml`. Because this certificate is development only, I think you can use default password) | ||
Then, trust the certificate: | ||
Then, trust the certificate: | ||
|
||
```sh | ||
dotnet dev-certs https --trust | ||
``` | ||
|
||
Congrats, you setuped your dev certificates | ||
|
||
*** | ||
--- | ||
|
||
### Run | ||
|
||
Now, you can simply run your app with one command in interactive mode: | ||
|
||
```sh | ||
docker compose up | ||
docker compose up | ||
``` | ||
|
||
<!--#if(EnableSwaggerSupport) --> | ||
|
||
Back-end Swagger docs: https://localhost:443/swagger | ||
|
||
<!--#endif --> | ||
|
||
<!--#if(UseReact) --> | ||
|
||
Front-end React-app: http://localhost:3000 | ||
<!--#endif --> | ||
|
||
<!--#endif --> |
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 |
---|---|---|
|
@@ -5,23 +5,21 @@ services: | |
ports: | ||
- "8000:80" | ||
- "443:443" | ||
container_name: "Asp.AwesomeTemplate" | ||
environment: | ||
- ASPNETCORE_ENVIRONMENT=Development | ||
- ASPNETCORE_URLS=https://+:443;http://+:80 | ||
# Development certificate for TLS | ||
- ASPNETCORE_Kestrel__Certificates__Default__Password=PASSWORD | ||
- ASPNETCORE_Kestrel__Certificates__Default__Path=/https/Asp.AwesomeTemplate.pfx | ||
- ASPNETCORE_Kestrel__Certificates__Default__Path=/https/_AWESOME_SPA_.pfx | ||
volumes: | ||
# Development certificate volume | ||
- ~/.aspnet/https:/https:ro | ||
//#if(UseReact) | ||
react-ui: | ||
build: | ||
context: ./react-ui | ||
context: ../react-ui | ||
ports: | ||
- "3000:3000" | ||
container_name: react-ui | ||
stdin_open: true | ||
tty: true | ||
environment: | ||
|
@@ -36,7 +34,6 @@ services: | |
//#endif | ||
//#if(UsePostgreSql) | ||
postgres: | ||
container_name: postgres_container | ||
image: postgres | ||
environment: | ||
POSTGRES_USER: ${POSTGRES_USER:-postgres} | ||
|
@@ -51,15 +48,13 @@ services: | |
restart: unless-stopped | ||
|
||
pgadmin: | ||
container_name: pgadmin_container | ||
image: dpage/pgadmin4 | ||
environment: | ||
PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL:[email protected]} | ||
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD:-admin} | ||
PGADMIN_CONFIG_SERVER_MODE: 'False' | ||
volumes: | ||
- pgadmin:/var/lib/pgadmin | ||
|
||
ports: | ||
- "${PGADMIN_PORT:-5050}:80" | ||
networks: | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,62 @@ | ||
version: "3" | ||
|
||
env: | ||
TEMPL_DIR: Asp.AwesomeTemplates.Spa | ||
|
||
dotenv: [".env.prod"] | ||
|
||
tasks: | ||
remove: | ||
dir: '{{.TEMPL_DIR}}\nupkg\' | ||
cmds: | ||
- pwd | ||
- dotnet new --uninstall $TEMPL_NAME | ||
- rm -rf * | ||
ignore_error: true | ||
|
||
create: | ||
dir: "{{.TEMPL_DIR}}" | ||
cmds: | ||
- dotnet pack | ||
ignore_error: true | ||
|
||
install: | ||
dir: '{{.TEMPL_DIR}}\nupkg\' | ||
cmds: | ||
- dotnet new --install $NUGET_FILE | ||
silent: false | ||
|
||
new: | ||
dir: '{{.TEMPL_DIR}}\nupkg\' | ||
cmds: | ||
- dotnet new $TEMPL_DOTNET_NAME -o $TEST_PROJ_NAME | ||
|
||
run-dotnet: | ||
dir: '{{.TEMPL_DIR}}\nupkg\{{.TEST_PROJ_NAME}}' | ||
cmds: | ||
- dotnet run | ||
|
||
run: | ||
dir: '{{.TEMPL_DIR}}\nupkg\{{.TEST_PROJ_NAME}}\{{.TEST_PROJ_NAME}}' | ||
cmds: | ||
- docker compose up | ||
|
||
all: | ||
cmds: | ||
- task: remove | ||
- task: create | ||
- task: install | ||
- task: new | ||
|
||
list: | ||
cmds: | ||
- dotnet new -l | ||
|
||
info: | ||
cmds: | ||
- dotnet new $TEMPL_DOTNET_NAME -h | ||
|
||
deploy: | ||
dir: '{{.TEMPL_DIR}}\nupkg' | ||
cmds: | ||
- dotnet nuget push $NUGET_FILE --api-key $NUGET_APIKEY --source https://api.nuget.org/v3/index.json |