Skip to content

Latest commit

 

History

History
104 lines (71 loc) · 3.56 KB

File metadata and controls

104 lines (71 loc) · 3.56 KB

Altinn Storage

Build status

Storage build status

Getting Started

These instructions will get you a copy of the storage component up and running on your machine for development and testing purposes.

Prerequisites

Manually setting up PostgreSQL

Ensure that both PostgreSQL and pgAdmin have been installed and start pgAdmin. If you installed prerequisite infrastructure through docker compose, you can skip to the next section.

In pgAdmin

  • Create database storagedb
  • Create the following users with password: Password (see privileges in parentheses)
    • platform_storage_admin (superuser, canlogin)
    • platform_storage (canlogin)
  • Create schema storage in storagedb with owner platform_storage_admin

A more detailed description of the database setup is available in our developer handbook

Setting up PostgreSQL with docker compose

Comment out the marked lines in Dockerfile and docker-compose.yml and run the services in docker-compose.

Cloning the application

Clone Altinn Storage repo and navigate to the folder.

git clone https://github.com/Altinn/altinn-storage
cd altinn-storage

Run tests

The tests depend on the storage_postgres container in docker to run locally. See the 'Running the application in a docker container' section below to start it. You can run the tests by executing the following commands.

dotnet test Altinn.Platform.Storage.slnx

Running the application in a docker container

  • Start Altinn Storage docker container run the command

Using podman:

podman compose up -d --build

Using docker:

docker compose up -d --build
  • To stop the container running Altinn Storage run the command

Using podman:

podman compose stop

Using docker:

docker compose stop

Running the application with .NET

The Storage components can be run locally when developing/debugging. Follow the install steps above if this has not already been done.

  • Navigate to src/Storage, and build and run the code from there, or run the solution using you selected code editor

    cd src/Storage
    dotnet run

The storage solution is now available locally at http://localhost:5010/. To access swagger use http://localhost:5010/swagger.

Git blame

This repo has had a few commits that changes lots of files in insignificant ways (csharpier and file-scoped namespaces), that changed a lot of lines so if you keep seeing the same huge commit in git blame, we recommend the following command in the root of the repo.

git config blame.ignoreRevsFile .git-blame-ignore-revs