Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
ff44a9c
m2m token support
May 8, 2018
33d6b1c
fixing lint error.
May 9, 2018
a6e7fec
env variables name change and clean-up to tc-core v2.3 accordingly.
May 9, 2018
ca54392
temp off for testing..
May 9, 2018
541cd13
fix lint issue.
May 9, 2018
94fb783
reverting temp fix.
May 9, 2018
a065371
Merge pull request #74 from topcoder-platform/feature/m2m-token
May 9, 2018
d93236e
Revert "m2m token support "
May 9, 2018
12c86ef
Merge pull request #75 from topcoder-platform/revert-74-feature/m2m-t…
May 9, 2018
eef6233
fixing middleware logger health check URL issue.
May 9, 2018
e588e91
Merge pull request #76 from topcoder-platform/feature/m2m-token
May 9, 2018
af165c3
Revert "Revert "m2m token support ""
May 9, 2018
f1c4fed
Merge pull request #77 from topcoder-platform/revert-75-revert-74-fea…
May 9, 2018
e7424db
Revert "Reapplying "m2m token support""
May 9, 2018
a9bb684
Merge pull request #79 from topcoder-platform/revert-77-revert-75-rev…
May 9, 2018
38a5b61
CircleCI 2.0 upgrade
May 9, 2018
476a492
Merge pull request #80 from topcoder-platform/feature/circleci-ecs-up…
May 9, 2018
da1b42f
m2m support
May 9, 2018
f37f55d
deploying for testing.
May 9, 2018
684d0a3
More logging for debugging database lock issue
May 10, 2018
6cf4336
More logging for debugging database lock issue
May 10, 2018
7f8af80
Trying with updated docker file
May 10, 2018
bc363f6
Trying without rabbitmq
May 10, 2018
e9f387b
Revert "Trying without rabbitmq"
May 10, 2018
09ce588
trying without rabbitmq
May 10, 2018
4dfc0d9
lint fix
May 10, 2018
b3af48e
deployiny...
May 10, 2018
82ef3f5
enabled logging in sequelize models for debugging database lock issue
May 10, 2018
853e378
disabled sequelize logging again
May 10, 2018
cf74252
added back rabbitmq
May 10, 2018
5166c9a
bringing back changes for rabbitmq
May 10, 2018
35734dd
changes in config var name.
May 10, 2018
52e70b0
removed temp branch from deployment
May 10, 2018
40520c2
Merge pull request #81 from topcoder-platform/feature/db-lock-issue
May 10, 2018
d5614b7
Merge branch 'dev' into feature/m2m-support
May 11, 2018
ea66a2f
cut-off bus token
May 15, 2018
7539fa0
implementing scope checking.
May 17, 2018
87b13c1
fixing lint issue.
May 17, 2018
1577918
debugging scope issue.
May 22, 2018
2c71383
fixing lint issue.
May 22, 2018
0a319e7
debugging done.
May 23, 2018
04ee4f2
fixing typo
May 23, 2018
dbf0f82
Merge pull request #82 from topcoder-platform/feature/m2m-support
May 23, 2018
4554420
trigger dev build.
sachin-maheshwari Jun 12, 2018
11a6f16
Applying the test case failure fix in dev as well to promote the m2m …
Jun 12, 2018
0685320
Merge branch 'master' into dev
Jun 12, 2018
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
85 changes: 85 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
version: 2
jobs:
test:
docker:
- image: circleci/node:8.9.4
- image: circleci/postgres:9.6.2-alpine
environment:
- POSTGRES_USER: circle_test
- POSTGRES_DB: circle_test
- image: elasticsearch:2.3
environment:
DB_MASTER_URL: postgres://circle_test:@127.0.0.1:5432/circle_test
AUTH_SECRET: secret
AUTH_DOMAIN: topcoder-dev.com
LOG_LEVEL: debug
APP_VERSION: v4
steps:
- checkout
- restore_cache:
key: test-node-modules-{{ checksum "package.json" }}
- run: npm install
- save_cache:
key: test-node-modules-{{ checksum "package.json" }}
paths:
- node_modules
- run: npm run lint
- run: npm run test
- run: npm run build
- persist_to_workspace:
root: .
paths:
- dist
deployDev:
docker:
- image: docker:17.06.1-ce-git
steps:
- checkout
- setup_remote_docker
- run:
name: Installation of build dependencies.
command: apk add --no-cache bash
- attach_workspace:
at: ./workspace
- run:
name: Installing AWS client
command: |
apk add --no-cache jq py-pip sudo
sudo pip install awscli --upgrade
- run: ./build.sh DEV
- run: ./deploy.sh DEV
deployProd:
docker:
- image: docker:17.06.1-ce-git
steps:
- checkout
- setup_remote_docker
- run:
name: Installation of build dependencies.
command: apk add --no-cache bash
- attach_workspace:
at: ./workspace
- run:
name: Installing AWS client
command: |
apk add --no-cache jq py-pip sudo
sudo pip install awscli --upgrade
- run: ./build.sh PROD
- run: ./deploy.sh PROD
workflows:
version: 2
build:
jobs:
- test
- deployDev:
requires:
- test
filters:
branches:
only: 'dev'
- deployProd:
requires:
- test
filters:
branches:
only: 'master'
24 changes: 0 additions & 24 deletions .ebextensions/01-environment-variables.config
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ option_settings:
- namespace: aws:elasticbeanstalk:application:environment
option_name: DIRECT_PROJECT_SERVICE_ENDPOINT
value: TBD
- namespace: aws:elasticbeanstalk:application:environment
option_name: TOPIC_SERVICE_ENDPOINT
value: TBD
- namespace: aws:elasticbeanstalk:application:environment
option_name: FILE_SERVICE_ENDPOINT
value: TBD
Expand All @@ -53,27 +50,6 @@ option_settings:
- namespace: aws:elasticbeanstalk:application:environment
option_name: AWS_SECRET_ACCESS_KEY
value: TBD
- namespace: aws:elasticbeanstalk:application:environment
option_name: SALESFORCE_WEB_TO_LEAD_URL
value: https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8
- namespace: aws:elasticbeanstalk:application:environment
option_name: SALESFORCE_ORG_ID
value: TBD
- namespace: aws:elasticbeanstalk:application:environment
option_name: SALESFORCE_LEAD_PROJECT_NAME
value: TBD
- namespace: aws:elasticbeanstalk:application:environment
option_name: SALESFORCE_LEAD_PROJECT_DESC
value: TBD
- namespace: aws:elasticbeanstalk:application:environment
option_name: SALESFORCE_LEAD_PROJECT_LINK
value: TBD
- namespace: aws:elasticbeanstalk:application:environment
option_name: SALESFORCE_LEAD_PROJECT_ID
value: TBD
- namespace: aws:elasticbeanstalk:application:environment
option_name: CONNECT_PROJECTS_URL
value: TBD
- namespace: aws:elasticbeanstalk:application:environment
option_name: USER_SERVICE_URL
value: TBD
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM node:6.9.4
LABEL version="1.0"
FROM node:8.2.1
LABEL version="1.2"
LABEL description="Projects microservice"

