Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
seriouz authored Sep 7, 2024
2 parents 075db6d + 1b3790f commit 6b63d79
Show file tree
Hide file tree
Showing 42 changed files with 1,635 additions and 51 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,17 @@ jobs:
run: |
export GITHUB_REF_NAME="${{ github.ref_name }}"
export RELEASE_VERSION="${GITHUB_REF_NAME#v}"
export RELEASE_MAJOR_VERSION="${RELEASE_VERSION%%.*}"
export remaining_version="${RELEASE_VERSION#*.}"
export RELEASE_MINOR_VERSION="${RELEASE_MAJOR_VERSION}.${remaining_version%%.*}"
echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_OUTPUT
echo "RELEASE_MINOR_VERSION=$RELEASE_MINOR_VERSION" >> $GITHUB_OUTPUT
echo "RELEASE_MAJOR_VERSION=$RELEASE_MAJOR_VERSION" >> $GITHUB_OUTPUT
outputs:
RELEASE_VERSION: ${{ steps.get-version-tag.outputs.RELEASE_VERSION }}
RELEASE_MINOR_VERSION: ${{ steps.get-version-tag.outputs.RELEASE_MINOR_VERSION }}
RELEASE_MAJOR_VERSION: ${{ steps.get-version-tag.outputs.RELEASE_MAJOR_VERSION }}

verify:
name: Run tests
Expand Down Expand Up @@ -111,5 +119,28 @@ jobs:
tags: |
bagetter/bagetter:latest
bagetter/bagetter:${{ needs.version.outputs.RELEASE_VERSION }}
bagetter/bagetter:${{ needs.version.outputs.RELEASE_MINOR_VERSION }}
bagetter/bagetter:${{ needs.version.outputs.RELEASE_MAJOR_VERSION }}
build-args: |
Version=${{ needs.version.outputs.RELEASE_VERSION }}
release_helm_chart:
if: ${{ github.ref_type == 'tag' }}
needs: [version, verify]
name: Release Helm chart to GitHub
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: Update version in helm chart
run: |
sed -i "s/version: \".*\"/version: \"${{ needs.version.outputs.RELEASE_VERSION }}\"/" "deployment templates/chart/bagetter/Chart.yaml"
sed -i "s/appVersion: \".*\"/appVersion: \"${{ needs.version.outputs.RELEASE_VERSION }}\"/" "deployment templates/chart/bagetter/Chart.yaml"
- name: Generate helm docs
uses: losisin/helm-docs-github-action@v1
with:
chart-search-root: "deployment templates"
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "Release helm chart version ${{ needs.version.outputs.RELEASE_VERSION }}"
file_pattern: 'deployment\ templates/chart/bagetter/Chart.yaml deployment\ templates/chart/bagetter/README.md'
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -274,3 +274,7 @@ __pycache__/
**/bagetter.db-wal

.vscode/

