Skip to content

Commit

Permalink
make package for all the collectors and create artifact
Browse files Browse the repository at this point in the history
  • Loading branch information
Rakhi Mundhada authored and Rakhi Mundhada committed Feb 1, 2024
1 parent 89f4d98 commit c01789e
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 10 deletions.
11 changes: 10 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ AWS_LAMBDA_PAWS_PACKAGE_NAME ?= al-paws-collector.zip
AWS_CFN_TEMPLATE_PATH ?= ./cfn/paws-collector.template
AWS_CFN_TEMPLATE_SHARED_PATH ?= ./cfn/paws-collector-shared.template
COLLECTOR_DIRS ?= $(shell find collectors/ -type d -maxdepth 1 -mindepth 1)
COLLECTOR_NAMES ?= $(shell find collectors/ -type d -maxdepth 1 -mindepth 1 -exec basename {} \;)
COLLECTOR_NAMES ?= $(shell find collectors/ -type d -maxdepth 1 -mindepth 1 -exec basename {} \; | grep -v "template")


.PHONY: test
Expand Down Expand Up @@ -34,6 +34,15 @@ test-all: test
fi; \
done;

package-all:
mkdir -p artifact_folder
for d in $(COLLECTOR_NAMES); do \
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/*.template collectors/$$d/al-$$d-collector.zip collectors/$$d/al-$$d-collector.json artifact_folder/$$d-collector/; \
done;

package: test package.zip

package.zip: node_modules/ *.js package.json
Expand Down
33 changes: 24 additions & 9 deletions ps_spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,14 @@ stages:
when:
- pull_request:
trigger_phrase: build-collector-auth0
- pull_request:
trigger_phrase: build-collectors
env:
ALPS_SERVICE_NAME: "paws-auth0-collector"
ALPS_SERVICE_VERSION: "1.1.56"
ALPS_SERVICE_VERSION: "1.1.55"
commands:
- source $NVM_DIR/nvm.sh && nvm use 18
- cd collectors/auth0
- export ALPS_SERVICE_VERSION=$(node -p "require('./package.json').version")
- echo "ALPS_SERVICE_VERSION=$ALPS_SERVICE_VERSION"
- export ALPS_SERVICE_NAME=paws-$(node -p "require('./package.json').name")
- echo "ALPS_SERVICE_NAME=$ALPS_SERVICE_NAME"
- npm install
- make package
- mkdir auth0-collector
Expand All @@ -81,13 +79,11 @@ stages:
when:
- pull_request:
trigger_phrase: build-collector-carbonback
- pull_request:
trigger_phrase: build-collectors
commands:
- source $NVM_DIR/nvm.sh && nvm use 18
- cd collectors/carbonblack
- export ALPS_SERVICE_VERSION=$(node -p "require('./package.json').version")
- echo "ALPS_SERVICE_VERSION=$ALPS_SERVICE_VERSION"
- export ALPS_SERVICE_NAME=paws-$(node -p "require('./package.json').name")
- echo "ALPS_SERVICE_NAME=$ALPS_SERVICE_NAME"
- source ~/.bashrc
- npm install
- make package
Expand All @@ -96,7 +92,26 @@ stages:
- zip -r ../../carbonback-collector.zip carbonback-collector
env:
ALPS_SERVICE_NAME: "paws-carbonblack-collector"
ALPS_SERVICE_VERSION: "1.0.52"
outputs:
file: ./carbonback-collector*
packagers:
- basic

- name: build artifact for all collector
image: 422372788747.dkr.ecr.us-east-1.amazonaws.com/al-paws-collector-pipeline:latest
compute_size: small_arm
when:
- pull_request:
trigger_phrase: build-all
- tag: ['\d+.\d+.\d+']
env:
ALPS_SERVICE_VERSION: "2.2.1"
commands:
- source $NVM_DIR/nvm.sh && nvm use 18
- make package-all
- zip -r artifact_folder.zip artifact_folder
outputs:
file: ./artifact_folder*
packagers:
- basic

0 comments on commit c01789e

Please sign in to comment.