Compare commits
3 Commits
ae16f99776
..
v2.2.0
| Author | SHA1 | Date | |
|---|---|---|---|
| e7fb9a5cc7 | |||
| e1f7f919a2 | |||
| 593c0b686c |
@@ -105,15 +105,16 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||||
tags: |
|
tags: |
|
||||||
# Tag based on branch
|
# Tag based on branch - latest only for main
|
||||||
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
|
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
|
||||||
type=raw,value=latest-linux,enable=${{ github.ref == 'refs/heads/main' }}
|
type=raw,value=latest-linux,enable=${{ github.ref == 'refs/heads/main' }}
|
||||||
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/development' }}
|
# Development branch - no latest tag
|
||||||
type=raw,value=latest-linux,enable=${{ github.ref == 'refs/heads/development' }}
|
|
||||||
type=raw,value=development-latest,enable=${{ github.ref == 'refs/heads/development' }}
|
type=raw,value=development-latest,enable=${{ github.ref == 'refs/heads/development' }}
|
||||||
type=raw,value=development-latest-linux,enable=${{ github.ref == 'refs/heads/development' }}
|
type=raw,value=development-latest-linux,enable=${{ github.ref == 'refs/heads/development' }}
|
||||||
|
# Dev branch
|
||||||
type=raw,value=dev-latest,enable=${{ github.ref == 'refs/heads/dev' }}
|
type=raw,value=dev-latest,enable=${{ github.ref == 'refs/heads/dev' }}
|
||||||
type=raw,value=dev-latest-linux,enable=${{ github.ref == 'refs/heads/dev' }}
|
type=raw,value=dev-latest-linux,enable=${{ github.ref == 'refs/heads/dev' }}
|
||||||
|
# Staging branch
|
||||||
type=raw,value=staging-latest,enable=${{ github.ref == 'refs/heads/staging' }}
|
type=raw,value=staging-latest,enable=${{ github.ref == 'refs/heads/staging' }}
|
||||||
type=raw,value=staging-latest-linux,enable=${{ github.ref == 'refs/heads/staging' }}
|
type=raw,value=staging-latest-linux,enable=${{ github.ref == 'refs/heads/staging' }}
|
||||||
# Tag with commit sha
|
# Tag with commit sha
|
||||||
@@ -312,9 +313,6 @@ jobs:
|
|||||||
if: github.ref == 'refs/heads/development'
|
if: github.ref == 'refs/heads/development'
|
||||||
run: |
|
run: |
|
||||||
IMAGE_LOWER=$(echo "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}" | tr '[:upper:]' '[:lower:]')
|
IMAGE_LOWER=$(echo "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}" | tr '[:upper:]' '[:lower:]')
|
||||||
docker buildx imagetools create -t ${IMAGE_LOWER}:latest \
|
|
||||||
${IMAGE_LOWER}:latest-linux \
|
|
||||||
${IMAGE_LOWER}:latest-windows
|
|
||||||
docker buildx imagetools create -t ${IMAGE_LOWER}:development-latest \
|
docker buildx imagetools create -t ${IMAGE_LOWER}:development-latest \
|
||||||
${IMAGE_LOWER}:development-latest-linux \
|
${IMAGE_LOWER}:development-latest-linux \
|
||||||
${IMAGE_LOWER}:development-latest-windows
|
${IMAGE_LOWER}:development-latest-windows
|
||||||
|
|||||||
@@ -48,11 +48,13 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||||
tags: |
|
tags: |
|
||||||
# Tag based on branch
|
# Tag based on branch - latest only for main
|
||||||
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
|
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
|
||||||
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/development' }}
|
# Development branch - no latest tag
|
||||||
type=raw,value=development-latest,enable=${{ github.ref == 'refs/heads/development' }}
|
type=raw,value=development-latest,enable=${{ github.ref == 'refs/heads/development' }}
|
||||||
|
# Dev branch
|
||||||
type=raw,value=dev-latest,enable=${{ github.ref == 'refs/heads/dev' }}
|
type=raw,value=dev-latest,enable=${{ github.ref == 'refs/heads/dev' }}
|
||||||
|
# Staging branch
|
||||||
type=raw,value=staging-latest,enable=${{ github.ref == 'refs/heads/staging' }}
|
type=raw,value=staging-latest,enable=${{ github.ref == 'refs/heads/staging' }}
|
||||||
# Tag with commit sha
|
# Tag with commit sha
|
||||||
type=sha,prefix={{branch}}-,format=short
|
type=sha,prefix={{branch}}-,format=short
|
||||||
@@ -173,9 +175,6 @@ jobs:
|
|||||||
if: github.ref == 'refs/heads/development'
|
if: github.ref == 'refs/heads/development'
|
||||||
run: |
|
run: |
|
||||||
IMAGE_LOWER=$(echo "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}" | tr '[:upper:]' '[:lower:]')
|
IMAGE_LOWER=$(echo "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}" | tr '[:upper:]' '[:lower:]')
|
||||||
docker buildx imagetools create -t ${IMAGE_LOWER}:latest \
|
|
||||||
${IMAGE_LOWER}:latest \
|
|
||||||
${IMAGE_LOWER}:latest-windows
|
|
||||||
docker buildx imagetools create -t ${IMAGE_LOWER}:development-latest \
|
docker buildx imagetools create -t ${IMAGE_LOWER}:development-latest \
|
||||||
${IMAGE_LOWER}:development-latest \
|
${IMAGE_LOWER}:development-latest \
|
||||||
${IMAGE_LOWER}:development-latest-windows
|
${IMAGE_LOWER}:development-latest-windows
|
||||||
|
|||||||
@@ -5,6 +5,8 @@
|
|||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<!-- Version is now automatically calculated by MinVer from git tags -->
|
<!-- Version is now automatically calculated by MinVer from git tags -->
|
||||||
|
<MinVerTagPrefix>v</MinVerTagPrefix>
|
||||||
|
<MinVerVerbosity>detailed</MinVerVerbosity>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
@@ -27,4 +29,10 @@
|
|||||||
</PackageReference>
|
</PackageReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Content Update="wwwroot\version.json">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@@ -43,10 +43,30 @@ namespace Data_Coupler.Services
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// Cerca il file version.json nella root dell'applicazione
|
// Cerca il file version.json nella cartella wwwroot o nella root del progetto
|
||||||
var versionFilePath = Path.Combine(_env.ContentRootPath, "version.json");
|
string? versionFilePath = null;
|
||||||
|
|
||||||
if (File.Exists(versionFilePath))
|
// Prima prova in wwwroot
|
||||||
|
if (!string.IsNullOrEmpty(_env.WebRootPath))
|
||||||
|
{
|
||||||
|
var wwwrootPath = Path.Combine(_env.WebRootPath, "version.json");
|
||||||
|
if (File.Exists(wwwrootPath))
|
||||||
|
{
|
||||||
|
versionFilePath = wwwrootPath;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Se non trovato, prova nella root del progetto
|
||||||
|
if (versionFilePath == null)
|
||||||
|
{
|
||||||
|
var contentPath = Path.Combine(_env.ContentRootPath, "wwwroot", "version.json");
|
||||||
|
if (File.Exists(contentPath))
|
||||||
|
{
|
||||||
|
versionFilePath = contentPath;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (versionFilePath != null && File.Exists(versionFilePath))
|
||||||
{
|
{
|
||||||
var json = File.ReadAllText(versionFilePath);
|
var json = File.ReadAllText(versionFilePath);
|
||||||
var version = JsonSerializer.Deserialize<VersionInfo>(json, new JsonSerializerOptions
|
var version = JsonSerializer.Deserialize<VersionInfo>(json, new JsonSerializerOptions
|
||||||
@@ -56,13 +76,14 @@ namespace Data_Coupler.Services
|
|||||||
|
|
||||||
if (version != null)
|
if (version != null)
|
||||||
{
|
{
|
||||||
_logger.LogInformation("Version loaded: {Version}", version.GetFullVersion());
|
_logger.LogInformation("Version loaded from {Path}: {Version}", versionFilePath, version.GetFullVersion());
|
||||||
return version;
|
return version;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_logger.LogWarning("version.json not found at {Path}, using default version", versionFilePath);
|
_logger.LogWarning("version.json not found. Searched in WebRootPath: {WebRoot}, ContentRootPath: {ContentRoot}",
|
||||||
|
_env.WebRootPath ?? "null", _env.ContentRootPath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"version": "2.1.0",
|
"version": "2.1.2",
|
||||||
"commitSha": "local",
|
"commitSha": "593c0b6",
|
||||||
"branch": "dev",
|
"branch": "development",
|
||||||
"buildDate": "2026-02-02",
|
"buildDate": "2026-02-02",
|
||||||
"buildEnvironment": "Local"
|
"buildEnvironment": "Local"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user