Skip to content

Commit

Permalink
New catalog registration API not supported by Deployer API.
Browse files Browse the repository at this point in the history
Adjusting catalog registration to also trigger a Volatile Upload, that can be used for deployments through API.
  • Loading branch information
janstaelensskyline committed Nov 4, 2024
1 parent 2cb7a5b commit f5b6d82
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,13 @@ public async Task<ArtifactUploadResult> UploadVersionAsync(byte[] package, strin
if (response.IsSuccessStatusCode)
{
_logger.LogDebug($"The version upload api returned a {response.StatusCode} response. Body: {body}");
var returnedResult = JsonConvert.DeserializeObject<CatalogUploadResult>(await response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false));
return new ArtifactUploadResult() { ArtifactId = returnedResult.AzureStorageId };

// Problem, Deployer cannot handle the new flow of catalog upload. So we will use the 'old' upload again. Return that Identifier.
CatalogMetaData meta = new CatalogMetaData() { Name = fileName, Version = new CatalogVersionMetaData() { Value = version } };
return await VolatileArtifactUploadAsync(package, key, meta, cancellationToken);

//var returnedResult = JsonConvert.DeserializeObject<CatalogUploadResult>(await response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false));
//return new ArtifactUploadResult() { ArtifactId = returnedResult.AzureStorageId };
}

_logger.LogError($"The version upload api returned a {response.StatusCode} response. Body: {body}");
Expand Down
4 changes: 2 additions & 2 deletions CICD.Tools.CatalogUpload/CICD.Tools.CatalogUpload.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
<Nullable>disable</Nullable>
<AssemblyName>Skyline.DataMiner.CICD.Tools.CatalogUpload</AssemblyName>
<RootNamespace>Skyline.DataMiner.CICD.Tools.CatalogUpload</RootNamespace>
<PackageVersion>1.0.1-alpaha2</PackageVersion>
<Version>1.0.1-alpaha2</Version>
<PackageVersion>1.0.1-local</PackageVersion>
<Version>1.0.1-local</Version>
<PackageTags>Skyline;DataMiner</PackageTags>
<PackageProjectUrl>https://skyline.be</PackageProjectUrl>
<PackageReadmeFile>README.md</PackageReadmeFile>
Expand Down

0 comments on commit f5b6d82

Please sign in to comment.