Skip to content

Commit

Permalink
copy the cfn folder of paws collector as well
Browse files Browse the repository at this point in the history
  • Loading branch information
Rakhi Mundhada authored and Rakhi Mundhada committed Feb 12, 2024
1 parent e565db2 commit bdc73fd
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 17 deletions.
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,15 @@ make sam-local
## Build artifact

1. To build the single/individual collector :
a. Update `ALPS_SERVICE_VERSION` from collector package.json version.
b. Trigger the phrase base on the collector name once the pr is approved.
- a. Update `ALPS_SERVICE_VERSION` from collector package.json version.
- b. Trigger the phrase base on the collector name once the pr is approved.
ex. to create artifact for auth0 ,phrase will be `build-collector-auth0`

2. To build all the collectors:
There is two way of building the all collector as follow:
1. Update the `ALPS_SERVICE_VERSION` for each collector as per package.json and trigger the common prase `build-collectors` once pr is approved.

2. After pr is merge to master branch ,create the tag, which will build the single artifact for all collectors.
1. Update the `ALPS_SERVICE_VERSION` for each collector as per package.json and trigger the common prase `build-collectors` once pr is approved.

***OR***

2. After pr is merge to master branch ,create the tag, which will build the single artifact for all collectors.

11 changes: 7 additions & 4 deletions build_collector.sh
Original file line number Diff line number Diff line change
@@ -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
14 changes: 7 additions & 7 deletions ps_spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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

Expand Down Expand Up @@ -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

Expand Down

0 comments on commit bdc73fd

Please sign in to comment.