Skip to content
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
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
12 changes: 0 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,6 @@ FROM node:6.9.4
LABEL version="1.0"
LABEL description="Projects microservice"

RUN apt-get update && \
apt-get upgrade -y

# install aws
RUN apt-get install -y \
ssh \
python \
python-dev \
python-pip

RUN pip install awscli

RUN apt-get install libpq-dev
# Create app directory
RUN mkdir -p /usr/src/app
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.

13 changes: 2 additions & 11 deletions config/custom-environment-variables.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"apiVersion": "API_VERSION",
"authSecret": "AUTH_SECRET",
"logLevel": "LOG_LEVEL",
"version": "APP_VERSION",
Expand All @@ -17,26 +18,16 @@
"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",
"analyticsKey": "SEGMENT_ANALYTICS_KEY",
"validIssuers": "VALID_ISSUERS",
"jwksUri": "JWKS_URI",
"busApiUrl": "BUS_API_URL",
Expand Down
11 changes: 1 addition & 10 deletions config/default.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"apiVersion": "v4",
"authSecret": "secret",
"authDomain": "topcoder-dev.com",
"logLevel": "info",
Expand All @@ -9,7 +10,6 @@
"pubsubQueueName": "project.service",
"pubsubExchangeName": "projects",
"fileServiceEndpoint": "",
"topicServiceEndpoint": "",
"identityServiceEndpoint": "",
"memberServiceEndpoint": "",
"directProjectServiceEndpoint": "",
Expand All @@ -25,16 +25,7 @@
},
"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,
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
Loading