Skip to content

Commit 861005b

Browse files
committed
simplify
1 parent 13f2451 commit 861005b

File tree

2 files changed

+18
-14
lines changed

2 files changed

+18
-14
lines changed

.buildkite/scripts/steps/ess.ps1

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -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-
6773
function Retry-Command {
6874
param (
6975
[scriptblock]$ScriptBlock,

.buildkite/scripts/steps/integration_tests_tf.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ if [[ "${BUILDKITE_RETRY_COUNT}" -gt 0 ]]; then
3838
ess_up $OVERRIDE_STACK_VERSION || (echo -e "^^^ +++\nFailed to start ESS stack")
3939
fi
4040

41-
ess_load_secrets
42-
4341
# Run integration tests
4442
echo "~~~ Running integration tests"
4543

0 commit comments

Comments
 (0)