-
-
Notifications
You must be signed in to change notification settings - Fork 306
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
869aad7
commit 52f3a5f
Showing
34 changed files
with
204 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/bash -e | ||
|
||
detect_changed_services() { | ||
echo "----------------------------------------------" | ||
echo "detecting changed folders for this commit" | ||
|
||
# get a list of all the changed folders only | ||
changed_folders=`git diff --name-only $TRAVIS_COMMIT_RANGE | grep / | awk 'BEGIN {FS="/"} {print $1}' | uniq` | ||
echo "changed folders "$changed_folders | ||
|
||
changed_services=() | ||
for folder in $changed_folders | ||
do | ||
echo "Adding $folder to list of services to build" | ||
if [[ $folder != ".ci" && $folder != ".git" && $folder != ".templates" ]]; then | ||
changed_services+=("$folder") | ||
fi | ||
done | ||
|
||
# # Iterate on each service and run the packaging script | ||
# for service in $changed_services | ||
# do | ||
# echo "-------------------Running packaging for $service---------------------" | ||
# # copy the common code to the service so that it can be packaged in the docker image | ||
# cp -r ./_global $service | ||
# pushd "$service" | ||
# # move the build script to the root of the service | ||
# mv ./_global/package-service.sh ./. | ||
# ./package-service.sh "$service" | ||
# popd | ||
# done | ||
} | ||
|
||
# detect_changed_services |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/env bash | ||
|
||
export AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID_PROD | ||
export AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY_PROD | ||
source .ci/detect-changed-services.sh && detect_changed_services && echo $changed_services | ||
echo "changed_services: $changed_services" | ||
|
||
|
||
auto_deployable_services="events-router," | ||
if [[ $TRAVIS_PULL_REQUEST == "false" ]]; then | ||
for service in $changed_services | ||
do | ||
echo "-------------------Running packaging for $service---------------------" | ||
if [[ $auto_deployable_services = *"$service"* ]]; then | ||
cd $service && yarn install && yarn deploy:prod; cd .. | ||
fi | ||
done | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/usr/bin/env bash | ||
|
||
export AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID_DEV | ||
export AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY_DEV | ||
source .ci/detect-changed-services.sh && detect_changed_services && echo $changed_services | ||
echo "changed_services: $changed_services" | ||
|
||
auto_deployable_services="events-router," | ||
if [[ $TRAVIS_PULL_REQUEST == "false" ]]; then | ||
for service in $changed_services | ||
do | ||
echo "-------------------Running packaging for $service---------------------" | ||
if [[ $auto_deployable_services = *"$service"* ]]; then | ||
cd $service && yarn install && yarn deploy; cd .. | ||
fi | ||
done | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/usr/bin/env bash | ||
|
||
source .ci/detect-changed-services.sh && detect_changed_services && echo $changed_services | ||
echo "changed_services: $changed_services" | ||
for service in $changed_services | ||
do | ||
echo "-------------------Running tests for $service---------------------" | ||
cd $service | ||
yarn install && yarn test | ||
if [[ $service == "lists-microservice" ]]; then | ||
wget ${ES_DOWNLOAD_URL} | ||
tar -xzf elasticsearch-${ES_VERSION}.tar.gz | ||
./elasticsearch-${ES_VERSION}/bin/elasticsearch & | ||
wget -q --waitretry=3 --retry-connrefused -T 10 -O - http://127.0.0.1:9200 | ||
yarn run test:integration | ||
#if [[ $TRAVIS_PULL_REQUEST == "false" ]]; then | ||
# yarn run test:system | ||
#fi | ||
fi | ||
cd .. | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
language: node_js | ||
sudo: required | ||
node_js: | ||
- '8.10' | ||
before_install: # if "install" is overridden | ||
# Repo for Yarn | ||
- sudo apt-key adv --fetch-keys http://dl.yarnpkg.com/debian/pubkey.gpg | ||
- echo "deb http://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list | ||
- sudo apt-get update -qq | ||
- sudo apt-get install -y -qq yarn | ||
- yarn install | ||
env: | ||
global: | ||
- ES_VERSION=6.0.0 | ||
- ES_DOWNLOAD_URL=https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-${ES_VERSION}.tar.gz | ||
matrix: | ||
- TEST_DIR=events | ||
- TEST_DIR=api | ||
- TEST_DIR=private | ||
- TEST_DIR=extensions | ||
- TEST_DIR=template-marketplace | ||
- TEST_DIR=lists-microservice | ||
- TEST_DIR=emails-microservice | ||
- TEST_DIR=campaigns-microservice | ||
- TEST_DIR=webhooks-microservice | ||
- TEST_DIR=support/events-router | ||
|
||
script: | ||
- cd $TEST_DIR && yarn install && yarn test | ||
- | | ||
if [[ $TEST_DIR == "lists-microservice" ]]; then | ||
wget ${ES_DOWNLOAD_URL} | ||
tar -xzf elasticsearch-${ES_VERSION}.tar.gz | ||
./elasticsearch-${ES_VERSION}/bin/elasticsearch & | ||
wget -q --waitretry=3 --retry-connrefused -T 10 -O - http://127.0.0.1:9200 | ||
yarn run test:integration | ||
#if [[ $TRAVIS_PULL_REQUEST == "false" ]]; then | ||
# yarn run test:system | ||
#fi | ||
fi | ||
if [[ $TEST_DIR == "support/events-router" ]]; then | ||
if [[ $TRAVIS_PULL_REQUEST == "false" ]]; then | ||
if [[ $TRAVIS_BRANCH == "master" ]]; then | ||
yarn deploy | ||
elif [[ $TRAVIS_BRANCH == "release" ]]; then | ||
yarn deploy:prod | ||
fi | ||
fi | ||
fi | ||
cache: | ||
yarn: true | ||
directories: | ||
- "$(npm config get prefix)/lib/node_modules" | ||
- node_modules | ||
- events/node_modules | ||
- api/node_modules | ||
- private/node_modules | ||
- extensions/node_modules | ||
- template-marketplace/node_modules | ||
- lists-microservice/node_modules | ||
- emails-microservice/node_modules | ||
- campaigns-microservice/node_modules | ||
- support/events-router/node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"KINESIS_SHARDS": 1 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.