Skip to content

Commit

Permalink
Merge pull request #627 from WildGums/GitHubSync/20250212-111105
Browse files Browse the repository at this point in the history
GitHubSync update
  • Loading branch information
GeertvanHorrik authored Feb 12, 2025
2 parents fafabf0 + ffefb77 commit b52b487
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 356 deletions.
207 changes: 0 additions & 207 deletions deployment/cake/apps-web-tasks.cake

This file was deleted.

49 changes: 0 additions & 49 deletions deployment/cake/apps-web-variables.cake

This file was deleted.

43 changes: 1 addition & 42 deletions deployment/cake/docker-tasks.cake
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#l "docker-variables.cake"
#l "lib-octopusdeploy.cake"

#addin "nuget:?package=Cake.Docker&version=1.3.0"

Expand Down Expand Up @@ -311,9 +310,6 @@ public class DockerImagesProcessor : ProcessorBase
var dockerRegistryUserName = GetDockerRegistryUserName(dockerImage);
var dockerRegistryPassword = GetDockerRegistryPassword(dockerImage);
var dockerImageName = GetDockerImageName(dockerImage);
var octopusRepositoryUrl = BuildContext.OctopusDeploy.GetRepositoryUrl(dockerImage);
var octopusRepositoryApiKey = BuildContext.OctopusDeploy.GetRepositoryApiKey(dockerImage);
var octopusDeploymentTarget = BuildContext.OctopusDeploy.GetDeploymentTarget(dockerImage);

if (string.IsNullOrWhiteSpace(dockerRegistryUrl))
{
Expand Down Expand Up @@ -347,44 +343,7 @@ public class DockerImagesProcessor : ProcessorBase

CakeContext.DockerPush(dockerImagePushSettings, dockerImageTag);

if (string.IsNullOrWhiteSpace(octopusRepositoryUrl))
{
CakeContext.Warning("Octopus Deploy url is not specified, skipping deployment to Octopus Deploy");
continue;
}

var imageVersion = BuildContext.General.Version.NuGet;

CakeContext.Information("Creating release '{0}' in Octopus Deploy", imageVersion);

CakeContext.OctoCreateRelease(dockerImage, new CreateReleaseSettings
{
Server = octopusRepositoryUrl,
ApiKey = octopusRepositoryApiKey,
ReleaseNumber = imageVersion,
DefaultPackageVersion = imageVersion,
IgnoreExisting = true,
Packages = new Dictionary<string, string>
{
{ dockerImageName, imageVersion }
}
});

CakeContext.Information("Deploying release '{0}' via Octopus Deploy", imageVersion);

CakeContext.OctoDeployRelease(octopusRepositoryUrl, octopusRepositoryApiKey, dockerImage, octopusDeploymentTarget,
imageVersion, new OctopusDeployReleaseDeploymentSettings
{
ShowProgress = true,
WaitForDeployment = true,
DeploymentTimeout = TimeSpan.FromMinutes(5),
CancelOnTimeout = true,
GuidedFailure = true,
Force = true,
NoRawLog = true,
});

await BuildContext.Notifications.NotifyAsync(dockerImage, string.Format("Deployed to Octopus Deploy"), TargetType.DockerImage);
await BuildContext.Notifications.NotifyAsync(dockerImage, string.Format("Deployed to Docker"), TargetType.DockerImage);
}
}
finally
Expand Down
8 changes: 0 additions & 8 deletions deployment/cake/lib-generic.cake
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,6 @@ public enum TargetType

VsExtension,

WebApp,

WpfApp
}

Expand Down Expand Up @@ -847,12 +845,6 @@ private static bool IsOnlyDependencyProject(BuildContext buildContext, string pr
return false;
}

if (buildContext.Web.Items.Contains(projectName))
{
buildContext.CakeContext.Information($"Project is list of web apps, assuming not dependency only");
return false;
}

if (buildContext.Wpf.Items.Contains(projectName))
{
buildContext.CakeContext.Information($"Project is list of WPF apps, assuming not dependency only");
Expand Down
2 changes: 1 addition & 1 deletion deployment/cake/lib-msbuild.cake
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#addin "nuget:?package=Cake.Issues&version=5.5.0"
#addin "nuget:?package=Cake.Issues.MsBuild&version=5.5.0"
#addin "nuget:?package=System.Configuration.ConfigurationManager&version=9.0.1"
#addin "nuget:?package=System.Configuration.ConfigurationManager&version=9.0.2"

#tool "nuget:?package=MSBuild.Extension.Pack&version=1.9.1"

Expand Down
40 changes: 0 additions & 40 deletions deployment/cake/lib-octopusdeploy.cake

This file was deleted.

Loading

0 comments on commit b52b487

Please sign in to comment.