-
Notifications
You must be signed in to change notification settings - Fork 506
Expand file tree
/
Copy pathargo-argocd-app-set-with-package.json
More file actions
99 lines (99 loc) · 5.68 KB
/
argo-argocd-app-set-with-package.json
File metadata and controls
99 lines (99 loc) · 5.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
{
"Id": "8bcfe67d-cade-4fe3-a792-ce799dfb9ec1",
"Name": "Argo - argocd app set (with package)",
"Description": "Set application parameters using the [argocd app set](https://argo-cd.readthedocs.io/en/stable/user-guide/commands/argocd_app_set/) CLI command.\n\n**Pre-requisites:**\n- Access to the `argocd` CLI on the target or worker.\n- Selection of a package (for use with setting image parameters)\n\n---\n\n_Note:_ This step **used to only** run against an Octopus kubernetes deployment target. It is now based on the *Run a script step* type. You may need to delete and re-add the step in your consuming process for the change to take effect.",
"ActionType": "Octopus.Script",
"Version": 2,
"CommunityActionTemplateId": null,
"Packages": [
{
"Id": "9f2ad876-ad42-428d-bda9-676c6aaa0b60",
"Name": "ArgoCD.AppSet.ContainerImage",
"PackageId": null,
"FeedId": null,
"AcquisitionLocation": "NotAcquired",
"Properties": {
"Extract": "True",
"SelectionMode": "deferred",
"PackageParameterName": "ArgoCD.AppSet.ContainerImage",
"Purpose": ""
}
}
],
"GitDependencies": [],
"Properties": {
"Octopus.Action.Script.ScriptSource": "Inline",
"Octopus.Action.Script.Syntax": "Bash",
"Octopus.Action.Script.ScriptBody": "# argocd is required\nif ! [ -x \"$(command -v argocd)\" ]; then\n\tfail_step 'argocd command not found'\nfi\n\n# Helper functions\nisSet() { [ ! -z \"${1}\" ]; }\nisNotSet() { [ -z \"${1}\" ]; }\n\n# Get variables\nargocd_server=$(get_octopusvariable \"ArgoCD.AppSet.ArgoCD_Server\")\nargocd_authToken=$(get_octopusvariable \"ArgoCD.AppSet.ArgoCD_Auth_Token\")\napplicationName=$(get_octopusvariable \"ArgoCD.AppSet.ApplicationName\")\napplicationParameters=$(get_octopusvariable \"ArgoCD.AppSet.AppParameters\")\nadditionalParameters=$(get_octopusvariable \"ArgoCD.AppSet.AdditionalParameters\")\n\n# Check required variables\nif isNotSet \"${argocd_server}\"; then\n fail_step \"argocd_server is not set\"\nfi\n\nif isNotSet \"${argocd_authToken}\"; then\n fail_step \"argocd_authToken is not set\"\nfi\n\nif isNotSet \"${applicationName}\"; then\n fail_step \"applicationName is not set\"\nfi\n\nif isSet \"${applicationParameters}\"; then\n parameters=\"${applicationParameters//$'\\n'/ \\\\$'\\n'}\"\n flattenedParams=\"${applicationParameters//$'\\n'/ }\"\n IFS=$'\\n' read -rd '' -a appParameters <<< \"$applicationParameters\"\nelse\n appParameters=()\nfi\nflattenedParams=\"${appParameters[@]}\"\n\n\nif isSet \"${additionalParameters}\"; then\n IFS=$'\\n' read -rd '' -a additionalArgs <<< \"$additionalParameters\"\nelse\n additionalArgs=()\nfi\n\nflattenedArgs=\"${additionalArgs[@]}\"\n\nwrite_verbose \"ARGOCD_SERVER: '${argocd_server}'\"\nwrite_verbose \"ARGOCD_AUTH_TOKEN: '********'\"\n\nauthArgs=\"--server ${argocd_server} --auth-token ${argocd_authToken}\"\nmaskedAuthArgs=\"--server ${argocd_server} --auth-token '********'\"\n\necho \"Executing: argocd app set ${applicationName} ${maskedAuthArgs} ${flattenedArgs} \\\\ \n${parameters}\"\nargocd app set ${applicationName} ${authArgs} ${flattenedArgs} ${flattenedParams}"
},
"Parameters": [
{
"Id": "0a5f6eea-c876-4db2-a4ab-ea5b5d35fddb",
"Name": "ArgoCD.AppSet.ArgoCD_Server",
"Label": "ArgoCD Server",
"HelpText": "Enter the name of the ArgoCD Server to connect to. This sets the `--server` parameter used with the CLI.",
"DefaultValue": "",
"DisplaySettings": {
"Octopus.ControlType": "SingleLineText"
}
},
{
"Id": "4c034426-cf1d-4e9a-a69c-4de4aa6cde31",
"Name": "ArgoCD.AppSet.ArgoCD_Auth_Token",
"Label": "ArgoCD Auth Token",
"HelpText": "Enter the name of the ArgoCD Auth Token used to authenticate with. This sets the `--auth-token` parameter used with the CLI.",
"DefaultValue": "",
"DisplaySettings": {
"Octopus.ControlType": "Sensitive"
}
},
{
"Id": "e738d659-aca8-4fc4-a021-36d57ec71325",
"Name": "ArgoCD.AppSet.ApplicationName",
"Label": "ArgoCD Application Name",
"HelpText": "Enter the ArgoCD application name",
"DefaultValue": "",
"DisplaySettings": {
"Octopus.ControlType": "SingleLineText"
}
},
{
"Id": "b2054ad2-3c41-47bb-ac96-d5d8a6564ea6",
"Name": "ArgoCD.AppSet.ContainerImage",
"Label": "Container image",
"HelpText": "Provide the container image details",
"DefaultValue": "",
"DisplaySettings": {
"Octopus.ControlType": "Package"
}
},
{
"Id": "2adb0917-6b2d-4528-90a4-beff6a01109d",
"Name": "ArgoCD.AppSet.AppParameters",
"Label": "Application Parameters",
"HelpText": "Enter the parameters to set for the application, including the `--parameter` or `-p`. e.g.:\n- `-p key1=value1`\n- `--parameter key2=value2`\n\n**Note:** Multiple parameters can be supplied by entering each one on a new line.",
"DefaultValue": "",
"DisplaySettings": {
"Octopus.ControlType": "MultiLineText"
}
},
{
"Id": "b13a3a5e-ac79-477d-bd51-cf6efd009bd4",
"Name": "ArgoCD.AppSet.AdditionalParameters",
"Label": "Additional Parameters (optional)",
"HelpText": "Enter additional parameter values(s) to be used when calling the `argocd` CLI.\n\n**Note:** Multiple parameters can be supplied by entering each one on a new line.",
"DefaultValue": "",
"DisplaySettings": {
"Octopus.ControlType": "MultiLineText"
}
}
],
"StepPackageId": "Octopus.KubernetesRunScript",
"$Meta": {
"ExportedAt": "2025-11-06T15:44:22.814Z",
"OctopusVersion": "2025.4.6776",
"Type": "ActionTemplate"
},
"LastModifiedBy": "harrisonmeister",
"Category": "argo"
}