diff --git a/ci-cd/AzureDevOps/azure-pipelines.yml b/ci-cd/AzureDevOps/azure-pipelines.yml index ac9dd3e..08de413 100644 --- a/ci-cd/AzureDevOps/azure-pipelines.yml +++ b/ci-cd/AzureDevOps/azure-pipelines.yml @@ -1,67 +1,73 @@ -# ******** SplxAI Probe Template for Azure DevOps CI ******** +# ******** SPLX Probe Template for Azure DevOps CI ******** # # ******** Description ******** -# SplxAI Probe will test your GenAI application to detect vulnerabilities and provide remediation. +# SPLX Probe will test your GenAI application to detect vulnerabilities and provide remediation. # # It is recomended to create a new API key with a descriptive name # # The following values should be added as environment variables with the key being secret -# SPLXAI_TARGET_ID: the Target ID of the pre defined Target, from SplxAI Probe, Target Settings -# SPLXAI_API_KEY: the API key generated from SplxAI Probe, Account Settings -# SPLXAI_PLATFORM_URL: the SplxAI url that you login to (e.g https://probe.splx.ai/ or https://us.probe.splx.ai/) -# SPLXAI_API_URL: the SplxAI url that you login to (e.g https://api.probe.splx.ai/ or https://api.us.probe.splx.ai/) +# SPLX_TARGET_ID: the Target ID of the pre defined Target, from SPLX Probe, Target Settings +# SPLX_WORKSPACE_ID: the Workspace ID of the pre defined Target, from SPLX Probe (can be found in the URL when viewing the Target - e.g 163 in https://probe.splx.ai/w/163/target/000) +# SPLX_PROBE_IDS: list of Probe IDs to run, from SPLX Probe, Probe Settings, Details +# SPLX_API_KEY: the API key generated from SPLX Probe, Account Settings +# SPLX_PLATFORM_URL: the SPLX url that you login to (e.g https://probe.splx.ai/ or https://us.probe.splx.ai/) +# SPLX_API_URL: the SPLX url that you login to (e.g https://api.probe.splx.ai/ or https://api.us.probe.splx.ai/) # # For more configuration options, please check the technical documentation portal: # 📚 https://probe.splx.ai/probe-documentation # trigger: -- main + - main pool: vmImage: ubuntu-latest variables: -- name: SPLXAI_TARGET_ID - value: 000 -- name: SPLXAI_PLATFORM_URL - value: "https://probe.splx.ai" -- name: SPLXAI_API_URL - value: "https://api.probe.splx.ai" + - name: SPLX_TARGET_ID + value: 000 + - name: SPLX_WORKSPACE_ID + value: 000 + - name: SPLX_PROBE_IDS + value: "[1]" + - name: SPLX_PLATFORM_URL + value: "https://probe.splx.ai" + - name: SPLX_API_URL + value: "https://api.probe.splx.ai" steps: -- script: | - sudo apt-get -qq update - sudo apt-get install -y jq - - echo "###### Start SplxAI Test Run #######" - REQUEST_BODY=$(cat <<-EOF - { - "targetId": $SPLXAI_TARGET_ID, - "probeIds": [1], - "name": "AZDO CI/CD Test Run" - } - EOF - ) + - script: | + sudo apt-get -qq update + sudo apt-get install -y jq - RESPONSE=$(curl -s --request POST \ - --url $SPLXAI_API_URL/api/v2/test-run/trigger \ - --header 'Content-Type: application/json' \ - --header "X-Api-Key: $SPLXAI_API_KEY" \ - --data "$REQUEST_BODY") - - TEST_RUN_ID=$(echo $RESPONSE | jq -r '.testRunId') - if [ -z "$TEST_RUN_ID" ]; then - echo "Error: Failed to trigger Test Run!" - echo "Response: $RESPONSE" - exit 1 - fi - - echo "###### Triggered SplxAI Test Run #######" - echo "=> Click on the link below to see the Test Run results" - echo "=> https://probe.splx.ai/target/$SPLXAI_TARGET_ID/test-run-history/$TEST_RUN_ID" - - env: - SPLXAI_API_KEY: $(SPLXAI_API_KEY) # add your secret vaeriable https://learn.microsoft.com/en-us/azure/devops/pipelines/process/set-secret-variables?view=azure-devops + echo "###### Start SPLX Test Run #######" + REQUEST_BODY=$(cat <<-EOF + { + "targetId": $SPLX_TARGET_ID, + "probeIds": $SPLX_PROBE_IDS, + "name": "AZDO CI/CD Test Run" + } + EOF + ) - displayName: 'SplxAI Test' + RESPONSE=$(curl -s --request POST \ + --url $SPLX_API_URL/api/workspaces/$SPLX_WORKSPACE_ID/test-run/trigger \ + --header 'Content-Type: application/json' \ + --header "X-Api-Key: $SPLX_API_KEY" \ + --data "$REQUEST_BODY") + + TEST_RUN_ID=$(echo $RESPONSE | jq -r '.testRunId') + if [ -z "$TEST_RUN_ID" ]; then + echo "Error: Failed to trigger Test Run!" + echo "Response: $RESPONSE" + exit 1 + fi + + echo "###### Triggered SPLX Test Run #######" + echo "=> Click on the link below to see the Test Run results" + echo "=> $SPLX_PLATFORM_URL/w/$SPLX_WORKSPACE_ID/target/$SPLX_TARGET_ID/test-runs/$TEST_RUN_ID" + + env: + SPLX_API_KEY: $(SPLX_API_KEY) # add your secret vaeriable https://learn.microsoft.com/en-us/azure/devops/pipelines/process/set-secret-variables?view=azure-devops + + displayName: "SPLX Test" diff --git a/ci-cd/Bitbucket/bitbucket-pipelines.yml b/ci-cd/Bitbucket/bitbucket-pipelines.yml index da694be..291dd19 100644 --- a/ci-cd/Bitbucket/bitbucket-pipelines.yml +++ b/ci-cd/Bitbucket/bitbucket-pipelines.yml @@ -1,16 +1,18 @@ -# ******** SplxAI Probe Template for Bitbucket CI ******** +# ******** SPLX Probe Template for Bitbucket CI ******** # # ******** Description ******** -# SplxAI Probe will test your GenAI application to detect vulnerabilities and provide remediation. +# SPLX Probe will test your GenAI application to detect vulnerabilities and provide remediation. # # It is recomended to create a new API key with a descriptive name # The user needs to set up enviroment variables in Bitbucket CI, see here for more inforamtion: https://support.atlassian.com/bitbucket-cloud/docs/variables-and-secrets/ # # The following values should be added as environment variables with the key being secret -# SPLXAI_TARGET_ID: the Target ID of the pre defined Target, from SplxAI Probe, Target Settings -# SPLXAI_API_KEY: the API key generated from SplxAI Probe, Account Settings -# SPLXAI_PLATFORM_URL: the SplxAI url that you login to (e.g https://probe.splx.ai/ or https://us.probe.splx.ai/) -# SPLXAI_API_URL: the SplxAI url that you login to (e.g https://api.probe.splx.ai/ or https://api.us.probe.splx.ai/) +# SPLX_TARGET_ID: the Target ID of the pre defined Target, from SPLX Probe, Target Settings +# SPLX_WORKSPACE_ID: the Workspace ID of the pre defined Target, from SPLX Probe (can be found in the URL when viewing the Target - e.g 163 in https://probe.splx.ai/w/163/target/000) +# SPLX_PROBE_IDS: list of Probe IDs to run, from SPLX Probe, Probe Settings, Details +# SPLX_API_KEY: the API key generated from SPLX Probe, Account Settings +# SPLX_PLATFORM_URL: the SPLX url that you login to (e.g https://probe.splx.ai/ or https://us.probe.splx.ai/) +# SPLX_API_URL: the SPLX url that you login to (e.g https://api.probe.splx.ai/ or https://api.us.probe.splx.ai/) # # Note: This example used a self-hosted Gitlab-runner running with Shell executor as described here: https://docs.gitlab.com/ee/ci/docker/using_docker_build.html#use-the-shell-executor # @@ -22,32 +24,36 @@ image: atlassian/default-image:3 pipelines: default: - - step: - name: 'SplxAI Test' + - step: + name: "SPLX Test" script: - - | - apt-get -qq update - apt-get install -y jq + - | + apt-get -qq update + apt-get install -y jq - echo "###### Start SplxAI Test Run #######" - REQUEST_BODY=$(cat <<-EOF - { - "targetId": $SPLXAI_TARGET_ID, - "probeIds": [1], - "name": "Bitbucket CI/CD Test Run" - } - EOF - ) + echo "###### Start SPLX Test Run #######" + REQUEST_BODY=$(cat <<-EOF + { + "targetId": $SPLX_TARGET_ID, + "probeIds": $SPLX_PROBE_IDS, + "name": "Bitbucket CI/CD Test Run" + } + EOF + ) - RESPONSE=$(curl -s --request POST \ - --url $SPLXAI_API_URL/api/v2/test-run/trigger \ - --header 'Content-Type: application/json' \ - --header "X-Api-Key: $SPLXAI_API_KEY" \ - --data "$REQUEST_BODY") + RESPONSE=$(curl -s --request POST \ + --url $SPLX_API_URL/api/workspaces/$SPLX_WORKSPACE_ID/test-run/trigger \ + --header 'Content-Type: application/json' \ + --header "X-Api-Key: $SPLX_API_KEY" \ + --data "$REQUEST_BODY") - TEST_RUN_ID=$(echo $RESPONSE | jq -r '.testRunId') - if [ -z "$TEST_RUN_ID" ]; then - echo "Error: Failed to trigger Test Run!" - echo "Response: $RESPONSE" - exit 1 - fi + TEST_RUN_ID=$(echo $RESPONSE | jq -r '.testRunId') + if [ -z "$TEST_RUN_ID" ]; then + echo "Error: Failed to trigger Test Run!" + echo "Response: $RESPONSE" + exit 1 + fi + + echo "###### Triggered SPLX Test Run #######" + echo "=> Click on the link below to see the Test Run results" + echo "=> $SPLX_PLATFORM_URL/w/$SPLX_WORKSPACE_ID/target/$SPLX_TARGET_ID/test-runs/$TEST_RUN_ID" diff --git a/ci-cd/GitHub/splxai-test.yml b/ci-cd/GitHub/splxai-test.yml index 9a1e3b3..b4c2260 100644 --- a/ci-cd/GitHub/splxai-test.yml +++ b/ci-cd/GitHub/splxai-test.yml @@ -1,39 +1,42 @@ -# ******** SplxAI Probe Template for Github CI ******** +# ******** SPLX Probe Template for Github CI ******** # # ******** Description ******** -# SplxAI Probe will test your GenAI application to detect vulnerabilities and provide remediation. +# SPLX Probe will test your GenAI application to detect vulnerabilities and provide remediation. # # It is recomended to create a new API key with a descriptive name # # The following values should be added as environment variables with the key being secret -# SPLXAI_TARGET_ID: the Target ID of the pre defined Target, from SplxAI Probe, Target Settings -# SPLXAI_API_KEY: the API key generated from SplxAI Probe, Account Settings -# SPLXAI_PLATFORM_URL: the SplxAI url that you login to (e.g https://probe.splx.ai/ or https://us.probe.splx.ai/) -# SPLXAI_API_URL: the SplxAI url that you login to (e.g https://api.probe.splx.ai/ or https://api.us.probe.splx.ai/) +# SPLX_TARGET_ID: the Target ID of the pre defined Target, from SPLX Probe, Target Settings +# SPLX_WORKSPACE_ID: the Workspace ID of the pre defined Target, from SPLX Probe (can be found in the URL when viewing the Target - e.g 163 in https://probe.splx.ai/w/163/target/000) +# SPLX_PROBE_IDS: list of Probe IDs to run, from SPLX Probe, Probe Settings, Details +# SPLX_API_KEY: the API key generated from SPLX Probe, Account Settings +# SPLX_PLATFORM_URL: the SPLX url that you login to (e.g https://probe.splx.ai/ or https://us.probe.splx.ai/) +# SPLX_API_URL: the SPLX url that you login to (e.g https://api.probe.splx.ai/ or https://api.us.probe.splx.ai/) # # For more configuration options, please check the technical documentation portal: # 📚 https://probe.splx.ai/probe-documentation # -name: SplxAI Test +name: SPLX Test # Controls when the workflow will run on: # Triggers the workflow on push or pull request events but only for the "main" branch push: - branches: [ "main" ] + branches: ["main"] pull_request: - branches: [ "main" ] + branches: ["main"] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: env: - SPLXAI_TARGET_ID: 000 - # SPLXAI_API_KEY: .... # Defined as a secret variable: https://docs.github.com/en/actions/security-for-github-actions/security-guides/using-secrets-in-github-actions - SPLXAI_PLATFORM_URL: "https://probe.splx.ai" - SPLXAI_API_URL: "https://api.probe.splx.ai" - + SPLX_TARGET_ID: 000 + SPLX_WORKSPACE_ID: 000 + SPLX_PROBE_IDS: "[1]" + # SPLX_API_KEY: .... # Defined as a secret variable: https://docs.github.com/en/actions/security-for-github-actions/security-guides/using-secrets-in-github-actions + SPLX_PLATFORM_URL: "https://probe.splx.ai" + SPLX_API_URL: "https://api.probe.splx.ai" # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: @@ -48,40 +51,40 @@ jobs: - uses: actions/checkout@v4 # Runs a set of commands using the runners shell - - name: SplxAI Test + - name: SPLX Test env: - SPLXAI_API_KEY: ${{ secrets.SPLXAI_API_KEY }} + SPLX_API_KEY: ${{ secrets.SPLX_API_KEY }} run: | - sudo apt-get -qq update - sudo apt-get install -y jq - - echo "###### Start SplxAI Test Run #######" - REQUEST_BODY=$(cat <<-EOF - { - "targetId": $SPLXAI_TARGET_ID, - "probeIds": [1], - "name": "GitHub CI/CD Test Run" - } - EOF - ) + sudo apt-get -qq update + sudo apt-get install -y jq + + echo "###### Start SPLX Test Run #######" + REQUEST_BODY=$(cat <<-EOF + { + "targetId": $SPLX_TARGET_ID, + "probeIds": $SPLX_PROBE_IDS, + "name": "GitHub CI/CD Test Run" + } + EOF + ) + + echo $REQUEST_BODY + + RESPONSE=$(curl -s --request POST \ + --url $SPLX_API_URL/api/workspaces/$SPLX_WORKSPACE_ID/test-run/trigger \ + --header 'Content-Type: application/json' \ + --header "X-Api-Key: $SPLX_API_KEY" \ + --data "$REQUEST_BODY") + + echo $RESPONSE - echo $REQUEST_BODY - - RESPONSE=$(curl -s --request POST \ - --url $SPLXAI_API_URL/api/v2/test-run/trigger \ - --header 'Content-Type: application/json' \ - --header "X-Api-Key: $SPLXAI_API_KEY" \ - --data "$REQUEST_BODY") + TEST_RUN_ID=$(echo $RESPONSE | jq -r '.testRunId') + if [ -z "$TEST_RUN_ID" ]; then + echo "Error: Failed to trigger Test Run!" + echo "Response: $RESPONSE" + exit 1 + fi - echo $RESPONSE - - TEST_RUN_ID=$(echo $RESPONSE | jq -r '.testRunId') - if [ -z "$TEST_RUN_ID" ]; then - echo "Error: Failed to trigger Test Run!" - echo "Response: $RESPONSE" - exit 1 - fi - - echo "###### Triggered SplxAI Test Run #######" - echo "=> Click on the link below to see the Test Run results" - echo "=> https://probe.splx.ai/target/$SPLXAI_TARGET_ID/test-run-history/$TEST_RUN_ID" + echo "###### Triggered SPLX Test Run #######" + echo "=> Click on the link below to see the Test Run results" + echo "=> $SPLX_PLATFORM_URL/w/$SPLX_WORKSPACE_ID/target/$SPLX_TARGET_ID/test-runs/$TEST_RUN_ID" diff --git a/ci-cd/GitLab/gitlab-ci.yml b/ci-cd/GitLab/gitlab-ci.yml index 07912dd..4702c70 100644 --- a/ci-cd/GitLab/gitlab-ci.yml +++ b/ci-cd/GitLab/gitlab-ci.yml @@ -1,15 +1,17 @@ -# ******** SplxAI Probe Template for Gitlab CI ******** +# ******** SPLX Probe Template for Gitlab CI ******** # # ******** Description ******** -# SplxAI Probe will test your GenAI application to detect vulnerabilities and provide remediation. +# SPLX Probe will test your GenAI application to detect vulnerabilities and provide remediation. # # It is recomended to create a new API key with a descriptive name # # The following values should be added as environment variables with the key being secret -# SPLXAI_TARGET_ID: the Target ID of the pre defined Target, from SplxAI Probe, Target Settings -# SPLXAI_API_KEY: the API key generated from SplxAI Probe, Account Settings -# SPLXAI_PLATFORM_URL: the SplxAI url that you login to (e.g https://probe.splx.ai/ or https://us.probe.splx.ai/) -# SPLXAI_API_URL: the SplxAI url that you login to (e.g https://api.probe.splx.ai/ or https://api.us.probe.splx.ai/) +# SPLX_TARGET_ID: the Target ID of the pre defined Target, from SPLX Probe, Target Settings +# SPLX_WORKSPACE_ID: the Workspace ID of the pre defined Target, from SPLX Probe (can be found in the URL when viewing the Target - e.g 163 in https://probe.splx.ai/w/163/target/000) +# SPLX_PROBE_IDS: list of Probe IDs to run, from SPLX Probe, Probe Settings, Details +# SPLX_API_KEY: the API key generated from SPLX Probe, Account Settings +# SPLX_PLATFORM_URL: the SPLX url that you login to (e.g https://probe.splx.ai/ or https://us.probe.splx.ai/) +# SPLX_API_URL: the SPLX url that you login to (e.g https://api.probe.splx.ai/ or https://api.us.probe.splx.ai/) # # Note: This example used a self-hosted Gitlab-runner running with Shell executor as described here: https://docs.gitlab.com/ee/ci/docker/using_docker_build.html#use-the-shell-executor # @@ -20,42 +22,44 @@ stages: - test -splxai-test: +SPLX-test: stage: test - + variables: - SPLXAI_TARGET_ID: 000 - # SPLXAI_API_KEY: .... # Defined as a secret variable: https://docs.gitlab.com/ee/ci/variables/ - SPLXAI_PLATFORM_URL: "https://probe.splx.ai" - SPLXAI_API_URL: "https://api.probe.splx.ai" - + SPLX_TARGET_ID: 000 + SPLX_WORKSPACE_ID: 000 + SPLX_PROBE_IDS: "[1]" + # SPLX_API_KEY: .... # Defined as a secret variable: https://docs.gitlab.com/ee/ci/variables/ + SPLX_PLATFORM_URL: "https://probe.splx.ai" + SPLX_API_URL: "https://api.probe.splx.ai" + script: | apt-get -qq update apt-get install -y jq - - echo "###### Start SplxAI Test Run #######" + + echo "###### Start SPLX Test Run #######" REQUEST_BODY=$(cat <<-EOF { - "targetId": $SPLXAI_TARGET_ID, - "probeIds": [1], + "targetId": $SPLX_TARGET_ID, + "probeIds": $SPLX_PROBE_IDS, "name": "GitLab CI/CD Test Run" } EOF ) RESPONSE=$(curl -s --request POST \ - --url $SPLXAI_API_URL/api/v2/test-run/trigger \ + --url $SPLX_API_URL/api/workspaces/$SPLX_WORKSPACE_ID/test-run/trigger \ --header 'Content-Type: application/json' \ - --header "X-Api-Key: $SPLXAI_API_KEY" \ + --header "X-Api-Key: $SPLX_API_KEY" \ --data "$REQUEST_BODY") - + TEST_RUN_ID=$(echo $RESPONSE | jq -r '.testRunId') if [ -z "$TEST_RUN_ID" ]; then echo "Error: Failed to trigger Test Run!" echo "Response: $RESPONSE" exit 1 fi - - echo "###### Triggered SplxAI Test Run #######" + + echo "###### Triggered SPLX Test Run #######" echo "=> Click on the link below to see the Test Run results" - echo "=> https://probe.splx.ai/target/$SPLXAI_TARGET_ID/test-run-history/$TEST_RUN_ID" + echo "=> $SPLX_PLATFORM_URL/w/$SPLX_WORKSPACE_ID/target/$SPLX_TARGET_ID/test-runs/$TEST_RUN_ID" diff --git a/ci-cd/Jenkins/splxai-test.groovy b/ci-cd/Jenkins/splxai-test.groovy index caea80b..d2b9f66 100644 --- a/ci-cd/Jenkins/splxai-test.groovy +++ b/ci-cd/Jenkins/splxai-test.groovy @@ -1,15 +1,17 @@ -// ******** SplxAI Probe Template for Jenkins CI ******** +// ******** SPLX Probe Template for Jenkins CI ******** // // ******** Description ******** -// SplxAI Probe will test your GenAI application to detect vulnerabilities and provide remediation. +// SPLX Probe will test your GenAI application to detect vulnerabilities and provide remediation. // // It is recomended to create a new API key with a descriptive name // // The following values should be added as environment variables. -// SPLXAI_TARGET_ID: the Target ID of the pre defined Target, from SplxAI Probe, Target Settings -// SPLXAI_API_KEY: the API key generated from SplxAI Probe, Account Settings -// SPLXAI_PLATFORM_URL: the SplxAI url that you login to (e.g https://probe.splx.ai/ or https://us.probe.splx.ai/) -// SPLXAI_API_URL: the SplxAI url that you login to (e.g https://api.probe.splx.ai/ or https://api.us.probe.splx.ai/) +// SPLX_TARGET_ID: the Target ID of the pre defined Target, from SPLX Probe, Target Settings +// SPLX_WORKSPACE_ID: the Workspace ID of the pre defined Target, from SPLX Probe (can be found in the URL when viewing the Target - e.g 163 in https://probe.splx.ai/w/163/target/000) +// SPLX_PROBE_IDS: list of Probe IDs to run, from SPLX Probe, Probe Settings, Details +// SPLX_API_KEY: the API key generated from SPLX Probe, Account Settings +// SPLX_PLATFORM_URL: the SPLX url that you login to (e.g https://probe.splx.ai/ or https://us.probe.splx.ai/) +// SPLX_API_URL: the SPLX url that you login to (e.g https://api.probe.splx.ai/ or https://api.us.probe.splx.ai/) // // For more configuration options, please check the technical documentation portal: // 📚 https://probe.splx.ai/probe-documentation @@ -19,33 +21,35 @@ pipeline { agent any environment { - SPLXAI_TARGET_ID = 000 - SPLXAI_PLATFORM_URL = "https://probe.splx.ai" - SPLXAI_API_URL = "https://api.probe.splx.ai" + SPLX_TARGET_ID = 000 + SPLX_WORKSPACE_ID = 000 + SPLX_PROBE_IDS = "[1]" + SPLX_PLATFORM_URL = "https://probe.splx.ai" + SPLX_API_URL = "https://api.probe.splx.ai" } stages { - stage('SplxAI Test') { + stage('SPLX Test') { steps { sh ''' apt-get -qq update apt-get install -y jq - echo "###### Start SplxAI Test Run #######" + echo "###### Start SPLX Test Run #######" REQUEST_BODY=$(cat <<-EOF { - "targetId": $SPLXAI_TARGET_ID, - "probeIds": [1], + "targetId": $SPLX_TARGET_ID, + "probeIds": $SPLX_PROBE_IDS, "name": "Jenkins CI/CD Test Run" } EOF ) RESPONSE=$(curl -s --request POST \ - --url $SPLXAI_API_URL/api/v2/test-run/trigger \ + --url $SPLX_API_URL/api/workspaces/$SPLX_WORKSPACE_ID/test-run/trigger \ --header 'Content-Type: application/json' \ - --header "X-Api-Key: $SPLXAI_API_KEY" \ + --header "X-Api-Key: $SPLX_API_KEY" \ --data "$REQUEST_BODY") TEST_RUN_ID=$(echo $RESPONSE | jq -r '.testRunId') @@ -55,9 +59,9 @@ pipeline { exit 1 fi - echo "###### Triggered SplxAI Test Run #######" + echo "###### Triggered SPLX Test Run #######" echo "=> Click on the link below to see the Test Run results" - echo "=> https://probe.splx.ai/target/$SPLXAI_TARGET_ID/test-run-history/$TEST_RUN_ID" + echo "=> $SPLX_PLATFORM_URL/w/$SPLX_WORKSPACE_ID/target/$SPLX_TARGET_ID/test-runs/$TEST_RUN_ID" ''' } } diff --git a/ci-cd/README.md b/ci-cd/README.md index e8e7566..fa023c2 100644 --- a/ci-cd/README.md +++ b/ci-cd/README.md @@ -1,15 +1,17 @@ ![Logo](https://framerusercontent.com/images/YGRPW6ijSan06UXm0WkkLWAg5GQ.svg) # CI/CD Examples + This repository contains CI/CD specific examples of how to run a Test with Splx Probe. ## Examples by CI/CD Tool - - [AzureDevOps](./AzureDevOps) - - [Bamboo](./Bamboo) - - [Bitbucket](./Bitbucket) - - [GitHub](./GitHub) - - [GitLab](./GitLab) - - [Jenkins](./Jenkins) + +- [AzureDevOps](./AzureDevOps) +- [Bitbucket](./Bitbucket) +- [GitHub](./GitHub) +- [GitLab](./GitLab) +- [Jenkins](./Jenkins) ## Genric Examples - - [Bash](./generic) + +- [Bash](./generic) diff --git a/ci-cd/generic/bash.sh b/ci-cd/generic/bash.sh index bc315c2..6ee8649 100644 --- a/ci-cd/generic/bash.sh +++ b/ci-cd/generic/bash.sh @@ -1,20 +1,20 @@ apt-get -qq update apt-get install -y jq - echo "###### Start SplxAI Test Run #######" + echo "###### Start SPLX Test Run #######" REQUEST_BODY=$(cat <<-EOF { - "targetId": $SPLXAI_TARGET_ID, - "probeIds": [1], # add required Probes - "name": "SplxAI Test Run" + "targetId": $SPLX_TARGET_ID, + "probeIds": $SPLX_PROBE_IDS, # add required Probes in the list, e.g [1,2,3] + "name": "SPLX Test Run" } EOF ) RESPONSE=$(curl -s --request POST \ - --url $SPLXAI_API_URL/api/v2/test-run/trigger \ + --url $SPLX_API_URL/api/workspaces/$SPLX_WORKSPACE_ID/test-run/trigger \ --header 'Content-Type: application/json' \ - --header "X-Api-Key: $SPLXAI_API_KEY" \ + --header "X-Api-Key: $SPLX_API_KEY" \ --data "$REQUEST_BODY") TEST_RUN_ID=$(echo $RESPONSE | jq -r '.testRunId') @@ -24,6 +24,6 @@ exit 1 fi - echo "###### Triggered SplxAI Test Run #######" + echo "###### Triggered SPLX Test Run #######" echo "=> Click on the link below to see the Test Run results" - echo "=> https://probe.splx.ai/target/$SPLXAI_TARGET_ID/test-run-history/$TEST_RUN_ID" + echo "=> $SPLX_PLATFORM_URL/w/$SPLX_WORKSPACE_ID/target/$SPLX_TARGET_ID/test-runs/$TEST_RUN_ID"