Skip to content

Change logging 'Ignore message' as error to info & STS and build fix #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 43 additions & 51 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,73 +1,65 @@
version: 2

jobs:
# Build & Deploy against development backend
"build-dev":
docker:
- image: docker:18.06.0-ce-git
steps:
defaults: &defaults
docker:
- image: circleci/python:2.7-stretch-browsers
install_dependency: &install_dependency
name: Installation of build and deployment dependencies.
command: |
sudo apt install jq
sudo pip install awscli --upgrade
sudo pip install docker-compose
install_deploysuite: &install_deploysuite
name: Installation of install_deploysuite.
command: |
git clone --branch master https://github.com/topcoder-platform/tc-deploy-scripts ../buildscript
cp ./../buildscript/master_deploy.sh .
cp ./../buildscript/buildenv.sh .
cp ./../buildscript/awsconfiguration.sh .
build_steps: &build_steps
# Initialization.
- checkout
- setup_remote_docker
- run:
name: Installation of build dependencies.
command: |
apk add --no-cache bash
apk add --no-cache jq py-pip sudo curl
pip install --upgrade pip
sudo pip install awscli --upgrade
sudo curl -o /usr/local/bin/ecs-cli https://s3.amazonaws.com/amazon-ecs-cli/ecs-cli-linux-amd64-latest
sudo pip install docker-compose
sudo chmod +x /usr/local/bin/ecs-cli
- run: *install_dependency
- run: *install_deploysuite
- run:
name: Executing build.
command: |
chmod +x build.sh
./build.sh DEV
./build.sh
- deploy:
name : Running Masterscript
command: |
git clone --branch v1.1 https://github.com/topcoder-platform/tc-deploy-scripts ../buildscript
cp ./../buildscript/master_deploy.sh .
./master_deploy.sh -d ECS -e DEV -t $CIRCLE_BUILD_NUM -s member-account-processor
name: Deploy to AWS
command: |
#aws --version && ./deploy.sh ${DEPLOY_ENV} $CIRCLE_SHA1
./awsconfiguration.sh ${DEPLOY_ENV}
source awsenvconf
./buildenv.sh -e ${DEPLOY_ENV} -b ${LOGICAL_ENV}-member-account-processor-deployvar
source buildenvvar
./master_deploy.sh -d ECS -e ${DEPLOY_ENV} -t latest -s ${LOGICAL_ENV}-member-account-processor-appvar -i member-account-processor
jobs:
# Build & Deploy against development backend
"build-dev":
<<: *defaults
environment:
DEPLOY_ENV: "DEV"
LOGICAL_ENV: "DEV"
steps: *build_steps
"build-prod":
docker:
- image: docker:18.06.0-ce-git
steps:
# Initialization.
- checkout
- setup_remote_docker
- run:
name: Installation of build dependencies.
command: |
apk add --no-cache bash
apk add --no-cache jq py-pip sudo curl
pip install --upgrade pip
sudo pip install awscli --upgrade
sudo curl -o /usr/local/bin/ecs-cli https://s3.amazonaws.com/amazon-ecs-cli/ecs-cli-linux-amd64-latest
sudo pip install docker-compose
sudo chmod +x /usr/local/bin/ecs-cli
- run:
name: Executing build.
command: |
chmod +x build.sh
./build.sh PROD
- deploy:
name : Running Masterscript
command: |
git clone --branch v1.1 https://github.com/topcoder-platform/tc-deploy-scripts ../buildscript
cp ./../buildscript/master_deploy.sh .
./master_deploy.sh -d ECS -e PROD -t $CIRCLE_BUILD_NUM -s member-account-processor-prod
<<: *defaults
environment:
DEPLOY_ENV: "PROD"
LOGICAL_ENV: "PROD"
steps: *build_steps
workflows:
version: 2
build:
jobs:
# Development builds are executed on "develop" branch only.
- "build-dev":
context : org-global
filters:
branches:
only: [ "dev", "dev-circleci" ]
- "build-prod":
context : org-global
filters:
branches:
only: master
14 changes: 7 additions & 7 deletions build.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/bin/bash
set -eo pipefail
ENV=$1
AWS_ACCOUNT_ID=$(eval "echo \$${ENV}_AWS_ACCOUNT_ID")
AWS_REGION=$(eval "echo \$${ENV}_AWS_REGION")
AWS_REPOSITORY=$(eval "echo \$${ENV}_AWS_REPOSITORY")
# ENV=$1
# AWS_ACCOUNT_ID=$(eval "echo \$${ENV}_AWS_ACCOUNT_ID")
# AWS_REGION=$(eval "echo \$${ENV}_AWS_REGION")
# AWS_REPOSITORY=$(eval "echo \$${ENV}_AWS_REPOSITORY")

# Builds Docker image of the app.
TAG=$AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com/$AWS_REPOSITORY:$CIRCLE_BUILD_NUM
sed -i='' "s|member-account-processor:latest|$TAG|" docker/docker-compose.yml
# # Builds Docker image of the app.
# TAG=$AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com/$AWS_REPOSITORY:$CIRCLE_BUILD_NUM
# sed -i='' "s|member-account-processor:latest|$TAG|" docker/docker-compose.yml
echo "" > docker/api.env
docker-compose -f docker/docker-compose.yml build member-account-processor
docker images
4 changes: 2 additions & 2 deletions src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@ const dataHandler = async (messageSet, topic, partition) => {
if (!messageJSON.payload.hasOwnProperty('notificationType')) {
await ProcessorService.processCreateUser(messageJSON, producer)
} else {
logger.error('Ignore message.')
logger.info('Ignore message.')
}
break
case config.USER_UPDATE_TOPIC:
if (!messageJSON.payload.hasOwnProperty('notificationType')) {
await ProcessorService.processUpdateUser(messageJSON, producer)
} else {
logger.error('Ignore message.')
logger.info('Ignore message.')
}
break
default:
Expand Down