Skip to content
This repository was archived by the owner on Feb 1, 2024. It is now read-only.

Commit 63d45be

Browse files
author
sachin-maheshwari
authored
Merge pull request #1 from topcoder-platform/develop
Shapeup#2 v5 user fortification
2 parents 8cd7d75 + bd22909 commit 63d45be

File tree

5 files changed

+85
-6
lines changed

5 files changed

+85
-6
lines changed

.circleci/config.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
version: 2
2+
defaults: &defaults
3+
docker:
4+
- image: circleci/python:2.7.18-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 v1.4.3 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+
restore_cache_settings_for_build: &restore_cache_settings_for_build
19+
key: docker-node-modules-{{ checksum "package-lock.json" }}
20+
21+
save_cache_settings: &save_cache_settings
22+
key: docker-node-modules-{{ checksum "package-lock.json" }}
23+
paths:
24+
- node_modules
25+
26+
builddeploy_steps: &builddeploy_steps
27+
- checkout
28+
- setup_remote_docker
29+
- run: *install_dependency
30+
- run: *install_deploysuite
31+
- restore_cache: *restore_cache_settings_for_build
32+
- run: ./build.sh ${APPNAME}
33+
- save_cache: *save_cache_settings
34+
- deploy:
35+
name: Running MasterScript.
36+
command: |
37+
./awsconfiguration.sh $DEPLOY_ENV
38+
source awsenvconf
39+
./buildenv.sh -e $DEPLOY_ENV -b ${LOGICAL_ENV}-${APPNAME}-deployvar
40+
source buildenvvar
41+
./master_deploy.sh -d ECS -e $DEPLOY_ENV -t latest -s ${LOGICAL_ENV}-global-appvar,${LOGICAL_ENV}-${APPNAME}-appvar -i ${APPNAME}
42+
43+
44+
jobs:
45+
# Build & Deploy against development backend
46+
"build-dev":
47+
<<: *defaults
48+
environment:
49+
DEPLOY_ENV: "DEV"
50+
LOGICAL_ENV: "dev"
51+
APPNAME: "u-bahn-user-skills-processor"
52+
steps: *builddeploy_steps
53+
54+
"build-prod":
55+
<<: *defaults
56+
environment:
57+
DEPLOY_ENV: "PROD"
58+
LOGICAL_ENV: "prod"
59+
APPNAME: "u-bahn-user-skills-processor"
60+
steps: *builddeploy_steps
61+
62+
workflows:
63+
version: 2
64+
build:
65+
jobs:
66+
# Development builds are executed on "develop" branch only.
67+
- "build-dev":
68+
context : org-global
69+
filters:
70+
branches:
71+
only:
72+
- develop
73+
74+
# Production builds are exectuted only on tagged commits to the
75+
# master branch.
76+
- "build-prod":
77+
context : org-global
78+
filters:
79+
branches:
80+
only: master

config/default.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ module.exports = {
2121
AUTH0_URL: process.env.AUTH0_URL || 'https://topcoder-dev.auth0.com/oauth/token', // Auth0 credentials
2222
AUTH0_UBAHN_AUDIENCE: process.env.AUTH0_UBAHN_AUDIENCE || 'https://u-bahn.topcoder.com',
2323
AUTH0_TOPCODER_AUDIENCE: process.env.AUTH0_TOPCODER_AUDIENCE || 'https://m2m.topcoder-dev.com/',
24-
TOKEN_CACHE_TIME: process.env.TOKEN_CACHE_TIME,
2524
AUTH0_CLIENT_ID: process.env.AUTH0_CLIENT_ID,
2625
AUTH0_CLIENT_SECRET: process.env.AUTH0_CLIENT_SECRET,
2726
AUTH0_PROXY_SERVER_URL: process.env.AUTH0_PROXY_SERVER_URL,

docker/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
FROM node:12.16.3
33

44
# Copy the current directory into the Docker image
5-
COPY . /ubahn-skill-record-processor
5+
COPY . /u-bahn-user-skills-processor
66

77
# Set working directory for future use
8-
WORKDIR /ubahn-skill-record-processor
8+
WORKDIR /u-bahn-user-skills-processor
99

1010
# Install the dependencies from package.json
1111
RUN npm install

docker/docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: '3'
22
services:
3-
ubahn-skill-record-processor:
4-
image: ubahn-skill-record-processor:latest
3+
u-bahn-user-skills-processor:
4+
image: u-bahn-user-skills-processor:latest
55
build:
66
context: ../
77
dockerfile: docker/Dockerfile

src/common/helper.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const qs = require('querystring')
88
const m2mAuth = require('tc-core-library-js').auth.m2m
99
const logger = require('./logger')
1010

11-
const ubahnM2MConfig = _.pick(config, ['AUTH0_URL', 'AUTH0_UBAHN_AUDIENCE', 'TOKEN_CACHE_TIME', 'AUTH0_PROXY_SERVER_URL'])
11+
const ubahnM2MConfig = _.pick(config, ['AUTH0_URL', 'AUTH0_UBAHN_AUDIENCE', 'AUTH0_PROXY_SERVER_URL'])
1212
const topcoderM2MConfig = _.pick(config, ['AUTH0_URL', 'AUTH0_TOPCODER_AUDIENCE', 'TOKEN_CACHE_TIME', 'AUTH0_PROXY_SERVER_URL'])
1313

1414
const ubahnM2M = m2mAuth({ ...ubahnM2MConfig, AUTH0_AUDIENCE: ubahnM2MConfig.AUTH0_UBAHN_AUDIENCE })

0 commit comments

Comments
 (0)