Skip to content

Commit

Permalink
Merge f7582ed into 73f2940
Browse files Browse the repository at this point in the history
  • Loading branch information
uri-weisman committed Apr 11, 2024
2 parents 73f2940 + f7582ed commit ac92836
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/test-gcp-dm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ on:
- "[0-9]+.[0-9]+"
types: [opened, synchronize, reopened]
paths:
- ".github/workflows/test-gcp-dm.yml"
- "deploy/deployment-manager/compute_engine.py"
- "deploy/deployment-manager/compute_engine.py.schema"
- "deploy/deployment-manager/deploy.sh"
- "deploy/deployment-manager/set_env.sh"

env:
WORKING_DIR: deploy/test-environments
INTEGRATIONS_SETUP_DIR: tests/integrations_setup
TF_VAR_ec_api_key: ${{ secrets.EC_API_KEY }}
TF_VAR_ess_region: gcp-us-west2 # default region for testing deployments

Expand Down Expand Up @@ -80,13 +82,13 @@ jobs:
- name: Install CSPM GCP integration
id: cspm-gcp-integration
working-directory: deploy/test-environments/fleet_api
working-directory: ${{ env.INTEGRATIONS_SETUP_DIR }}
env:
STACK_VERSION: ${{ env.ELK_VERSION }}
DEPLOYMENT_NAME: ${{env.GCP_DEPLOYMENT_NAME}}
run: |
poetry install
poetry run python src/install_cspm_gcp_integration.py
poetry run python ./install_cspm_gcp_integration.py
- name: Deploy CSPM GCP agent
id: cspm-gcp-agent
Expand Down
4 changes: 1 addition & 3 deletions deploy/deployment-manager/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ DEPLOYMENT_NAME=${DEPLOYMENT_NAME:-elastic-agent-cspm}
ALLOW_SSH=${ALLOW_SSH:-false}
ZONE=${ZONE:-us-central1-a}
ROLE="roles/resourcemanager.projectIamAdmin"
OWNER=$(whoami)

ELASTIC_ARTIFACT_SERVER=${ELASTIC_ARTIFACT_SERVER%/} # Remove trailing slash if present
ELASTIC_ARTIFACT_SERVER=${ELASTIC_ARTIFACT_SERVER:-https://artifacts.elastic.co/downloads/beats/elastic-agent}
Expand Down Expand Up @@ -116,8 +115,7 @@ fi
# Apply the deployment manager templates
run_command "gcloud deployment-manager deployments create --automatic-rollback-on-error ${DEPLOYMENT_NAME} --project ${PROJECT_NAME} \
--template compute_engine.py \
--properties elasticAgentVersion:${STACK_VERSION},fleetUrl:${FLEET_URL},enrollmentToken:${ENROLLMENT_TOKEN},allowSSH:${ALLOW_SSH},zone:${ZONE},elasticArtifactServer:${ELASTIC_ARTIFACT_SERVER},scope:${SCOPE},parentId:${PARENT_ID} \
--labels owner=${OWNER}"
--properties elasticAgentVersion:${STACK_VERSION},fleetUrl:${FLEET_URL},enrollmentToken:${ENROLLMENT_TOKEN},allowSSH:${ALLOW_SSH},zone:${ZONE},elasticArtifactServer:${ELASTIC_ARTIFACT_SERVER},scope:${SCOPE},parentId:${PARENT_ID}"

## Remove the role required to deploy the DM templates
if [ "$ADD_ROLE" = "true" ]; then
Expand Down

0 comments on commit ac92836

Please sign in to comment.