Skip to content

Commit

Permalink
Fixed commends - Better naming convention
Browse files Browse the repository at this point in the history
  • Loading branch information
dkirchan committed Feb 5, 2024
1 parent 9ed98e1 commit 9f4d0a5
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .buildkite/pipelines/security_solution/api_integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ steps:
- exit_status: "-1"
limit: 3

- command: .buildkite/scripts/pipelines/security_solution_quality_gate/upload_runtime_info.sh
- command: .buildkite/scripts/pipelines/security_solution_quality_gate/upload_image_metadata.sh
label: "Upload runtime info"
key: upload_runtime_info
depends_on: build_image
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ steps:
- exit_status: "-1"
limit: 3

- command: .buildkite/scripts/pipelines/security_solution_quality_gate/upload_runtime_info.sh
- command: .buildkite/scripts/pipelines/security_solution_quality_gate/upload_image_metadata.sh
label: "Upload runtime info"
key: upload_runtime_info
depends_on: build_image
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ QA_API_KEY=$(vault_get security-solution-quality-gate qa_api_key)

# Generate a random 5-digit number
random_number=$((10000 + $RANDOM % 90000))
if [ -z "${KIBANA_CURRENT+x}" ] || [ "$KIBANA_CURRENT" = "0" ]; then
if [ -z "${KIBANA_MKI_USE_LATEST_COMMIT+x}" ] || [ "$KIBANA_MKI_USE_LATEST_COMMIT" = "0" ]; then
ENVIRONMENT_DETAILS=$(curl --location 'https://global.qa.cld.elstc.co/api/v1/serverless/projects/security' \
--header "Authorization: ApiKey $QA_API_KEY" \
--header 'Content-Type: application/json' \
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
if [ -z "${KIBANA_CURRENT+x}" ] || [ "$KIBANA_CURRENT" = "0" ]; then
if [ -z "${KIBANA_MKI_USE_LATEST_COMMIT+x}" ] || [ "$KIBANA_MKI_USE_LATEST_COMMIT" = "0" ]; then
echo "As we not testing against latest kibana image, this step is exiting with exit code 0"
exit 0
fi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,10 @@ buildkite-agent meta-data set "${BUILDKITE_JOB_ID}_is_test_execution_step" "true
mkdir .ftr
vault_get security-quality-gate/role-users data -format=json > .ftr/role_users.json

file_path=".ftr/role_users.json"

if [ -e "$file_path" ]; then
echo "File exists!"
else
echo "File does not exist."
fi

cd x-pack/test/security_solution_cypress
set +e

if [ -z "${KIBANA_CURRENT+x}" ] || [ "$KIBANA_CURRENT" = "0" ]; then
if [ -z "${KIBANA_MKI_USE_LATEST_COMMIT+x}" ] || [ "$KIBANA_MKI_USE_LATEST_COMMIT" = "0" ]; then
KIBANA_OVERRIDE_FLAG=0
else
KIBANA_OVERRIDE_FLAG=1
Expand All @@ -39,4 +31,4 @@ fi
QA_API_KEY=$(vault_get security-solution-quality-gate qa_api_key)
BK_ANALYTICS_API_KEY=$(vault_get security-solution-quality-gate serverless-sec-sol-cypress-bk-api-key)

OVERRIDE_KIBANA=$KIBANA_OVERRIDE_FLAG BK_ANALYTICS_API_KEY=$BK_ANALYTICS_API_KEY CLOUD_QA_API_KEY=$QA_API_KEY yarn $1; status=$?; yarn junit:merge || :; exit $status
KIBANA_MKI_USE_LATEST_COMMIT=$KIBANA_OVERRIDE_FLAG BK_ANALYTICS_API_KEY=$BK_ANALYTICS_API_KEY CLOUD_QA_API_KEY=$QA_API_KEY yarn $1; status=$?; yarn junit:merge || :; exit $status
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ KIBANA_BASE_IMAGE="docker.elastic.co/kibana-ci/kibana-serverless"
KIBANA_CURRENT_COMMIT=${KIBANA_BASE_IMAGE}:sec-sol-qg-${BUILDKITE_COMMIT:0:12}
KIBANA_LATEST=${KIBANA_BASE_IMAGE}:latest

if [ "$KIBANA_CURRENT" = "1" ]; then
if [ "$KIBANA_MKI_USE_LATEST_COMMIT" = "1" ]; then
KBN_IMAGE=${KIBANA_CURRENT_COMMIT}
else
KBN_IMAGE=${KIBANA_LATEST}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ async function createSecurityProject(
product_types: productTypes,
};

log.info(`Kibana override flag equals to ${process.env.OVERRIDE_KIBANA}!`);
if (process.env.OVERRIDE_KIBANA && process.env.OVERRIDE_KIBANA === '1') {
log.info(`Kibana override flag equals to ${process.env.KIBANA_MKI_USE_LATEST_COMMIT}!`);
if (process.env.KIBANA_MKI_USE_LATEST_COMMIT && process.env.KIBANA_MKI_USE_LATEST_COMMIT === '1') {
const kibanaOverrideImage = `${process.env.BUILDKITE_COMMIT?.substring(0, 12)}`;
log.info(
`Overriding Kibana image in the MKI with docker.elastic.co/kibana-ci/kibana-serverless:sec-sol-qg-${kibanaOverrideImage}`
Expand Down

0 comments on commit 9f4d0a5

Please sign in to comment.