-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathargocd.yaml
97 lines (89 loc) · 2.53 KB
/
argocd.yaml
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
version: '3'
vars:
CYAN: tput setaf 6
RED: tput setaf 1
YELLOW: tput setaf 3
GREEN: tput setaf 2
BLUE: tput setaf 1
PURPLE: tput setaf 5
BG_B: tput setab 0
BOLD: tput bold
RESET: tput sgr0
CLEAR: tput reset
INT_REGISTRY: registry.localhost
PATH_ERROR: is not installed or correctly configured in PATH.
silent: true
tasks:
secret:
vars:
GIT_URI:
sh: git config --get remote.origin.url | sed -e 's/:/\//g'| sed -e 's/ssh\/\/\///g'| sed -e 's/git@/https:\/\//g' | sed 's/.git$//'
cmds:
- rm test/repo-creds.yaml
- |
cat << EOF > test/repo-creds.yaml
apiVersion: v1
kind: Secret
metadata:
name: private-repo-creds
labels:
argocd.argoproj.io/secret-type: repo-creds
stringData:
type: git
url: {{.GIT_URI}}
password: $GH_PASS
username: $GH_USER
EOF
- kubectl apply -f test/repo-creds.yaml -n argocd
- rm test/repo-creds.yaml
ignore_error: true
repo:
vars:
GIT_URI:
sh: git config --get remote.origin.url | sed -e 's/:/\//g'| sed -e 's/ssh\/\/\///g'| sed -e 's/git@/https:\/\//g' | sed 's/.git$//'
cmds:
- rm test/repo.yaml
- |
cat << EOF > test/repo.yaml
apiVersion: v1
kind: Secret
metadata:
name: main-repository
namespace: argocd
labels:
argocd.argoproj.io/secret-type: repository
stringData:
type: git
url: {{.GIT_URI}}
password: $GH_PASS
username: $GH_USER
EOF
- kubectl apply -f test/repo.yaml
- rm test/repo.yaml
ignore_error: true
install:
desc: Installs ArgoCD resources manually on the local cluster
dir: apps/argocd
preconditions:
- sh: 'which kustomize'
msg: 'kustomize {{.PATH_ERROR}}'
- sh: 'which kubectl'
msg: 'kubectl {{.PATH_ERROR}}'
cmds:
- kubectl create namespace argocd
- kustomize build | kubectl apply -f -
- sleep 10
- kustomize build | kubectl apply -f -
- kubectl wait deploy/argocd-server -n argocd --for condition=available --timeout=600s
- echo ""
ignore_error: true
rm:
dir: apps/argocd
cmds:
- kustomize build | kubectl delete -f -
ignore_error: true
bridge: kubectl port-forward -n argocd svc/argocd-server 8832:80
password:
cmds:
- kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d; echo
ignore_error: true