Skip to content

Commit 26c93c4

Browse files
authored
Merge pull request #7 from topcoder-platform/dev
Change logging 'Ignore message' as error to info & STS and build fix
2 parents 2eee95a + a8b9f49 commit 26c93c4

File tree

3 files changed

+52
-60
lines changed

3 files changed

+52
-60
lines changed

.circleci/config.yml

Lines changed: 43 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,65 @@
11
version: 2
2-
3-
jobs:
4-
# Build & Deploy against development backend
5-
"build-dev":
6-
docker:
7-
- image: docker:18.06.0-ce-git
8-
steps:
2+
defaults: &defaults
3+
docker:
4+
- image: circleci/python:2.7-stretch-browsers
5+
install_dependency: &install_dependency
6+
name: Installation of build and deployment dependencies.
7+
command: |
8+
sudo apt install jq
9+
sudo pip install awscli --upgrade
10+
sudo pip install docker-compose
11+
install_deploysuite: &install_deploysuite
12+
name: Installation of install_deploysuite.
13+
command: |
14+
git clone --branch master https://github.com/topcoder-platform/tc-deploy-scripts ../buildscript
15+
cp ./../buildscript/master_deploy.sh .
16+
cp ./../buildscript/buildenv.sh .
17+
cp ./../buildscript/awsconfiguration.sh .
18+
build_steps: &build_steps
919
# Initialization.
1020
- checkout
1121
- setup_remote_docker
12-
- run:
13-
name: Installation of build dependencies.
14-
command: |
15-
apk add --no-cache bash
16-
apk add --no-cache jq py-pip sudo curl
17-
pip install --upgrade pip
18-
sudo pip install awscli --upgrade
19-
sudo curl -o /usr/local/bin/ecs-cli https://s3.amazonaws.com/amazon-ecs-cli/ecs-cli-linux-amd64-latest
20-
sudo pip install docker-compose
21-
sudo chmod +x /usr/local/bin/ecs-cli
22+
- run: *install_dependency
23+
- run: *install_deploysuite
2224
- run:
2325
name: Executing build.
2426
command: |
25-
chmod +x build.sh
26-
./build.sh DEV
27+
./build.sh
2728
- deploy:
28-
name : Running Masterscript
29-
command: |
30-
git clone --branch v1.1 https://github.com/topcoder-platform/tc-deploy-scripts ../buildscript
31-
cp ./../buildscript/master_deploy.sh .
32-
./master_deploy.sh -d ECS -e DEV -t $CIRCLE_BUILD_NUM -s member-account-processor
29+
name: Deploy to AWS
30+
command: |
31+
#aws --version && ./deploy.sh ${DEPLOY_ENV} $CIRCLE_SHA1
32+
./awsconfiguration.sh ${DEPLOY_ENV}
33+
source awsenvconf
34+
./buildenv.sh -e ${DEPLOY_ENV} -b ${LOGICAL_ENV}-member-account-processor-deployvar
35+
source buildenvvar
36+
./master_deploy.sh -d ECS -e ${DEPLOY_ENV} -t latest -s ${LOGICAL_ENV}-member-account-processor-appvar -i member-account-processor
37+
jobs:
38+
# Build & Deploy against development backend
39+
"build-dev":
40+
<<: *defaults
41+
environment:
42+
DEPLOY_ENV: "DEV"
43+
LOGICAL_ENV: "DEV"
44+
steps: *build_steps
3345
"build-prod":
34-
docker:
35-
- image: docker:18.06.0-ce-git
36-
steps:
37-
# Initialization.
38-
- checkout
39-
- setup_remote_docker
40-
- run:
41-
name: Installation of build dependencies.
42-
command: |
43-
apk add --no-cache bash
44-
apk add --no-cache jq py-pip sudo curl
45-
pip install --upgrade pip
46-
sudo pip install awscli --upgrade
47-
sudo curl -o /usr/local/bin/ecs-cli https://s3.amazonaws.com/amazon-ecs-cli/ecs-cli-linux-amd64-latest
48-
sudo pip install docker-compose
49-
sudo chmod +x /usr/local/bin/ecs-cli
50-
- run:
51-
name: Executing build.
52-
command: |
53-
chmod +x build.sh
54-
./build.sh PROD
55-
- deploy:
56-
name : Running Masterscript
57-
command: |
58-
git clone --branch v1.1 https://github.com/topcoder-platform/tc-deploy-scripts ../buildscript
59-
cp ./../buildscript/master_deploy.sh .
60-
./master_deploy.sh -d ECS -e PROD -t $CIRCLE_BUILD_NUM -s member-account-processor-prod
46+
<<: *defaults
47+
environment:
48+
DEPLOY_ENV: "PROD"
49+
LOGICAL_ENV: "PROD"
50+
steps: *build_steps
6151
workflows:
6252
version: 2
6353
build:
6454
jobs:
6555
# Development builds are executed on "develop" branch only.
6656
- "build-dev":
57+
context : org-global
6758
filters:
6859
branches:
6960
only: [ "dev", "dev-circleci" ]
7061
- "build-prod":
62+
context : org-global
7163
filters:
7264
branches:
7365
only: master

build.sh

100644100755
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
#!/bin/bash
22
set -eo pipefail
3-
ENV=$1
4-
AWS_ACCOUNT_ID=$(eval "echo \$${ENV}_AWS_ACCOUNT_ID")
5-
AWS_REGION=$(eval "echo \$${ENV}_AWS_REGION")
6-
AWS_REPOSITORY=$(eval "echo \$${ENV}_AWS_REPOSITORY")
3+
# ENV=$1
4+
# AWS_ACCOUNT_ID=$(eval "echo \$${ENV}_AWS_ACCOUNT_ID")
5+
# AWS_REGION=$(eval "echo \$${ENV}_AWS_REGION")
6+
# AWS_REPOSITORY=$(eval "echo \$${ENV}_AWS_REPOSITORY")
77

8-
# Builds Docker image of the app.
9-
TAG=$AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com/$AWS_REPOSITORY:$CIRCLE_BUILD_NUM
10-
sed -i='' "s|member-account-processor:latest|$TAG|" docker/docker-compose.yml
8+
# # Builds Docker image of the app.
9+
# TAG=$AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com/$AWS_REPOSITORY:$CIRCLE_BUILD_NUM
10+
# sed -i='' "s|member-account-processor:latest|$TAG|" docker/docker-compose.yml
1111
echo "" > docker/api.env
1212
docker-compose -f docker/docker-compose.yml build member-account-processor
1313
docker images

src/app.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,14 @@ const dataHandler = async (messageSet, topic, partition) => {
5858
if (!messageJSON.payload.hasOwnProperty('notificationType')) {
5959
await ProcessorService.processCreateUser(messageJSON, producer)
6060
} else {
61-
logger.error('Ignore message.')
61+
logger.info('Ignore message.')
6262
}
6363
break
6464
case config.USER_UPDATE_TOPIC:
6565
if (!messageJSON.payload.hasOwnProperty('notificationType')) {
6666
await ProcessorService.processUpdateUser(messageJSON, producer)
6767
} else {
68-
logger.error('Ignore message.')
68+
logger.info('Ignore message.')
6969
}
7070
break
7171
default:

0 commit comments

Comments
 (0)