From 568cba6ef9e9251bd2d0def7e8fe1d3091de98ef Mon Sep 17 00:00:00 2001 From: Rakhi Mundhada Date: Mon, 12 Feb 2024 18:12:46 +0530 Subject: [PATCH] copy the cfn folder of paws collector as well --- Makefile | 6 +++++- build_collector.sh | 11 +++++++---- ps_spec.yml | 14 +++++++------- 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index e70160e8..f45adf8c 100644 --- a/Makefile +++ b/Makefile @@ -40,8 +40,12 @@ package-all: echo -e "\n************\n\n creaating package for $$d\n\n************\n\n"; \ make -C collectors/$$d package || exit 1; \ mkdir -p artifact_folder/$$d-collector; \ - cp -r collectors/$$d/cfn collectors/$$d/al-$$d-collector.zip collectors/$$d/al-$$d-collector.json collectors/$$d/themis-template artifact_folder/$$d-collector/; \ + cp -r collectors/$$d/cfn collectors/$$d/al-$$d-collector.zip collectors/$$d/al-$$d-collector.json artifact_folder/$$d-collector/; \ + if [ -d "./collectors/$$d/themis-template" ]; then \ + cp -r collectors/$$d/themis-template artifact_folder/$$d-collector/; \ + fi; \ done; + cp -r cfn artifact_folder; package: test package.zip diff --git a/build_collector.sh b/build_collector.sh index 2a9dc86f..45c3504b 100755 --- a/build_collector.sh +++ b/build_collector.sh @@ -1,10 +1,13 @@ #!/bin/sh COLLECTOR_NAME=$1 -cd collectors/"$COLLECTOR_NAME" || exit 1 -npm install || exit 1 -make package || exit 1 +cd collectors/"$COLLECTOR_NAME" +npm install +make package mkdir -p "${COLLECTOR_NAME}"-collector -cp -r cfn al-"${COLLECTOR_NAME}"-collector.zip al-"${COLLECTOR_NAME}"-collector.json themis-template "${COLLECTOR_NAME}"-collector +cp -r cfn al-"${COLLECTOR_NAME}"-collector.zip al-"${COLLECTOR_NAME}"-collector.json "${COLLECTOR_NAME}"-collector +if [ -d "./themis-template" ]; then \ + cp -r themis-template "${COLLECTOR_NAME}"-collector; \ +fi; \ zip -r ../../"${COLLECTOR_NAME}"-collector.zip "${COLLECTOR_NAME}"-collector diff --git a/ps_spec.yml b/ps_spec.yml index b1343c15..5c1a4a19 100644 --- a/ps_spec.yml +++ b/ps_spec.yml @@ -69,7 +69,7 @@ stages: packagers: - basic - - name: build-collector-carbonback + - name: build-collector-carbonblack image: 422372788747.dkr.ecr.us-east-1.amazonaws.com/al-paws-collector-pipeline:latest compute_size: small_arm when: @@ -84,7 +84,7 @@ stages: ALPS_SERVICE_NAME: "paws-carbonblack-collector" ALPS_SERVICE_VERSION: "1.0.52" #set the value from collector package json outputs: - file: ./carbonback-collector* + file: ./carbonblack-collector* packagers: - basic @@ -164,22 +164,22 @@ stages: packagers: - basic - - name: build-collector-gsuit + - name: build-collector-gsuite image: 422372788747.dkr.ecr.us-east-1.amazonaws.com/al-paws-collector-pipeline:latest compute_size: small_arm when: - pull_request: - trigger_phrase: build-collector-gsuit + trigger_phrase: build-collector-gsuite - pull_request: trigger_phrase: build-collectors env: - ALPS_SERVICE_NAME: "paws-gsuit-collector" + ALPS_SERVICE_NAME: "paws-gsuite-collector" ALPS_SERVICE_VERSION: "1.2.53" #set the value from collector package json commands: - source $NVM_DIR/nvm.sh && nvm use 18 - - ./build_collector.sh gsuit + - ./build_collector.sh gsuite outputs: - file: ./gsuit-collector* + file: ./gsuite-collector* packagers: - basic