-
Notifications
You must be signed in to change notification settings - Fork 506
Expand file tree
/
Copy pathargo-argocd-app-get.json
More file actions
65 lines (65 loc) · 4.05 KB
/
argo-argocd-app-get.json
File metadata and controls
65 lines (65 loc) · 4.05 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
{
"Id": "f67404e4-3394-4f8d-9739-74a04c99a6f1",
"Name": "Argo - argocd app get",
"Description": "Get an Argo Application details using the [argocd app get](https://argo-cd.readthedocs.io/en/stable/user-guide/commands/argocd_app_get/) CLI command\n\n**Pre-requisites:**\n- Access to the `argocd` CLI on the target or worker.\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": [],
"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.AppGet.ArgoCD_Server\")\nargocd_authToken=$(get_octopusvariable \"ArgoCD.AppGet.ArgoCD_Auth_Token\")\napplicationName=$(get_octopusvariable \"ArgoCD.AppGet.ApplicationName\")\nadditionalParameters=$(get_octopusvariable \"ArgoCD.AppGet.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 \"${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 get ${applicationName} ${maskedAuthArgs} ${flattenedArgs}\"\nargocd app get ${applicationName} ${authArgs} ${flattenedArgs}"
},
"Parameters": [
{
"Id": "0a5f6eea-c876-4db2-a4ab-ea5b5d35fddb",
"Name": "ArgoCD.AppGet.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.AppGet.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.AppGet.ApplicationName",
"Label": "ArgoCD Application Name",
"HelpText": "Enter the name of the application you want to retrieve details for.",
"DefaultValue": "",
"DisplaySettings": {
"Octopus.ControlType": "SingleLineText"
}
},
{
"Id": "566e77a0-fb80-4c3f-b2ef-cffaa2a2d797",
"Name": "ArgoCD.AppGet.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"
}