Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/nuget.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: "Deploy to nuget"
on:
push:
branches:
- "master"
env:
PROJECT_PATH: "PgBackup.csproj"
PACK_OUTPUT_DIR: ${{ github.workspace }}\output
NUGET_SOURCE_URL: https://www.nuget.org/packages/PgBackup.Net/1.0.0
jobs:
deploy:
name: "deploy"
runs-on: "ubuntu-latest"
steps:
- name: "Checkout"
uses: actions/checkout@v3
- name: "Install dotnet standard"
uses: actions/setup-dotnet@v3
with:
dotnet-version: "6.0"
- name: "Restore Packages"
run: dotnet restore ${{ env.PROJECT_PATH }}
- name: "Build Project"
run: dotnet build ${{ env.PROJECT_PATH }} --no-restore --configuration Release
- name: "Pack Project"
run: dotnet pack ${{ env.PROJECT_PATH }} --no-restore --no-build --configuration Release --include-symbols --output ${{ env.PACK_OUTPUT_DIR }}
- name: "Push Package"
run: dotnet nuget push ${{ env.PACK_OUTPUT_DIR }}\*.nupkg -k ${{ secrets.NUGET_AUTH_TOKEN }} -s ${{ env.NUGET_SOURCE_URL }}
1 change: 0 additions & 1 deletion Enums/Enums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@ public enum BackupFileFormat
Tar,
Directory,
Custom

}
}
18 changes: 13 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,38 @@

# PostgreSQL backup

This package is a simple wrapper of postgresql's pg_dump client tool and can be used to take postgres database backups on demand from your .NET core or .NET framework applications.
Please refer https://www.postgresql.org/docs/current/libpq-pgpass.html for setting up the .pgpass file for the package to use to authentication to the database server,
This package is a simple wrapper of postgresql's pg_dump client tool and can be used to take postgres database backups on demand from a .NET core application.
Please refer https://www.postgresql.org/docs/current/libpq-pgpass.html for setting up the .pgpass file for the package to use to authentication to the database server,

## Installation Instructions

Nuget package available (https://www.nuget.org/packages/PgBackup.Net/1.0.0)

```
Install-Package PgBackup.Net -Version 1.0.0
```

dotnet cli:

```
dotnet add package PgBackup.Net --version=1.0.0
```

# Package usage

## 1. Register the service in Startup.cs or Program.cs file

```
services.AddPgBackupServices();
```
## 2. call the BackupDB method with path string(the storage location of the backup tar file)

## 2. call the BackupDB method with path string(the storage location of the backup tar file)

```
using PgBackup.Services;
public class myClass
{
private readonly IPgDumpService _pgDumpService;

public myClass(IPgDumpService pgDumpService)
{
_pgDumpService = pgDumpService;
Expand Down