Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/github_actions/actions/checkout-4
Browse files Browse the repository at this point in the history
  • Loading branch information
0GiS0 authored Jul 16, 2024
2 parents 4bd3635 + d9ea1ab commit 898d03f
Show file tree
Hide file tree
Showing 15 changed files with 4,082 additions and 3,167 deletions.
17 changes: 0 additions & 17 deletions .browserslistrc

This file was deleted.

27 changes: 27 additions & 0 deletions .devcontainer/db-init.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
IF NOT EXISTS(SELECT * FROM sys.databases WHERE name = 'heroes')
BEGIN
CREATE DATABASE heroes;
END
GO

USE heroes;
GO

IF NOT EXISTS (SELECT * FROM sys.tables WHERE name = 'Heroes')
BEGIN
CREATE TABLE Heroes (
Id INT PRIMARY KEY,
Name NVARCHAR(100),
AlterEgo NVARCHAR(100),
Description NVARCHAR(255)
);
END
GO

INSERT INTO Heroes (Id, Name, AlterEgo, Description) VALUES
(1, 'Batman', 'Bruce Wayne', 'A wealthy American playboy, philanthropist, and owner of Wayne Enterprises.'),
(2, 'Superman', 'Clark Kent', 'A superhero who was born on the planet Krypton and was given the name Kal-El at birth.'),
(3, 'Wonder Woman', 'Diana Prince', 'A demigoddess and warrior princess of the Amazons.'),
(4, 'Flash', 'Barry Allen', 'A superhero with the power of super speed.'),
(5, 'Green Lantern', 'Hal Jordan', 'A test pilot who was chosen to become the first human member of the Green Lantern Corps.');
GO
21 changes: 19 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,31 @@
"features": {
"ghcr.io/devcontainers-contrib/features/angular-cli:2": {}
},
"forwardPorts": [
"forwardPorts": [
4200, // Angular
5010 // Web API
5010 // Web API
],
"customizations": {
"vscode": {
"settings": {
"mssql.connections": [
{
"server": "db,1433",
"database": "heroes",
"authenticationType": "SqlLogin",
"user": "sa",
"password": "P@ssword",
"emptyPasswordInput": false,
"savePassword": false,
"profileName": "mssql-container",
"trustServerCertificate": true
}
]
},

"extensions": [
"ms-azuretools.vscode-docker",
"ms-mssql.mssql",
"GitHub.copilot",
"dbaeumer.vscode-eslint",
"DavidAnson.vscode-markdownlint",
Expand Down
23 changes: 22 additions & 1 deletion .devcontainer/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,36 @@ services:
API_URL: https://${CODESPACE_NAME}-5010.${GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN}/api/hero
command: sleep infinity
api:
depends_on:
- db
- init-db
image: ghcr.io/0gis0/tour-of-heroes-dotnet-api/tour-of-heroes-api:6b947c4
environment:
- ASPNETCORE_ENVIRONMENT=Development
- ConnectionStrings__DefaultConnection=Server=db,1433;Initial Catalog=heroes;Persist Security Info=False;User ID=sa;Password=P@ssword;TrustServerCertificate=True;
ports:
- "5010:5000"
db:
db:
image: mcr.microsoft.com/azure-sql-edge
restart: unless-stopped
environment:
SA_PASSWORD: P@ssword
ACCEPT_EULA: Y
init-db:
image: mcr.microsoft.com/azure-sql-edge
command: >
/bin/bash -c "
while ! /opt/mssql-tools/bin/sqlcmd -S db -U sa -P 'P@ssword' -Q 'SELECT * FROM sys.databases' > /dev/null 2>&1; do
echo 'Waiting for SQL Server to become available...'
sleep 1
done;
echo 'SQL Server is now available.'
/opt/mssql-tools/bin/sqlcmd -S db -U sa -P 'P@ssword' -i /tmp/db-init.sql;
"
volumes:
- ./db-init.sql:/tmp/db-init.sql
environment:
SA_PASSWORD: P@ssword
ACCEPT_EULA: Y
restart: on-failure
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- uses: actions/checkout@v4
- name: Bump version and push tag
id: create_tag
uses: anothrNick/github-tag-action@1.67.0
uses: anothrNick/github-tag-action@1.70.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WITH_V: true
2 changes: 1 addition & 1 deletion .github/workflows/eslint-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
SERVER_TOKEN: ${{ github.sha }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v2.5.2
- uses: actions/setup-node@v4.0.3
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install Angular CLI
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/prettier-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v2.5.2
- uses: actions/setup-node@v4.0.3
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install dependencies and run prettier-check
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4.0.3
with:
node-version: ${{ env.NODE_VERSION }}
cache: "npm"
Expand Down
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,15 @@ npm start
```

El proceso arrancará y estará disponible en esta dirección: [http://localhost:4200/](http://localhost:4200/)

## Uso de Datos de Muestra para Pruebas

Para facilitar las pruebas en el entorno de desarrollo, se ha incluido un conjunto de datos de muestra en la base de datos del contenedor de desarrollo. Estos datos permiten probar la aplicación sin necesidad de configurar una base de datos externa o realizar inserciones manuales de datos.

Para utilizar estos datos de muestra, asegúrate de que el contenedor de desarrollo esté en ejecución y sigue estos pasos:

1. Accede al contenedor de la base de datos utilizando tu herramienta de gestión de bases de datos preferida.
2. Verifica que los datos de muestra se han insertado correctamente ejecutando consultas de selección en las tablas relevantes.
3. Utiliza estos datos para realizar pruebas de funcionalidad en la aplicación.

Estos datos de muestra están diseñados para cubrir casos de uso comunes y facilitar el proceso de desarrollo y pruebas.
44 changes: 22 additions & 22 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,34 @@
# https://aka.ms/yaml

trigger:
- main
- main

pool:
vmImage: ubuntu-latest

steps:
- script: echo Hello, world!
displayName: 'Run a one-line script'
- script: echo Hello, world!
displayName: "Run a one-line script"

- task: NodeTool@0
inputs:
versionSource: 'spec'
versionSpec: '18.x'
- task: NodeTool@0
inputs:
versionSource: "spec"
versionSpec: "18.x"

- task: Npm@1
inputs:
command: 'install'
- task: Npm@1
inputs:
command: "install"

# Generate SBOM - https://github.com/microsoft/sbom-tool/blob/main/docs/setting-up-ado-pipelines.md
- script: |
curl -Lo $(Agent.TempDirectory)/sbom-tool https://github.com/microsoft/sbom-tool/releases/latest/download/sbom-tool-linux-x64
chmod +x $(Agent.TempDirectory)/sbom-tool
$(Agent.TempDirectory)/sbom-tool generate -b $(Build.ArtifactStagingDirectory) -bc $(Build.SourcesDirectory) -pn Test -pv 1.0.0 -ps MyCompany -nsb https://sbom.mycompany.com -V Verbose -li true
displayName: Generate SBOM
# Generate SBOM - https://github.com/microsoft/sbom-tool/blob/main/docs/setting-up-ado-pipelines.md
- script: |
curl -Lo $(Agent.TempDirectory)/sbom-tool https://github.com/microsoft/sbom-tool/releases/latest/download/sbom-tool-linux-x64
chmod +x $(Agent.TempDirectory)/sbom-tool
$(Agent.TempDirectory)/sbom-tool generate -b $(Build.ArtifactStagingDirectory) -bc $(Build.SourcesDirectory) -pn Test -pv 1.0.0 -ps MyCompany -nsb https://sbom.mycompany.com -V Verbose -li true
displayName: Generate SBOM
#Upload SBOM to Build Artifacts
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'drop'
publishLocation: 'Container'
#Upload SBOM to Build Artifacts
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: "$(Build.ArtifactStagingDirectory)"
ArtifactName: "drop"
publishLocation: "Container"
Loading

0 comments on commit 898d03f

Please sign in to comment.