Skip to content

Commit

Permalink
Initial setup CaC for OpenTelemetryPlugin
Browse files Browse the repository at this point in the history
[sc-67609]
  • Loading branch information
edlyn-liew authored and Octopus Deploy committed May 23, 2024
1 parent 9f41707 commit fe787a6
Show file tree
Hide file tree
Showing 4 changed files with 116 additions and 0 deletions.
89 changes: 89 additions & 0 deletions .octopus/deployment_process.ocl
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
step "deploy-to-internal-teamcity" {
name = "Deploy to Internal TeamCity"

action {
action_type = "Octopus.Script"
environments = ["test"]
notes = "We can't do this yet because we can't upgrade a plugin without restarting TeamCity server. We hope this feature will be enabled soon. See [TW-12604](https://youtrack.jetbrains.com/issue/TW-12604)."
properties = {
Octopus.Action.Script.ScriptBody = "echo \"Not yet implemented\""
Octopus.Action.Script.ScriptSource = "Inline"
Octopus.Action.Script.Syntax = "Bash"
}
worker_pool = "hosted-ubuntu"
}
}

step "publish-to-jetbrains-marketplace" {
name = "Publish to Jetbrains Marketplace"

action {
action_type = "Octopus.Script"
channels = ["release"]
environments = ["production"]
properties = {
Octopus.Action.Script.ScriptBody = <<-EOT
set -eu

authHeader="Authorization: Bearer $(get_octopusvariable "jbHubPermanentToken")"
pluginId="$(get_octopusvariable "jbPackageId")"
filePath="$(get_octopusvariable "Octopus.Action.Package[Octopus.TeamCity.OpenTelemetry].PackageFilePath")"

echo "#{Octopus.Release.Notes | MarkdownToHTML}" >> notes.txt

channel="$(get_octopusvariable "jbChannel")"
if [ -z $channel ]; then
channel="Stable"
fi
curl -i -s --header "$authHeader" -F pluginId=$pluginId -F file=@$filePath -F channel=$channel -F "notes=<notes.txt" https://plugins.jetbrains.com/plugin/uploadPlugin
EOT
Octopus.Action.Script.ScriptSource = "Inline"
Octopus.Action.Script.Syntax = "Bash"
}
worker_pool = "hosted-ubuntu"

packages "Octopus.TeamCity.OpenTelemetry" {
acquisition_location = "Server"
feed = "octopus-server-built-in"
package_id = "Octopus.TeamCity.OpenTelemetry"
properties = {
Extract = "False"
SelectionMode = "immediate"
}
}
}
}

step "create-github-release" {
name = "Create GitHub Release"

action {
environments = ["production"]
properties = {
GHCR_CommitId = "#{Octopus.Deployment.PackageBuildInformation[0].VcsCommitNumber}"
GHCR_ContentType = "application/zip"
GHCR_Draft = "False"
GHCR_GitHubApiKey = "#{GitHubAccessToken}"
GHCR_GitHubRepository = "opentelemetry-teamcity-plugin"
GHCR_GitHubUsername = "OctopusDeploy"
GHCR_PackageId = "{\"PackageId\":\"Octopus.TeamCity.OpenTelemetry\",\"FeedId\":\"octopus-server-built-in\"}"
GHCR_PreRelease = "#{IsPreRelease}"
GHCR_ReleaseNotes = "#{Octopus.Release.Notes}"
GHCR_VersionNumber = "#{Octopus.Release.Number}"
Octopus.Action.Template.Id = "ActionTemplates-1583"
Octopus.Action.Template.Version = "25"
}
worker_pool = "hosted-ubuntu"

packages "Asset" {
acquisition_location = "Server"
feed = "octopus-server-built-in"
package_id = "Octopus.TeamCity.OpenTelemetry"
properties = {
Extract = "False"
PackageParameterName = "GHCR_PackageId"
SelectionMode = "deferred"
}
}
}
}
13 changes: 13 additions & 0 deletions .octopus/deployment_settings.ocl
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
release_notes_template = <<-EOT
#{each package in Octopus.Release.Package}
#{each commit in package.Commits}
- [#{commit.CommitId}](#{commit.LinkUrl}) - #{commit.Comment}
#{/each}
#{/each}
EOT

connectivity_policy {}

versioning_strategy {
template = "#{Octopus.Version.LastMajor}.#{Octopus.Version.LastMinor}.#{Octopus.Version.NextPatch}"
}
1 change: 1 addition & 0 deletions .octopus/schema_version.ocl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
version = 8
13 changes: 13 additions & 0 deletions .octopus/variables.ocl
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
variable "IsPreRelease" {
value "true" {
channel = ["pre-release"]
}

value "false" {
channel = ["release"]
}
}

variable "jbPackageId" {
value "17476" {}
}

0 comments on commit fe787a6

Please sign in to comment.