|
62 | 62 | echo |
63 | 63 | rm -rf "$manifest_path" |
64 | 64 | mkdir -p "$manifest_path" |
65 | | - ln -sf "${manifestsWithGitRevision target}" "$manifest_path" |
| 65 | + ln -s "${manifestsWithGitRevision target}"/* "$manifest_path" |
66 | 66 | echo |
67 | 67 | echo "Manifests built in: $manifest_path" |
68 | 68 | } |
|
77 | 77 | ${render} |
78 | 78 | render |
79 | 79 | '' {}) |
80 | | - (mkCommand currentSystem "apply" "Apply the manifests to K8s" [pkgs.kubectl pkgs.jq] '' |
| 80 | + (mkCommand currentSystem "diff" "Diff the manifests against the cluster" [pkgs.kubectl] '' |
81 | 81 | ${render} |
82 | 82 | render |
83 | 83 |
|
84 | 84 | diff() { |
85 | | - if ! [[ -v CI ]]; then |
86 | | - kubectl diff --server-side=true --field-manager="std-action-in-ci" \ |
87 | | - --filename "$manifest_path" --recursive; |
88 | | - else |
89 | | - kubectl diff --server-side=true --field-manager="std-action-$(whoami)" \ |
90 | | - --filename "$manifest_path" --recursive; |
91 | | - fi |
| 85 | + kubectl diff --server-side=true --field-manager="std-action-$(whoami)" \ |
| 86 | + --filename "$manifest_path" --recursive; |
| 87 | + } |
| 88 | +
|
| 89 | + diff |
| 90 | + '' {}) |
| 91 | + (mkCommand currentSystem "apply" "Apply the manifests to K8s" [pkgs.kubectl] '' |
| 92 | + ${render} |
| 93 | + render |
| 94 | +
|
| 95 | + diff() { |
| 96 | + kubectl diff --server-side=true --field-manager="std-action-$(whoami)" \ |
| 97 | + --filename "$manifest_path" --recursive; |
92 | 98 | } |
93 | 99 |
|
94 | 100 | run() { |
95 | | - if ! [[ -v CI ]]; then |
96 | | - kubectl apply --server-side=true --field-manager="std-action-in-ci" \ |
97 | | - --filename "$manifest_path" --recursive; |
98 | | - else |
99 | | - kubectl apply --server-side=true --field-manager="std-action-$(whoami)" \ |
100 | | - --filename "$manifest_path" --recursive; |
101 | | - fi |
| 101 | + kubectl apply --server-side=true --field-manager="std-action-$(whoami)" \ |
| 102 | + --filename "$manifest_path" --recursive; |
102 | 103 | } |
103 | 104 |
|
104 | | - if diff; then |
105 | | - ${askUserToProceedSnippet "apply" "run"} |
106 | | - else |
107 | | - echo "Deployment hasn't changed since last deployment, nothing to deploy" |
108 | | - fi |
| 105 | + diff |
| 106 | + ${askUserToProceedSnippet "apply" "run"} |
109 | 107 | '' {}) |
110 | 108 | (mkCommand currentSystem "explore" "Interactively explore the manifests" [pkgs.fx] '' |
111 | 109 | fx ${ |
|
0 commit comments