-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
62 lines (57 loc) · 1.68 KB
/
action.yml
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
name: 'Create ArgoCD application'
description: 'Create ArgoCD Application using cli'
inputs:
name:
required: false
description: 'Application name'
selector:
required: false
description: 'Label selector'
token:
description: 'ArgoCD access token'
required: true
server:
required: true
description: 'ArgoCD server'
default: argocd.dev.us-east-1.cond
appNamespace:
required: true
description: 'Application namespace'
default: argocd
params:
required: false
description: "Additional cli params"
default: ""
runs:
using: "composite"
steps:
- name: Install ArgoCD cli
shell: bash
run: |
if [ -z $(which argocd || true) ]; then
mkdir -p /home/runner/.local/bin/
curl -o /home/runner/.local/bin/argocd https://artifactory.infra.us-east-1.conductor.sh/artifactory/thirdparty/argocd/v2.11.3/argocd-linux-amd64
chmod +x /home/runner/.local/bin/argocd
fi
- name: Delete Application
shell: bash
if: ${{ inputs.selector != '' }}
run: |
echo "Delete application:"
argocd app delete -y -l ${{ inputs.selector }} ${{ inputs.params }} \
--auth-token '${{ inputs.token }}' \
--server ${{ inputs.server }} \
--insecure \
--grpc-web \
--app-namespace ${{ inputs.appNamespace }}
- name: Delete Application
shell: bash
if: ${{ inputs.name != '' }}
run: |
echo "Delete application:"
argocd app delete -y ${{ inputs.name }} ${{ inputs.params }} \
--auth-token '${{ inputs.token }}' \
--server ${{ inputs.server }} \
--insecure \
--grpc-web \
--app-namespace ${{ inputs.appNamespace }}