-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #273 from OctopusDeploy/edlyn/cac-convert-to-octopus
Initial setup CaC for OpenTelemetryPlugin
- Loading branch information
Showing
4 changed files
with
100 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
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" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
version = 8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" {} | ||
} |