|
| 1 | +{ |
| 2 | + "Id": "8bcfe67d-cade-4fe3-a792-ce799dfb9ec1", |
| 3 | + "Name": "Argo - argocd app set (with package)", |
| 4 | + "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_Note:_ This step will only run against an Octopus [kubernetes](https://octopus.com/docs/infrastructure/deployment-targets/kubernetes) deployment target.\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)", |
| 5 | + "ActionType": "Octopus.KubernetesRunScript", |
| 6 | + "Version": 1, |
| 7 | + "CommunityActionTemplateId": null, |
| 8 | + "Packages": [ |
| 9 | + { |
| 10 | + "Id": "9f2ad876-ad42-428d-bda9-676c6aaa0b60", |
| 11 | + "Name": "ArgoCD.AppSet.ContainerImage", |
| 12 | + "PackageId": null, |
| 13 | + "FeedId": null, |
| 14 | + "AcquisitionLocation": "NotAcquired", |
| 15 | + "Properties": { |
| 16 | + "Extract": "True", |
| 17 | + "SelectionMode": "deferred", |
| 18 | + "PackageParameterName": "ArgoCD.AppSet.ContainerImage", |
| 19 | + "Purpose": "" |
| 20 | + } |
| 21 | + } |
| 22 | + ], |
| 23 | + "GitDependencies": [], |
| 24 | + "Properties": { |
| 25 | + "Octopus.Action.Script.ScriptSource": "Inline", |
| 26 | + "Octopus.Action.Script.Syntax": "Bash", |
| 27 | + "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}" |
| 28 | + }, |
| 29 | + "Parameters": [ |
| 30 | + { |
| 31 | + "Id": "0a5f6eea-c876-4db2-a4ab-ea5b5d35fddb", |
| 32 | + "Name": "ArgoCD.AppSet.ArgoCD_Server", |
| 33 | + "Label": "ArgoCD Server", |
| 34 | + "HelpText": "Enter the name of the ArgoCD Server to connect to. This sets the `--server` parameter used with the CLI.", |
| 35 | + "DefaultValue": "", |
| 36 | + "DisplaySettings": { |
| 37 | + "Octopus.ControlType": "SingleLineText" |
| 38 | + } |
| 39 | + }, |
| 40 | + { |
| 41 | + "Id": "4c034426-cf1d-4e9a-a69c-4de4aa6cde31", |
| 42 | + "Name": "ArgoCD.AppSet.ArgoCD_Auth_Token", |
| 43 | + "Label": "ArgoCD Auth Token", |
| 44 | + "HelpText": "Enter the name of the ArgoCD Auth Token used to authenticate with. This sets the `--auth-token` parameter used with the CLI.", |
| 45 | + "DefaultValue": "", |
| 46 | + "DisplaySettings": { |
| 47 | + "Octopus.ControlType": "Sensitive" |
| 48 | + } |
| 49 | + }, |
| 50 | + { |
| 51 | + "Id": "e738d659-aca8-4fc4-a021-36d57ec71325", |
| 52 | + "Name": "ArgoCD.AppSet.ApplicationName", |
| 53 | + "Label": "ArgoCD Application Name", |
| 54 | + "HelpText": "Enter the ArgoCD application name", |
| 55 | + "DefaultValue": "", |
| 56 | + "DisplaySettings": { |
| 57 | + "Octopus.ControlType": "SingleLineText" |
| 58 | + } |
| 59 | + }, |
| 60 | + { |
| 61 | + "Id": "b2054ad2-3c41-47bb-ac96-d5d8a6564ea6", |
| 62 | + "Name": "ArgoCD.AppSet.ContainerImage", |
| 63 | + "Label": "Container image", |
| 64 | + "HelpText": "Provide the container image details", |
| 65 | + "DefaultValue": "", |
| 66 | + "DisplaySettings": { |
| 67 | + "Octopus.ControlType": "Package" |
| 68 | + } |
| 69 | + }, |
| 70 | + { |
| 71 | + "Id": "2adb0917-6b2d-4528-90a4-beff6a01109d", |
| 72 | + "Name": "ArgoCD.AppSet.AppParameters", |
| 73 | + "Label": "Application Parameters", |
| 74 | + "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.", |
| 75 | + "DefaultValue": "", |
| 76 | + "DisplaySettings": { |
| 77 | + "Octopus.ControlType": "MultiLineText" |
| 78 | + } |
| 79 | + }, |
| 80 | + { |
| 81 | + "Id": "b13a3a5e-ac79-477d-bd51-cf6efd009bd4", |
| 82 | + "Name": "ArgoCD.AppSet.AdditionalParameters", |
| 83 | + "Label": "Additional Parameters (optional)", |
| 84 | + "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.", |
| 85 | + "DefaultValue": "", |
| 86 | + "DisplaySettings": { |
| 87 | + "Octopus.ControlType": "MultiLineText" |
| 88 | + } |
| 89 | + } |
| 90 | + ], |
| 91 | + "StepPackageId": "Octopus.KubernetesRunScript", |
| 92 | + "$Meta": { |
| 93 | + "ExportedAt": "2024-07-22T09:55:12.863Z", |
| 94 | + "OctopusVersion": "2024.3.7046", |
| 95 | + "Type": "ActionTemplate" |
| 96 | + }, |
| 97 | + "LastModifiedBy": "harrisonmeister", |
| 98 | + "Category": "argo" |
| 99 | +} |
0 commit comments