Skip to content

Commit 3af223e

Browse files
committed
circleci integration
1 parent c7ebdb3 commit 3af223e

File tree

3 files changed

+99
-4
lines changed

3 files changed

+99
-4
lines changed

.circleci/config.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
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.2 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+
19+
builddeploy_steps: &builddeploy_steps
20+
- checkout
21+
- setup_remote_docker
22+
- run: *install_dependency
23+
- run: *install_deploysuite
24+
- run:
25+
name: Running build script.
26+
command: |
27+
./awsconfiguration.sh $DEPLOY_ENV
28+
source awsenvconf
29+
./buildenv.sh -e $DEPLOY_ENV -b ${LOGICAL_ENV}-${APPNAME}-deployvar
30+
source buildenvvar
31+
./build.sh
32+
- deploy:
33+
name: Running MasterScript.
34+
command: |
35+
source awsenvconf
36+
source buildenvvar
37+
#./master_deploy.sh -d CFRONT -e $DEPLOY_ENV -c true
38+
39+
jobs:
40+
# Build & Deploy against development backend
41+
"build-dev":
42+
<<: *defaults
43+
environment:
44+
DEPLOY_ENV: "DEV"
45+
LOGICAL_ENV: "dev"
46+
APPNAME: "tc-auth-lib"
47+
steps: *builddeploy_steps
48+
49+
"build-prod":
50+
<<: *defaults
51+
environment:
52+
DEPLOY_ENV: "PROD"
53+
LOGICAL_ENV: "prod"
54+
APPNAME: "tc-auth-lib"
55+
steps: *builddeploy_steps
56+
57+
workflows:
58+
version: 2
59+
build:
60+
jobs:
61+
# Development builds are executed on "develop" branch only.
62+
- "build-dev":
63+
context : org-global
64+
filters:
65+
branches:
66+
only:
67+
- develop
68+
69+
# Production builds are exectuted only on tagged commits to the
70+
# master branch.
71+
- "build-prod":
72+
context : org-global
73+
filters:
74+
branches:
75+
only: master
76+
77+
78+

build.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
set -eo pipefail
3+
CONFFILENAME="./web-assets/js/setupAuth0WithRedirect.js"
4+
5+
perl -pi -e "s/\{\{DOMAIN\}\}/$DOMAIN/g" $CONFFILENAME
6+
perl -pi -e "s/\{\{AUTH0_CLIENT_ID\}\}/$AUTH0_CLIENT_ID/g" $CONFFILENAME
7+
perl -pi -e "s/\{\{LOGGERMODE\}\}/$LOGGERMODE/g" $CONFFILENAME
8+
perl -pi -e "s/\{\{AUTH0DOMAIN\}\}/$AUTH0DOMAIN/g" $CONFFILENAME
9+
10+
mkdir dist
11+
cp -rv ./web-assets/css/* ./dist/
12+
cp -rv ./web-assets/js/* ./dist/
13+
cp -rv ./web-assets/images ./dist/
14+
cp -rv ./web-assets/static-pages/* ./dist/
15+
16+
17+

web-assets/js/setupAuth0WithRedirect.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ const qs = (function (a) {
2323

2424
const authSetup = function () {
2525

26-
let domain = 'auth.topcoder-dev.com';
27-
const clientId = 'BXWXUWnilVUPdN01t2Se29Tw2ZYNGZvH';
26+
let domain = '{{DOMAIN}}';
27+
const clientId = '{{AUTH0_CLIENT_ID}}';
2828
const useLocalStorage = false;
2929
const useRefreshTokens = false;
3030
const v3JWTCookie = 'v3jwt';
@@ -38,7 +38,7 @@ const authSetup = function () {
3838
const utmSource = qs['utm_source'];
3939
const utmMedium = qs['utm_medium'];
4040
const utmCampaign = qs['utm_campaign'];
41-
const loggerMode = "dev";
41+
const loggerMode = "{{LOGGERMODE}}";
4242
const IframeLogoutRequestType = "LOGOUT_REQUEST";
4343
const enterpriseCustomers = ['zurich', 'cs'];
4444
const mode = qs['mode'] || 'signIn';
@@ -48,7 +48,7 @@ const authSetup = function () {
4848
if (utmSource &&
4949
(utmSource != 'undefined') &&
5050
(enterpriseCustomers.indexOf(utmSource) > -1)) {
51-
domain = "topcoder-dev.auth0.com";
51+
domain = "{{AUTH0DOMAIN}}";
5252
returnAppUrl += '&utm_source=' + utmSource;
5353
}
5454

0 commit comments

Comments
 (0)