# Chart dependencies
charts/
Chart.lock
7 changes: 7 additions & 0 deletions BaGetter.sln
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BaGetterWebApplication", "s
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BaGetter.Web.Tests", "tests\BaGetter.Web.Tests\BaGetter.Web.Tests.csproj", "{BEEAAA73-36CD-4178-9C9F-6D036586E7BF}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BaGetter.Tencent", "src\BaGetter.Tencent\BaGetter.Tencent.csproj", "{9C809CE0-8C9A-468A-AF08-F5934B6D28D1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -133,6 +135,10 @@ Global
{BEEAAA73-36CD-4178-9C9F-6D036586E7BF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BEEAAA73-36CD-4178-9C9F-6D036586E7BF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BEEAAA73-36CD-4178-9C9F-6D036586E7BF}.Release|Any CPU.Build.0 = Release|Any CPU
{9C809CE0-8C9A-468A-AF08-F5934B6D28D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9C809CE0-8C9A-468A-AF08-F5934B6D28D1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9C809CE0-8C9A-468A-AF08-F5934B6D28D1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9C809CE0-8C9A-468A-AF08-F5934B6D28D1}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -156,6 +162,7 @@ Global
{9F7C4F38-D598-42D9-A9F8-962490483B18} = {26A0B557-53FB-4B9A-94C4-BCCF1BDCB0CC}
{E5AFE55D-0932-46A9-BFA3-C8A034037377} = {DDEC0736-8169-4834-815E-B78E7CE612A4}
{BEEAAA73-36CD-4178-9C9F-6D036586E7BF} = {C237857D-AD8E-4C52-974F-6A8155BB0C18}
{9C809CE0-8C9A-468A-AF08-F5934B6D28D1} = {26A0B557-53FB-4B9A-94C4-BCCF1BDCB0CC}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {1423C027-2C90-417F-8629-2A4CF107C055}
Expand Down
54 changes: 28 additions & 26 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,46 +3,48 @@
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="Azure.Data.Tables" Version="12.8.3" />
<PackageVersion Include="Azure.Search.Documents" Version="11.5.1" />
<PackageVersion Include="Azure.Storage.Blobs" Version="12.19.1" />
<PackageVersion Include="Azure.Storage.Common" Version="12.18.1" />
<PackageVersion Include="Azure.Data.Tables" Version="12.9.0" />
<PackageVersion Include="Azure.Search.Documents" Version="11.6.0" />
<PackageVersion Include="Azure.Storage.Blobs" Version="12.21.2" />
<PackageVersion Include="Azure.Storage.Common" Version="12.20.1" />
<PackageVersion Include="McMaster.Extensions.CommandLineUtils" Version="4.1.1" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="8.0.3" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="8.0.8" />
<PackageVersion Include="Microsoft.Azure.Cosmos" Version="3.38.1" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.3" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Relational" Version="8.0.3" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.8" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Relational" Version="8.0.8" />
<PackageVersion Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.1" />
<PackageVersion Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="8.0.3" />
<PackageVersion Include="Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore" Version="8.0.3" />
<PackageVersion Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="8.0.8" />
<PackageVersion Include="Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore" Version="8.0.8" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.1" />
<PackageVersion Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="8.0.0" />
<PackageVersion Include="NuGet.Frameworks" Version="6.9.1" />
<PackageVersion Include="NuGet.Protocol" Version="6.9.1" />
<PackageVersion Include="NuGet.Versioning" Version="6.9.1" />
<PackageVersion Include="NuGet.Frameworks" Version="6.11.0" />
<PackageVersion Include="NuGet.Protocol" Version="6.11.0" />
<PackageVersion Include="NuGet.Versioning" Version="6.11.0" />
<PackageVersion Include="System.Reflection.Metadata" Version="8.0.0" />
<PackageVersion Include="System.Text.Json" Version="8.0.3" />
<PackageVersion Include="System.Text.Json" Version="8.0.4" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.11.0" />
<PackageVersion Include="Moq" Version="4.20.70" />
<PackageVersion Include="xunit" Version="2.7.0" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.7" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.3" />
<PackageVersion Include="xunit" Version="2.9.0" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.2" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.8" />
<PackageVersion Include="coverlet.collector" Version="6.0.2" />
<PackageVersion Include="Humanizer" Version="2.14.1" />
<PackageVersion Include="Markdig" Version="0.36.2" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.3" />
<PackageVersion Include="Microsoft.Data.SqlClient" Version="5.2.0" />
<PackageVersion Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.0.2" />
<PackageVersion Include="Markdig" Version="0.37.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.8" />
<PackageVersion Include="Microsoft.Data.SqlClient" Version="5.2.2" />
<PackageVersion Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.0.4" />
<PackageVersion Include="Pomelo.EntityFrameworkCore.MySql" Version="8.0.2" />
<PackageVersion Include="Aliyun.OSS.SDK.NetCore" Version="2.13.0" />
<PackageVersion Include="AWSSDK.S3" Version="3.7.307" />
<PackageVersion Include="AWSSDK.SecurityToken" Version="3.7.300.60" />
<PackageVersion Include="Aliyun.OSS.SDK.NetCore" Version="2.14.1" />
<PackageVersion Include="AWSSDK.S3" Version="3.7.402.3" />
<PackageVersion Include="AWSSDK.SecurityToken" Version="3.7.400.12" />
<PackageVersion Include="Microsoft.Azure.Cosmos.Table" Version="1.0.8" />
<PackageVersion Include="Microsoft.Azure.Search" Version="10.1.0" />
<PackageVersion Include="Microsoft.Azure.Storage.Blob" Version="11.2.3" />
<PackageVersion Include="Google.Cloud.Storage.V1" Version="4.9.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.3" />
<PackageVersion Include="Google.Cloud.Storage.V1" Version="4.10.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.8" />
<PackageVersion Include="Tencent.QCloud.Cos.Sdk" Version="5.4.40" />
</ItemGroup>
</Project>
27 changes: 27 additions & 0 deletions deployment templates/chart/bagetter/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
# OWNERS file for Kubernetes
OWNERS
# helm-docs templates
*.gotmpl
32 changes: 32 additions & 0 deletions deployment templates/chart/bagetter/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
apiVersion: v2
name: bagetter
description: A Helm chart for BaGetter nuget package server
type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "1.0.4"

keywords:
- nuget
- baget
- bagetter

home: https://github.com/bagetter/BaGetter/tree/master/charts/BaGetter
# icon:

sources:
- https://github.com/bagetter/BaGetter
- https://hub.docker.com/r/bagetter/bagetter

dependencies:
- name: common
repository: http://bjw-s.github.io/helm-charts/
version: 3.0.3
36 changes: 36 additions & 0 deletions deployment templates/chart/bagetter/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# bagetter

![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.0.4](https://img.shields.io/badge/AppVersion-1.0.4-informational?style=flat-square)

A Helm chart for BaGetter nuget package server

**Homepage:** <https://github.com/bagetter/BaGetter/tree/master/charts/BaGetter>

## Source Code

* <https://github.com/bagetter/BaGetter>
* <https://hub.docker.com/r/bagetter/bagetter>

## Requirements

| Repository | Name | Version |
|------------|------|---------|
| http://bjw-s.github.io/helm-charts/ | common | 3.0.3 |

## Values

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| configMaps | object | See below | environment variables. See more environment variables in the [BaGetter documentation](https://www.bagetter.com/docs/Installation/docker). |
| configMaps.bagetter-env.data.ApiKey | string | `"ChangeMe"` | Set the Nuget API key |
| configMaps.bagetter-env.data.Storage__Type | string | `"FileSystem"` | Set database and storage settings |
| controllers | object | See values.yaml | Configures containers for the chart. |
| controllers.bagetter.containers.bagetter.image.pullPolicy | string | `"IfNotPresent"` | image pull policy |
| controllers.bagetter.containers.bagetter.image.repository | string | `"bagetter/bagetter"` | image repository |
| controllers.bagetter.containers.bagetter.image.tag | string | `"latest"` | image tag |
| ingress | object | See values.yaml | Enable and configure ingress settings for the chart under this key. |
| persistence | object | See values.yaml | Configure persistence settings for the chart under this key. |
| service | object | See values.yaml | Configures service settings for the chart. |

----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.13.1](https://github.com/norwoodj/helm-docs/releases/v1.13.1)
5 changes: 5 additions & 0 deletions deployment templates/chart/bagetter/templates/common.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
{{- include "bjw-s.common.loader.init" . }}

{{/* Render the templates */}}
{{ include "bjw-s.common.loader.generate" . }}
97 changes: 97 additions & 0 deletions deployment templates/chart/bagetter/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/bjw-s/helm-charts/app-template-3.0.1/charts/other/app-template/values.schema.json

#
# IMPORTANT NOTE
#
# This chart inherits from the common library chart. You can check the default values/options here:
# https://github.com/bjw-s/helm-charts/tree/main/charts/library/common/values.yaml
#

# -- environment variables. See more environment variables in the [BaGetter documentation](https://www.bagetter.com/docs/Installation/docker).
# @default -- See below
configMaps:
bagetter-env:
data:
# -- Set the Nuget API key
ApiKey: "ChangeMe"
# -- Set database and storage settings
Storage__Type: "FileSystem"
Storage__Path: "/data"
Database__Type: "Sqlite"
Database__ConnectionString: "Data Source=/data/bagetter.db"
# -- Additional settings. See [BaGetter configuration](https://www.bagetter.com/docs/configuration)
#Mirror__Enabled: "true"
#Mirror__PackageSource: "https://api.nuget.org/v3/index.json"
#PackageDeletionBehavior: "HardDelete"

# -- Configures containers for the chart.
# @default -- See values.yaml
controllers:
bagetter:
containers:
bagetter:
image:
# -- image repository
repository: bagetter/bagetter
# -- image tag
tag: latest
# -- image pull policy
pullPolicy: IfNotPresent
envFrom:
- configMapRef:
name: bagetter-bagetter-env
resources:
requests:
cpu: 100m
memory: 256Mi
limits:
cpu: 500m
memory: 512Mi
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
privileged: false
readOnlyRootFilesystem: false
# probes: # comming with v1.0.5
# liveness:
# enabled: true
# type: HTTP
# path: /health
# readiness:
# enabled: true

# -- Configures service settings for the chart.
# @default -- See values.yaml
service:
bagetter-srv:
controller: bagetter
ports:
http:
port: 8080

# -- Enable and configure ingress settings for the chart under this key.
# @default -- See values.yaml
ingress:
bagetter-ingress:
enabled: false
# className: "ingress-nginx"
hosts: []
# - host: bagetter.mydomain.com
# paths:
# - path: /
# service:
# identifier: bagetter
# port: 8080

# -- Configure persistence settings for the chart under this key.
# @default -- See values.yaml
persistence:
bagetter-data:
enabled: true
accessMode: "ReadWriteOnce"
size: "10Gi"
globalMounts:
- path: "/data"
28 changes: 28 additions & 0 deletions docs/docs/Installation/tencent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Use Tencent Cloud COS

You can store packages to [Tencent Cloud Object Storage Service](https://cloud.tencent.com/document/product/436/6222).

## Configure BaGetter

You can modify BaGetter's configurations by editing the `appsettings.json` file. For the full list of configurations, please refer to [BaGetter's configuration](../configuration.md) guide.

### Tencent Cloud Object Storage Service

Update the `appsettings.json` file:

```json
{
...

"Storage": {
"Type": "TencentCos",
"AppId": "",
"SecretId": "",
"SecretKey": "",
"BucketName": "bagetter",
"Region": "ap-guangzhou"
},

...
}
```
Loading

0 comments on commit 6b63d79

Please sign in to comment.