RUN apt-get update && \
Expand Down
15 changes: 15 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash

# more bash-friendly output for jq
JQ="jq --raw-output --exit-status"

ENV=$1
AWS_REGION=$(eval "echo \$${ENV}_AWS_REGION")
ACCOUNT_ID=$(eval "echo \$${ENV}_AWS_ACCOUNT_ID")
AWS_REPOSITORY=$(eval "echo \$${ENV}_AWS_REPOSITORY")

build() {
docker build -t $ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com/$AWS_REPOSITORY:$CIRCLE_SHA1 .
}

build
55 changes: 0 additions & 55 deletions circle.yml

This file was deleted.

23 changes: 9 additions & 14 deletions config/custom-environment-variables.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"authSecret": "AUTH_SECRET",
"apiVersion": "API_VERSION",
"AUTH_SECRET": "AUTH_SECRET",
"logLevel": "LOG_LEVEL",
"version": "APP_VERSION",
"captureLogs": "CAPTURE_LOGS",
Expand All @@ -17,28 +18,22 @@
"directProjectServiceTimeout": "DIRECT_PROJECT_SERVICE_TIMEOUt",
"fileServiceEndpoint": "FILE_SERVICE_ENDPOINT",
"identityServiceEndpoint": "IDENTITY_SERVICE_ENDPOINT",
"topicServiceEndpoint": "TOPIC_SERVICE_ENDPOINT",
"memberServiceEndpoint": "MEMBER_SERVICE_ENDPOINT",
"systemUserClientId": "SYSTEM_USER_CLIENT_ID",
"systemUserClientSecret": "SYSTEM_USER_CLIENT_SECRET",
"userServiceUrl": "USER_SERVICE_URL",
"connectProjectsUrl": "CONNECT_PROJECTS_URL",
"salesforceLead" : {
"webToLeadUrl": "SALESFORCE_WEB_TO_LEAD_URL",
"orgId" : "SALESFORCE_ORG_ID",
"projectNameFieldId": "SALESFORCE_LEAD_PROJECT_NAME",
"projectDescFieldId": "SALESFORCE_LEAD_PROJECT_DESC",
"projectLinkFieldId": "SALESFORCE_LEAD_PROJECT_LINK",
"projectIdFieldId" : "SALESFORCE_LEAD_PROJECT_ID"
},
"dbConfig": {
"masterUrl": "DB_MASTER_URL",
"maxPoolSize": "DB_MAX_POOL_SIZE",
"minPoolSize": "DB_MIN_POOL_SIZE"
},
"analyticsKey": "ANALYTICS_KEY",
"validIssuers": "VALID_ISSUERS",
"analyticsKey": "SEGMENT_ANALYTICS_KEY",
"VALID_ISSUERS": "VALID_ISSUERS",
"jwksUri": "JWKS_URI",
"busApiUrl": "BUS_API_URL",
"busApiToken": "BUS_API_TOKEN"
"AUTH0_URL" : "AUTH0_URL",
"AUTH0_CLIENT_ID": "AUTH0_CLIENT_ID",
"AUTH0_CLIENT_SECRET": "AUTH0_CLIENT_SECRET",
"AUTH0_AUDIENCE": "AUTH0_AUDIENCE",
"TOKEN_CACHE_TIME" : "TOKEN_CACHE_TIME"
}
24 changes: 9 additions & 15 deletions config/default.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"authSecret": "secret",
"authDomain": "topcoder-dev.com",
"apiVersion": "v4",
"AUTH_SECRET": "secret",
"logLevel": "info",
"version": "v4",
"captureLogs": "false",
Expand All @@ -9,7 +9,6 @@
"pubsubQueueName": "project.service",
"pubsubExchangeName": "projects",
"fileServiceEndpoint": "",
"topicServiceEndpoint": "",
"identityServiceEndpoint": "",
"memberServiceEndpoint": "",
"directProjectServiceEndpoint": "",
Expand All @@ -25,25 +24,20 @@
},
"systemUserClientId": "",
"systemUserClientSecret": "",
"userServiceUrl": "",
"connectProjectUrl":"",
"salesforceLead" : {
"webToLeadUrl": "https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8",
"orgId": "",
"projectNameFieldId": "",
"projectDescFieldId": "",
"projectLinkFieldId": "",
"projectIdFieldId" : ""
},
"dbConfig": {
"masterUrl": "",
"maxPoolSize": 50,
"minPoolSize": 4,
"idleTimeout": 1000
},
"analyticsKey": "",
"validIssuers": "[\"https:\/\/topcoder-newauth.auth0.com\/\",\"https:\/\/api.topcoder-dev.com\"]",
"jwksUri": "",
"VALID_ISSUERS": "[\"https:\/\/topcoder-newauth.auth0.com\/\",\"https:\/\/api.topcoder-dev.com\"]",
"busApiUrl": "http://api.topcoder-dev.com",
"busApiToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoicHJvamVjdC1zZXJ2aWNlIiwiaWF0IjoxNTEyNzQ3MDgyLCJleHAiOjE1MjEzODcwODJ9.PHuNcFDaotGAL8RhQXQMdpL8yOKXxjB5DbBIodmt7RE"
"HEALTH_CHECK_URL": "_health",
"AUTH0_CLIENT_ID": "",
"AUTH0_CLIENT_SECRET": "",
"AUTH0_AUDIENCE": "",
"AUTH0_URL": "",
"TOKEN_CACHE_TIME": ""
}
1 change: 0 additions & 1 deletion config/development.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"authDomain": "topcoder-dev.com",
"pubsubQueueName": "dev.project.service",
"pubsubExchangeName": "dev.projects",
"attachmentsS3Bucket": "topcoder-dev-media"
Expand Down
9 changes: 0 additions & 9 deletions config/sample.local.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,9 @@ if (process.env.NODE_ENV === 'test') {
logentriesToken: '',
rabbitmqURL: 'amqp://dockerhost:5672',
fileServiceEndpoint: 'https://api.topcoder-dev.com/v3/files/',
topicServiceEndpoint: 'https://api.topcoder-dev.com/v4/topics/',
directProjectServiceEndpoint: 'https://api.topcoder-dev.com/v3/direct',
connectProjectsUrl: 'https://connect.topcoder-dev.com/projects/',
memberServiceEndpoint: 'http://dockerhost:3001/members',
salesforceLead: {
webToLeadUrl: 'https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8',
orgId: '00D2C0000000dO6',
projectNameFieldId: 'title',
projectDescFieldId: 'description',
projectLinkFieldId: 'URL',
projectIdFieldId: '00N2C000000Vxxx',
},
dbConfig: {
masterUrl: 'postgres://coder:mysecretpassword@dockerhost:54321/projectsdb',
maxPoolSize: 50,
Expand Down
3 changes: 1 addition & 2 deletions config/test.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"authSecret": "secret",
"authDomain": "topcoder-dev.com",
"AUTH_SECRET": "secret",
"logLevel": "debug",
"captureLogs": "false",
"logentriesToken": "",
Expand Down
Loading