@@ -11,7 +11,7 @@ function ess_up {
1111 return 1
1212 }
1313
14- oblt- cli cluster create custom `
14+ & oblt- cli cluster create custom `
1515 -- template ess- ea- it `
1616 -- cluster- name- prefix ea- hosted- it `
1717 -- parameters= " {\" GitOps\" :\" true\" ,\" GitHubRepository\" :\" $Env: BUILDKITE_REPO \" ,\" GitHubCommit\" :\" $Env: BUILDKITE_COMMIT \" ,\" EphemeralCluster\" :\" true\" ,\" StackVersion\" :\" $StackVersion \" }" `
@@ -27,7 +27,23 @@ function ess_up {
2727 # Store the cluster name as a meta-data
2828 & buildkite- agent meta- data set cluster- name $ClusterName
2929
30- # Load the ESS stack secrets
30+ ess_load_secrets
31+ }
32+
33+ function ess_down {
34+ Write-Output " ~~~ Tearing down the ESS Stack(created for this step)"
35+ try {
36+ $ClusterName = & buildkite- agent meta- data get cluster- name
37+ & oblt- cli cluster destroy -- cluster- name " $ClusterName " -- force
38+ } catch {
39+ Write-Output " Error: Failed to destroy ESS stack(it will be auto-deleted later): $_ "
40+ }
41+ }
42+
43+ function ess_load_secrets () {
44+ $ClusterName = & buildkite- agent meta- data get cluster- name
45+
46+ # Load the ESS stack secrets
3147 # QUESTION: should we support the case when using the ESS stack in local environment?
3248 & oblt- cli cluster secrets env -- cluster- name $ClusterName -- output- file= " secrets.env"
3349
@@ -54,16 +70,6 @@ function ess_up {
5470 }
5571}
5672
57- function ess_down {
58- Write-Output " ~~~ Tearing down the ESS Stack(created for this step)"
59- try {
60- $ClusterName = & buildkite- agent meta- data get cluster- name
61- & oblt- cli cluster destroy -- cluster- name " $ClusterName " -- force
62- } catch {
63- Write-Output " Error: Failed to destroy ESS stack(it will be auto-deleted later): $_ "
64- }
65- }
66-
6773function Retry-Command {
6874 param (
6975 [scriptblock ]$ScriptBlock ,
0 commit comments