Skip to content

Commit

Permalink
Readme up to date (#543)
Browse files Browse the repository at this point in the history
* ensure dbtool runs with podman

* updated readme

* updated k6 readme

* minor changes

* updated readme

* removed docker section

* Update README.md

* Update README.md
  • Loading branch information
acn-sbuad authored Jun 12, 2024
1 parent 5336e50 commit 01a0e36
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 24 deletions.
43 changes: 30 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,13 @@ The persistance layer that implements repository logic.

## Getting started

### Prerequisites
- [PostgreSQL](https://www.postgresql.org/download/) v15
- [pgAdmin](https://www.pgadmin.org/download/)
- [Docker](https://docs.docker.com/compose/install/)
1. [.NET 8.0 SDK](https://dotnet.microsoft.com/download/dotnet/8.0)
2. Newest [Git](https://git-scm.com/downloads)
3. A code editor - we like [Visual Studio Code](https://code.visualstudio.com/download)
- Also install [recommended extensions](https://code.visualstudio.com/docs/editor/extension-marketplace#_workspace-recommended-extensions) (e.g. [C#](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csharp))
4. [Podman](https://podman.io/) or another container tool such as Docker Desktop
5. [PostgreSQL](https://www.postgresql.org/download/)
6. [pgAdmin](https://www.pgadmin.org/download/)

### Setting up PostgreSQL

Expand All @@ -52,21 +55,35 @@ In pgAdmin
- platform_notifications (canlogin)
- Create schema _notifications_ in notificationsdb with owner _platform_notifications_admin_

A more detailed description of the database setup is available in [our developer handbook](https://docs.altinn.studio/community/contributing/handbook/postgres/)

### Cloning the application

Clone [Altinn Notifications repo](https://github.com/Altinn/altinn-notifications) and navigate to the folder.

```bash
git clone https://github.com/Altinn/altinn-notifications
cd altinn-notifications
```

### Setting up Kafka broker and visualization
Ensure that Dokcer has been installed and is running.
Ensure that Docker has been installed and is running.

In a terminal navigate to the root of this repository
and run command `docker compose -f setup-kafka.yml up -d`

Kafdrop will be available on localhost:9000
and run command `podman compose -f setup-kafka.yml up -d`

### Running the application
The application runs on port 5090. See full details in Dockerfile.
Kafdrop is now available at http://localhost:9000.

### Running the application with .NET

- In a terminal navigate to /src/Altinn.Notifications
- Run `dotnet run ` or `dotnet watch`
The Notifications components can be run locally when developing/debugging. Follow the install steps above if this has not already been done.

Application is now available on localhost:5090.
- Navigate to _src/Notifications_, and build and run the code from there, or run the solution using you selected code editor

```cmd
cd src/Notifications
dotnet run
```

The notifications solution is now available locally at http://localhost:5090/.
To access swagger use http://localhost:5090/swagger.
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,17 @@
</AssemblyAttribute>
</ItemGroup>

<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec
Command="$(TargetDir)../../../../DbTools/bin/Debug/$(TargetFramework)/DbTools $(TargetDir)../../../Migration"
Condition="Exists('$(TargetDir)../../../../DbTools/bin/Debug/$(TargetFramework)/DbTools') or Exists('$(TargetDir)../../../../DbTools/bin/Debug/$(TargetFramework)/DbTools.exe')"
/>
<Exec
Command="/app_tools/DbTools ./Migration"
Condition="Exists('/app_tools/DbTools')"
/>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<PropertyGroup>
<DbToolsExecuted>false</DbToolsExecuted>
</PropertyGroup>

<Exec Command="/app_tools/DbTools ./Migration" Condition="Exists('/app_tools/DbTools')" />
<PropertyGroup Condition="Exists('/app_tools/DbTools')">
<DbToolsExecuted>true</DbToolsExecuted>
</PropertyGroup>

<Exec Command="$(TargetDir)../../../../DbTools/bin/Debug/$(TargetFramework)/DbTools $(TargetDir)../../../Migration"
Condition="'$(DbToolsExecuted)' != 'true' and (Exists('$(TargetDir)../../../../DbTools/bin/Debug/$(TargetFramework)/DbTools') or Exists('$(TargetDir)../../../../DbTools/bin/Debug/$(TargetFramework)/DbTools.exe'))" />
</Target>
</Project>
4 changes: 2 additions & 2 deletions test/k6/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Run test suite by specifying filename.

For example:

>$> docker-compose run k6 run /src/tests/orders_email.js `
>$> podman compose run k6 run /src/tests/orders_email.js `
-e tokenGeneratorUserName=autotest `
-e tokenGeneratorUserPwd=*** `
-e env=*** `
Expand All @@ -42,7 +42,7 @@ For example:

The comand consists of three sections

`docker-compose run` to run the test in a docker container
`podman compose run` to run the test in a docker container

`k6 run {path to test file}` pointing to the test file you want to run e.g. `/src/tests/orders_email.js.js`

Expand Down

0 comments on commit 01a0e36

Please sign in to comment.