Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding junit output support for test-content command #29906

Merged
merged 153 commits into from Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
153 commits
Select commit Hold shift + click to select a range
9ef45be
fixing git clone retry mechanism to allow retries.
Aug 17, 2023
03b6033
fixing git clone retry mechanism to allow retries.
Aug 19, 2023
4e1e2b7
fixing git clone retry mechanism to allow retries.
Aug 19, 2023
a07d82f
fixing git clone retry mechanism to allow retries.
Aug 20, 2023
8d8c770
fixing lint
Aug 20, 2023
768b8a8
gitlab ci adding more logs and sections to build step to debug the st…
Aug 22, 2023
574a999
reverting the AlibabaModelingRules_1_3_testdata.json
Aug 23, 2023
b015591
test content - creating junit file. artifacts path
Sep 27, 2023
e017207
test content - creating junit file. artifacts path
Sep 27, 2023
2b9717a
test content - creating junit file. artifacts path
Sep 27, 2023
0b5f5ac
test content - creating junit file. artifacts path
Sep 27, 2023
aad153a
test content - creating junit file. artifacts path
Sep 27, 2023
af4feea
test content - creating junit file. artifacts path concat fix
Sep 27, 2023
d69f583
Merge branch 'master' into test-playbooks-junit
kobymeir Sep 27, 2023
07dd2bf
test content - creating junit file. sdk ref
Sep 27, 2023
24cc577
test content - creating junit file. assignment
Sep 27, 2023
c196fca
test content - creating junit file. artifacts path -take 2
Sep 28, 2023
224a584
test content - creating junit file. fix print
Sep 28, 2023
fc85b0c
test content - creating junit file. fix instance role
Sep 28, 2023
222405e
test content - creating junit file. convert_test_playbook_result_to_j…
Sep 28, 2023
103588f
test content - creating junit file. artifacts path -take 4
Sep 28, 2023
d72d929
test content - creating junit file. artifacts path -take 5
Sep 28, 2023
6664c66
test content - creating junit file. adding build trigger
Sep 28, 2023
683d93c
test content - creating junit file. fix empty results files
Sep 28, 2023
cf8308e
test content - creating junit file. fix infinite loop
Sep 28, 2023
89b10ac
Merge branch 'master' into test-playbooks-junit
kobymeir Sep 28, 2023
c7a3369
test content - creating junit file. restoring the print summary
Sep 28, 2023
80af4a2
test content - creating junit file. sdk backward compatible
Sep 28, 2023
5274743
Merge branch 'master' into test-playbooks-junit
kobymeir Sep 29, 2023
625d382
test content - creating junit file. print summary table
Sep 29, 2023
9845afb
test content - creating junit file. print summary table
Sep 29, 2023
f4178eb
test content - creating junit file. print summary table
Sep 29, 2023
1dfcdd6
test content - creating junit file. print summary table, adding total
Sep 30, 2023
a148773
test content - creating junit file. download logs path
Sep 30, 2023
df70541
test content - creating junit file. fixing infinite loop :/
Sep 30, 2023
2333df9
test content - creating junit file. fixing files search
Sep 30, 2023
7c66d8a
test content - creating junit file. exclude artifacts directory
Sep 30, 2023
57ce569
test content - creating junit file. exclude artifacts directory
Sep 30, 2023
dd4357e
test content - creating junit file. exclude artifacts directory
Sep 30, 2023
51a0adf
test content - creating junit file. tqdm
Sep 30, 2023
c4932f8
Merge branch 'master' into test-playbooks-junit
kobymeir Oct 1, 2023
7a1c054
test content - creating junit file. jira ticket retry. failure & erro…
Oct 2, 2023
a7d0922
test content - creating junit file. jira ticket retry. failure & erro…
Oct 2, 2023
c753e6f
test content - creating junit file. jira ticket retry. failure & erro…
Oct 2, 2023
0b0ec94
test content - creating junit file. jira server info
Oct 2, 2023
f92af42
Merge branch 'master' into test-playbooks-junit
kobymeir Oct 3, 2023
2cfa195
test content - creating junit file. jira server info
Oct 3, 2023
e1ebfaf
Merge branch 'master' into test-playbooks-junit
kobymeir Oct 3, 2023
b4a31fc
test content - creating junit file. jira server info
Oct 3, 2023
2a80e7f
Merge branch 'master' into test-playbooks-junit
kobymeir Oct 3, 2023
216e3d4
Merge branch 'master' into test-playbooks-junit
kobymeir Oct 4, 2023
f809c44
test content - creating junit file. jira server info
Oct 4, 2023
0ac4df6
test content - creating junit file. jira server info
Oct 4, 2023
daaa652
test content - creating junit file. gcloud auth
Oct 4, 2023
8d4208b
test content - creating junit file. without jira columns when adding …
Oct 4, 2023
325cc23
test content - creating junit file. disable jira tickets print, until…
Oct 4, 2023
efe751b
test content - creating junit file. fix XSOAR NG testing
Oct 4, 2023
82fdb99
test content - creating junit file. fix XSOAR NG testing
Oct 4, 2023
0efdc54
test content - creating junit file. fix XSOAR NG testing
Oct 4, 2023
d748ced
test content - creating junit file. fix headers offset
Oct 4, 2023
816c529
Merge branch 'master' into test-playbooks-junit
kobymeir Oct 4, 2023
95a02da
test content - creating junit file. fix build type
Oct 4, 2023
b6680d3
Merge branch 'master' into test-playbooks-junit
kobymeir Oct 4, 2023
48e3deb
test content - creating junit file. fix build type
Oct 4, 2023
479cd14
test content - creating junit file. fix build type
Oct 4, 2023
743b223
test content - creating junit file. fix build type
Oct 4, 2023
d182041
Merge branch 'master' into test-playbooks-junit
kobymeir Oct 4, 2023
d8f16a2
test content - creating junit file. fix headers summary
Oct 4, 2023
6e28a07
Merge branch 'master' into test-playbooks-junit
kobymeir Oct 4, 2023
a63ea7c
Merge branch 'master' into test-playbooks-junit
kobymeir Oct 5, 2023
51c7637
test content - creating junit file. fix skipped playbooks
Oct 5, 2023
73d493a
test content - creating junit file. lock file
Oct 5, 2023
1ccbebb
test content - creating junit file. lock file
Oct 5, 2023
018e732
test content - creating junit file. server version
Oct 5, 2023
80c7570
test content - creating junit file. fix build artifacts log path
Oct 5, 2023
2afe06d
test content - creating junit file. fix junit artifacts path
Oct 5, 2023
08a896f
test content - creating junit file. fix artifact instance path
Oct 5, 2023
be5d835
test content - creating junit file. fix cloud_api_keys.json path
Oct 5, 2023
659ce4e
Merge branch 'master' into test-playbooks-junit
kobymeir Oct 5, 2023
0f65bf8
test content - creating junit file. fix jira-hq-gcp.paloaltonetworks.…
Oct 8, 2023
47892c5
test content - creating junit file. fix jira-hq-gcp.paloaltonetworks.…
Oct 8, 2023
1529b0f
test content - creating junit file. fix jira-hq-gcp.paloaltonetworks.…
Oct 8, 2023
d4337e5
test content - creating junit file. condense the table, filter the pl…
Oct 11, 2023
f6cd891
test content - creating junit file. condense the table, filter the pl…
Oct 11, 2023
110fb82
Merge branch 'master' into test-playbooks-junit
kobymeir Oct 12, 2023
f0ac874
test content - creating junit file. slack
Oct 12, 2023
8d6eb78
test content - creating junit file. slack
Oct 12, 2023
fff36f0
test content - creating junit file. slack
Oct 13, 2023
b54b425
test content - creating junit file. slack .post
Oct 13, 2023
688fc71
test content - creating junit file. slack channel name
Oct 13, 2023
080e750
test content - creating junit file. slack channel name
Oct 13, 2023
a07e43a
test content - creating junit file. SERVER_TYPE: "XSOAR"
Oct 13, 2023
208973f
test content - creating junit file. SERVER_TYPE: "XSOAR"
Oct 13, 2023
4cc560a
test content - creating junit file. SERVER_TYPE: "XSOAR"
Oct 13, 2023
d2c5709
Merge branch 'master' into test-playbooks-junit
kobymeir Oct 13, 2023
4926122
test content - creating junit file. sdk ref
Oct 13, 2023
6fb8f40
test content - creating junit file. slack notify
Oct 13, 2023
bf198c4
test content - creating junit file. MARKETPLACE_NAME: "xsoar_saas"
Oct 13, 2023
75918c7
Merge branch 'master' into test-playbooks-junit
kobymeir Oct 13, 2023
8822fc5
test content - creating junit file. jobs check done
Oct 13, 2023
b8c626a
test content - creating junit file. jobs check done
Oct 13, 2023
385a829
test content - creating junit file. jobs check done
Oct 13, 2023
dd64695
test content - creating junit file. jobs check done
Oct 13, 2023
8cc7d06
test content - creating junit file. jobs check done
Oct 13, 2023
b572a29
test content - creating junit file. jobs check done & fan in
Oct 14, 2023
ef86efe
test content - creating junit file. fix slack notify
Oct 14, 2023
abd3ed6
test content - creating junit file. fix slack notify
Oct 15, 2023
137ff35
test content - creating junit file. fix slack notify
Oct 15, 2023
cedfbef
Merge branch 'master' into test-playbooks-junit
kobymeir Oct 15, 2023
9aa1fb5
test content - creating junit file. fix slack notify
Oct 15, 2023
ba8b076
Merge branch 'master' into test-playbooks-junit
kobymeir Oct 15, 2023
d80bb3b
Merge branch 'master' into test-playbooks-junit
kobymeir Oct 16, 2023
d460c05
Merge branch 'master' into test-playbooks-junit
kobymeir Oct 17, 2023
a5df5a1
test content - creating junit file. fix slack notify
Oct 18, 2023
3ef100a
test content - creating junit file. fix slack notify
Oct 18, 2023
04dd1d8
test content - creating junit file. fix slack notify
Oct 18, 2023
05d45d0
test content - creating junit file. artifacts folders path
Oct 18, 2023
35f6760
Apply suggestions from code review
kobymeir Oct 19, 2023
4fef720
Apply suggestions from code review
kobymeir Oct 19, 2023
8c998b5
Merge branch 'master' into test-playbooks-junit
kobymeir Oct 19, 2023
47b5a06
test content - creating junit file. artifacts folders path
Oct 19, 2023
046244e
test content - creating junit file. artifacts folders instance
Oct 19, 2023
34167d2
test content - creating junit file. artifacts folders instance, neste…
Oct 19, 2023
6a91e2e
test content - creating junit file. artifacts folders instance, neste…
Oct 19, 2023
cbd93d3
test content - creating junit file. artifacts folders instance, neste…
Oct 19, 2023
255d275
test content - creating junit file. artifacts folders instance, neste…
Oct 19, 2023
d8401ab
test content - creating junit file. artifacts folders instance, neste…
Oct 19, 2023
03ca4c4
test content - creating junit file. artifacts folders instance, neste…
Oct 19, 2023
01a4fc6
test content - print_test_modeling_rule_summary.py - take 1
Oct 21, 2023
3fde4eb
test content - print_test_modeling_rule_summary.py - take 1
Oct 22, 2023
5b816b9
test content - print_test_modeling_rule_summary.py - take 1
Oct 22, 2023
2545afe
test content - print_test_modeling_rule_summary.py - take 1
Oct 22, 2023
300b777
test content - print_test_modeling_rule_summary.py - take 2
Oct 22, 2023
6970503
test content - print_test_modeling_rule_summary.py - take 2
Oct 22, 2023
490bc14
Merge branch 'master' into test-playbooks-junit
kobymeir Oct 22, 2023
8957655
test content - print_test_modeling_rule_summary.py - take 3
Oct 22, 2023
8e32ee3
test content - print_test_modeling_rule_summary.py - take 4
Oct 22, 2023
52ce87d
test content - print_test_modeling_rule_summary.py - take 5
Oct 22, 2023
f15fa2f
test content - print_test_modeling_rule_summary.py - take 6
Oct 22, 2023
c4106be
test content - print_test_modeling_rule_summary.py - take 7
Oct 22, 2023
db22bf5
test content - print_test_modeling_rule_summary.py - take 8
Oct 23, 2023
c7778aa
test content - print_test_modeling_rule_summary.py - take 9
Oct 23, 2023
7935003
test content - print_test_modeling_rule_summary.py - take 10
Oct 23, 2023
d858148
test content - print_test_modeling_rule_summary.py - take 11
Oct 23, 2023
82f2936
test content - print_test_modeling_rule_summary.py - take 12
Oct 23, 2023
7656fc3
test content - take 13
Oct 24, 2023
89a9187
Merge branch 'master' into test-playbooks-junit
kobymeir Oct 24, 2023
d1d35b7
test content - take 14
Oct 25, 2023
65e8507
Merge branch 'master' into test-playbooks-junit
kobymeir Oct 25, 2023
6c7e450
test content - take 16
Oct 25, 2023
8719c61
test content - take 17
Oct 25, 2023
a858f8f
test content - take 18
Oct 25, 2023
8c46d34
Merge branch 'master' into test-playbooks-junit
kobymeir Oct 25, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -44,6 +44,7 @@ Packs/**/__init__.py
requirements.txt
**/collect_tests.log
temp/*
artifacts/*

# Environment and reports
.demisto-sdk-conf
Expand Down
77 changes: 50 additions & 27 deletions .gitlab/ci/.gitlab-ci.bucket-upload.yml
Expand Up @@ -44,7 +44,7 @@
- |
if [[ $TEST_UPLOAD == "false" ]]; then
section_start "Upload packs_dependencies.json to GCP" --collapsed
gcloud auth activate-service-account --key-file="$GCS_ARTIFACTS_KEY" > $ARTIFACTS_FOLDER/logs/gauth.out 2>$ARTIFACTS_FOLDER/logs/gauth.err
gcloud auth activate-service-account --key-file="$GCS_ARTIFACTS_KEY" >> "${ARTIFACTS_FOLDER}/logs/gcloud_auth.log" 2>&1
kobymeir marked this conversation as resolved.
Show resolved Hide resolved
gsutil cp $ARTIFACTS_FOLDER/packs_dependencies.json "gs://${TEST_XDR_PREFIX}xsoar-ci-artifacts/content-cache-docs/$MARKETPLACE_VERSION/packs_dependencies.json"
section_end "Upload packs_dependencies.json to GCP"
fi
Expand All @@ -69,6 +69,8 @@ jobs-done-check-upload-flow:
needs: ['run-unittests-and-lint-upload-flow', 'run-validations-upload-flow', 'mpv2-prepare-testing-bucket-upload-flow', 'upload-id-set-bucket', 'xpanse-prepare-testing-bucket-upload-flow', 'xsoar-prepare-testing-bucket-upload-flow', 'xsoar-saas-prepare-testing-bucket-upload-flow', 'install-packs-in-server6_9', 'install-packs-in-server6_10', 'install-packs-in-server6_11', 'install-packs-in-server6_12', 'install-packs-in-server-master', 'install-packs-in-xsiam-ga', 'sync-buckets-between-projects', 'upload-packs-to-marketplace', 'upload-packs-to-marketplace-v2', 'upload-packs-to-xpanse-marketplace', 'upload-packs-to-xsoar-saas-marketplace']
tags:
- gke
variables:
WORKFLOW: 'Upload Packs to Marketplace Storage'



Expand All @@ -90,7 +92,7 @@ xsoar-saas-prepare-testing-bucket-upload-flow:
- xsoar-saas-prepare-testing-bucket
variables:
IFRA_ENV_TYPE: "Bucket-Upload"
ARTIFACTS_FOLDER: "${ARTIFACTS_FOLDER_XSOAR_SAAS}"
ARTIFACTS_FOLDER: "${ARTIFACTS_FOLDER_XSOAR}"
rules:
- if: '$CI_COMMIT_BRANCH =~ /pull\/[0-9]+/'
when: never
Expand Down Expand Up @@ -136,7 +138,10 @@ xpanse-prepare-testing-bucket-upload-flow:
- ${CI_PROJECT_DIR}/pipeline_jobs_folder/*
when: always
variables:
PRODUCT_TYPE: "XSOAR"
SERVER_TYPE: "XSOAR"
ARTIFACTS_FOLDER: "${ARTIFACTS_FOLDER_XSOAR}"
ARTIFACTS_FOLDER_INSTANCE: "${ARTIFACTS_FOLDER_XSOAR}/instance_${INSTANCE_ROLE}"
ENV_RESULTS_PATH: "${ARTIFACTS_FOLDER_XSOAR}/env_results.json"
INSTANCE_CREATED: "true"
SSH_TUNNEL_TIMEOUT: 10
Expand All @@ -146,9 +151,11 @@ xpanse-prepare-testing-bucket-upload-flow:
- .default-job-settings
script:
- EXIT_CODE=0
- section_start "Download content-test-conf and infra" --collapsed
- ./Tests/scripts/download_conf_repos.sh 2>&1 | tee --append "${ARTIFACTS_FOLDER}/logs/download_conf_repos.log"
- section_end "Download content-test-conf and infra"
- section_start "Create Artifacts instance directory" --collapsed
- |
[ -d "${ARTIFACTS_FOLDER_INSTANCE}" ] || mkdir -p "${ARTIFACTS_FOLDER_INSTANCE}"
- section_end "Create Artifacts instance directory"
- !reference [.download-demisto-conf]
- section_start "Secrets Fetch" --collapsed
- SECRET_CONF_PATH=$(cat secret_conf_path)
- python3 ./Tests/scripts/add_secrets_file_to_build.py -sa "$GSM_SERVICE_ACCOUNT" -sf "$SECRET_CONF_PATH" -u "$DEMISTO_USERNAME" -p "$DEMISTO_PASSWORD" --gsm_project_id_dev "$GSM_PROJECT_ID_DEV" --gsm_project_id_prod "$GSM_PROJECT_ID" >> $ARTIFACTS_FOLDER/logs/handle_secrets.log
Expand All @@ -164,10 +171,10 @@ xpanse-prepare-testing-bucket-upload-flow:
python3 ./Tests/scripts/wait_until_server_ready.py -n ${IS_NIGHTLY} --instance-role "${INSTANCE_ROLE}" || EXIT_CODE=$?
- section_end "Wait Until Server Ready"
- section_start "Install Packs"
- ./Tests/Marketplace/install_packs.sh "$INSTANCE_ROLE" || EXIT_CODE=$?
- ./Tests/Marketplace/install_packs.sh || EXIT_CODE=$?
- section_end "Install Packs"
- section_start "Destroy instances"
- python3 ./Tests/scripts/destroy_instances.py --artifacts-dir $ARTIFACTS_FOLDER --env-file $ARTIFACTS_FOLDER/env_results.json --instance-role "$INSTANCE_ROLE" || EXIT_CODE=$?
- python3 ./Tests/scripts/destroy_instances.py --artifacts-dir "${ARTIFACTS_FOLDER}" --env-file "${ARTIFACTS_FOLDER}/env_results.json" --instance-role "${INSTANCE_ROLE}" || EXIT_CODE=$?
- section_end "Destroy instances"
- job-done
- exit "$EXIT_CODE"
Expand Down Expand Up @@ -236,16 +243,14 @@ install-packs-in-server-master:
- .default-job-settings
script:
- EXIT_CODE=0
- section_start "Download content-test-conf and infra" --collapsed
- ./Tests/scripts/download_conf_repos.sh 2>&1 | tee --append "${ARTIFACTS_FOLDER}/logs/download_conf_repos.log"
- section_end "Download content-test-conf and infra"
- !reference [.download-demisto-conf]
- section_start "Secrets Fetch" --collapsed
- SECRET_CONF_PATH=$(cat secret_conf_path)
- python3 ./Tests/scripts/add_secrets_file_to_build.py -sa "$GSM_SERVICE_ACCOUNT" -sf "$SECRET_CONF_PATH" -u "$DEMISTO_USERNAME" -p "$DEMISTO_PASSWORD" --gsm_project_id_dev "$GSM_PROJECT_ID_DEV" --gsm_project_id_prod "$GSM_PROJECT_ID" >> $ARTIFACTS_FOLDER/logs/handle_secrets.log
- section_end "Secrets Fetch"
- section_start "Lock Machine"
- echo "Authenticating GCP"
- gcloud auth activate-service-account --key-file="$GCS_ARTIFACTS_KEY" > $ARTIFACTS_FOLDER/logs/gauth.out 2>$ARTIFACTS_FOLDER/logs/gauth.err
- gcloud auth activate-service-account --key-file="$GCS_ARTIFACTS_KEY" >> "${ARTIFACTS_FOLDER}/logs/gcloud_auth.log" 2>&1
- echo "Auth done successfully"
- ./Tests/scripts/wait_in_line_for_cloud_env.sh "$CLOUD_MACHINES_TYPE"
- source CloudEnvVariables
Expand Down Expand Up @@ -273,7 +278,7 @@ install-packs-in-server-master:
- section_end "Get Instance Variables"

- section_start "Install Packs"
- ./Tests/Marketplace/install_packs.sh "$INSTANCE_ROLE" || EXIT_CODE=$?
- ./Tests/Marketplace/install_packs.sh || EXIT_CODE=$?
- section_end "Install Packs"

- job-done
Expand All @@ -286,18 +291,23 @@ install-packs-in-server-master:
# extends: .install-mpv2-packs-on-xsiam-instances
# variables:
# INSTANCE_ROLE: "XSIAM"
# PRODUCT_TYPE: "XSIAM"
# SERVER_TYPE: "XSIAM"
# GCS_QUEUE_FILE: "queue-master"
# TEST_MACHINES_LIST: "test-machines-master"

install-packs-in-xsiam-ga:
extends: .install-mpv2-packs-on-xsiam-instances
variables:
INSTANCE_ROLE: "XSIAM"
PRODUCT_TYPE: "XSIAM"
SERVER_TYPE: "XSIAM"
GCS_QUEUE_FILE: "queue-ga"
GCS_SOURCE_BUCKET: "$GCS_PRODUCTION_V2_BUCKET"
GCS_MACHINES_BUCKET: "${TEST_XDR_PREFIX}marketplace-v2-dist-dev/upload-flow/builds-xsiam"
CLOUD_SERVERS_FILE: "xsiam_servers_path"
CLOUD_API_KEYS: $XSIAM_API_KEYS
CLOUD_API_TOKENS: $XSIAM_TOKENS
NON_REMOVABLE_PACKS: "Base"


Expand All @@ -316,6 +326,8 @@ upload-packs-to-marketplace:
MARKETPLACE_VERSION: "xsoar"
ARTIFACTS_FOLDER: "${ARTIFACTS_FOLDER_XSOAR}"
ENV_RESULTS_PATH: "${ARTIFACTS_FOLDER_XSOAR}/env_results.json"
PRODUCT_TYPE: "XSOAR"
SERVER_TYPE: "XSOAR"
INSTANCE_ROLE: "Server Master"
INSTANCE_CREATED: "true"
SSH_TUNNEL_TIMEOUT: 10
Expand Down Expand Up @@ -360,7 +372,7 @@ upload-packs-to-marketplace:

PACKS_SRC="gs://$GCS_MARKET_BUCKET/$STORAGE_BASE_PATH/packs"
ZIP_FOLDER=$(mktemp -d)
gcloud auth activate-service-account --key-file="$GCS_MARKET_KEY" >> $ARTIFACTS_FOLDER/logs/auth.out
gcloud auth activate-service-account --key-file="$GCS_MARKET_KEY" >> "${ARTIFACTS_FOLDER}/logs/gcloud_auth.log" 2>&1
echo "successfully activated google cloud service account"
gsutil -m cp -r $PACKS_SRC $ZIP_FOLDER
echo "successfully downloaded index.zip"
Expand Down Expand Up @@ -398,6 +410,8 @@ upload-packs-to-marketplace-v2:
MARKETPLACE_VERSION: "marketplacev2"
ARTIFACTS_FOLDER: "${ARTIFACTS_FOLDER_MPV2}"
INSTANCE_ROLE: "Server Master"
PRODUCT_TYPE: "XSIAM"
SERVER_TYPE: "XSIAM"
INSTANCE_CREATED: "true"
SSH_TUNNEL_TIMEOUT: 10
TIME_TO_LIVE: ""
Expand Down Expand Up @@ -440,7 +454,7 @@ upload-packs-to-marketplace-v2:

PACKS_SRC="gs://$GCS_MARKET_V2_BUCKET/$STORAGE_BASE_PATH/packs"
ZIP_FOLDER=$(mktemp -d)
gcloud auth activate-service-account --key-file="$GCS_MARKET_KEY" >> $ARTIFACTS_FOLDER/logs/auth.out
gcloud auth activate-service-account --key-file="$GCS_MARKET_KEY" >> "${ARTIFACTS_FOLDER}/logs/gcloud_auth.log" 2>&1
echo "successfully activated google cloud service account"
gsutil -m cp -r $PACKS_SRC $ZIP_FOLDER
echo "successfully downloaded index.zip"
Expand Down Expand Up @@ -468,6 +482,8 @@ upload-packs-to-xpanse-marketplace:
MARKETPLACE_VERSION: "xpanse"
ARTIFACTS_FOLDER: "${ARTIFACTS_FOLDER_XPANSE}"
INSTANCE_ROLE: "Server Master"
PRODUCT_TYPE: "XPANSE"
SERVER_TYPE: "XPANSE"
INSTANCE_CREATED: "true"
SSH_TUNNEL_TIMEOUT: 10
TIME_TO_LIVE: ""
Expand Down Expand Up @@ -510,7 +526,7 @@ upload-packs-to-xpanse-marketplace:

PACKS_SRC="gs://$GCS_MARKET_XPANSE_BUCKET/$STORAGE_BASE_PATH/packs"
ZIP_FOLDER=$(mktemp -d)
gcloud auth activate-service-account --key-file="$GCS_MARKET_KEY" >> $ARTIFACTS_FOLDER/logs/auth.out
gcloud auth activate-service-account --key-file="$GCS_MARKET_KEY" >> "${ARTIFACTS_FOLDER}/logs/gcloud_auth.log" 2>&1
echo "successfully activated google cloud service account"
gsutil -m cp -r $PACKS_SRC $ZIP_FOLDER
echo "successfully downloaded index.zip"
Expand All @@ -537,8 +553,10 @@ upload-packs-to-xsoar-saas-marketplace:
when: always
variables:
MARKETPLACE_VERSION: "xsoar_saas"
ARTIFACTS_FOLDER: "${ARTIFACTS_FOLDER_XSOAR_SAAS}"
ARTIFACTS_FOLDER: "${ARTIFACTS_FOLDER_XSOAR}"
INSTANCE_ROLE: "Server Master"
PRODUCT_TYPE: "XSOAR"
SERVER_TYPE: "XSOAR SAAS"
INSTANCE_CREATED: "true"
SSH_TUNNEL_TIMEOUT: 10
TIME_TO_LIVE: ""
Expand Down Expand Up @@ -580,7 +598,7 @@ upload-packs-to-xsoar-saas-marketplace:

PACKS_SRC="gs://$GCS_MARKET_XSOAR_SAAS_BUCKET/$STORAGE_BASE_PATH/packs"
ZIP_FOLDER=$(mktemp -d)
gcloud auth activate-service-account --key-file="$GCS_MARKET_KEY" >> $ARTIFACTS_FOLDER/logs/auth.out
gcloud auth activate-service-account --key-file="$GCS_MARKET_KEY" >> "${ARTIFACTS_FOLDER}/logs/gcloud_auth.log" 2>&1
echo "successfully activated google cloud service account"
gsutil -m cp -r $PACKS_SRC $ZIP_FOLDER
echo "successfully downloaded index.zip"
Expand Down Expand Up @@ -665,18 +683,23 @@ fan-in-bucket-upload:


slack-notify-bucket-upload:
variables:
extends:
- .trigger-slack-notification
- .bucket-upload-rule-always
variables: # Passes the environment variable from the parent pipeline to the child which can be useful for cases when triggering pipeline with alternate env variable value passed in the API call.
PIPELINE_TO_QUERY: $CI_PIPELINE_ID
WORKFLOW: 'Upload Packs to Marketplace Storage'
JOB_NAME: 'fan-in-bucket-upload'
# Passes the environment variable from the parent pipeline to the child which can be useful for cases
# when triggering pipeline with alternate env variable value passed in the API call
SLACK_CHANNEL: $SLACK_CHANNEL
SLACK_JOB: 'true'
extends:
- .trigger-slack-notification
- .bucket-upload-rule-always

SLACK_ALLOW_FAILURE: 'false'
CI_PROJECT_ID: $CI_PROJECT_ID
CI_SERVER_URL: $CI_SERVER_URL
JIRA_SERVER_URL: $JIRA_SERVER_URL
JIRA_VERIFY_SSL: $JIRA_VERIFY_SSL
JIRA_API_KEY: $JIRA_API_KEY
JIRA_PROJECT_ID: $JIRA_PROJECT_ID
JIRA_ISSUE_UNRESOLVED_TRANSITION_NAME: $JIRA_ISSUE_UNRESOLVED_TRANSITION_NAME

upload-id-set-bucket:
tags:
Expand All @@ -695,7 +718,7 @@ upload-id-set-bucket:
fi

- !reference [.create-id-set-xsoar]
- gcloud auth activate-service-account --key-file="$GCS_MARKET_KEY"
- gcloud auth activate-service-account --key-file="$GCS_MARKET_KEY" >> "${ARTIFACTS_FOLDER}/logs/gcloud_auth.log" 2>&1
- gsutil cp $ARTIFACTS_FOLDER/id_set.json "gs://$GCS_MARKET_BUCKET/content/id_set.json"
- job-done

Expand Down Expand Up @@ -731,7 +754,7 @@ sync-buckets-between-projects:
job-done
exit 1
else
gcloud auth activate-service-account --key-file="$GCS_XSOAR_CONTENT_DEV_KEY"
gcloud auth activate-service-account --key-file="$GCS_XSOAR_CONTENT_DEV_KEY" >> "${ARTIFACTS_FOLDER}/logs/gcloud_auth.log" 2>&1

echo "Syncing gs://marketplace-xsoar-dev"
gsutil -m rsync -r gs://marketplace-dist gs://marketplace-xsoar-dev
Expand All @@ -742,7 +765,7 @@ sync-buckets-between-projects:

./Tests/scripts/validate_synced_buckets.sh "dev"

gcloud auth activate-service-account --key-file="$GCS_XSOAR_CONTENT_PROD_KEY"
gcloud auth activate-service-account --key-file="$GCS_XSOAR_CONTENT_PROD_KEY" >> "${ARTIFACTS_FOLDER}/logs/gcloud_auth.log" 2>&1

echo "Syncing gs://marketplace-xsoar-prod-us"
gsutil -m rsync -r gs://marketplace-dist gs://marketplace-xsoar-prod-us
Expand Down
21 changes: 14 additions & 7 deletions .gitlab/ci/.gitlab-ci.build-machines-cleanup.yml
Expand Up @@ -32,9 +32,11 @@ build-machines-cleanup:
CLOUD_MACHINES_COUNT: "all"
GCS_LOCKS_PATH: "content-locks/locks-xsiam-ga-nightly"
INSTANCE_ROLE: "XSIAM"
PRODUCT_TYPE: "XSIAM"
GCS_QUEUE_FILE: "queue-ga"
CLOUD_SERVERS_FILE: "xsiam_servers_path"
CLOUD_API_KEYS: $XSIAM_API_KEYS
CLOUD_API_TOKENS: $XSIAM_TOKENS
ARTIFACTS_FOLDER: "${ARTIFACTS_FOLDER_MPV2}"
GCS_MARKET_BUCKET: "${GCS_MARKET_V2_BUCKET}"
ENV_RESULTS_PATH: "${ARTIFACTS_FOLDER_MPV2}/env_results.json"
Expand All @@ -54,15 +56,20 @@ fan-in-build-machines-cleanup:
- echo "fan in"

slack-notify-build-machines-cleanup:
variables:
extends:
- .trigger-slack-notification
- .build-machines-cleanup-rule-always
variables: # Passes the environment variable from the parent pipeline to the child which can be useful for cases when triggering pipeline with alternate env variable value passed in the API call.
PIPELINE_TO_QUERY: $CI_PIPELINE_ID
WORKFLOW: 'Build Machines Cleanup'
JOB_NAME: 'fan-in-build-machines-cleanup'
# Passes the environment variable from the parent pipeline to the child which can be useful for cases
# when triggering pipeline with alternate env variable value passed in the API call
SLACK_CHANNEL: $SLACK_CHANNEL
SLACK_JOB: 'true'
extends:
- .trigger-slack-notification
- .build-machines-cleanup-rule-always

SLACK_ALLOW_FAILURE: 'false'
CI_PROJECT_ID: $CI_PROJECT_ID
CI_SERVER_URL: $CI_SERVER_URL
JIRA_SERVER_URL: $JIRA_SERVER_URL
JIRA_VERIFY_SSL: $JIRA_VERIFY_SSL
JIRA_API_KEY: $JIRA_API_KEY
JIRA_PROJECT_ID: $JIRA_PROJECT_ID
JIRA_ISSUE_UNRESOLVED_TRANSITION_NAME: $JIRA_ISSUE_UNRESOLVED_TRANSITION_NAME