Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit c03ec5f

Browse files
committed
fixed heroku deployment issues #2
1 parent b1de4fb commit c03ec5f

File tree

3 files changed

+15
-16
lines changed

3 files changed

+15
-16
lines changed

README.md

+12-11
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,12 @@ The following config parameters are supported, they are defined in `config.js` a
6767
| GITHUB_CLIENT_SECRET | the GitHub client secret | |
6868
| GITLAB_CLIENT_ID | the GitLab client id | |
6969
| GITLAB_CLIENT_SECRET | the GitLab client secret | |
70-
| WEBSITE | used as base to construct various URLs | http://topcoderx.topcoder.com/ |
70+
| WEBSITE | used as base to construct various URLs | http://topcoderx.topcoder-dev.com/ |
7171

7272
| GITLAB_API_BASE_URL | The Gitlab API base URL | https://gitlab.com/api/v4 |
7373

7474
| TC_LOGIN_URL | URL to do TopCoder login | |
75-
| TC_USER_PROFILE_URL | URL to to call TopCoder API to get profile from token | https://accounts.topcoder.com/member?retUrl=http:%2F%2Ftopcoderx.topcoder.com%2Fapi%2Fv1%2Ftclogin |
75+
| TC_USER_PROFILE_URL | URL to to call TopCoder API to get profile from token | https://accounts.topcoder-dev.com/member?retUrl=http:%2F%2Ftopcoderx.topcoder-dev.com%2Fapi%2Fv1%2Ftclogin |
7676
|TOPIC | kafka topic| |
7777
|KAFKA_OPTIONS | kafka options| |
7878

@@ -102,7 +102,7 @@ The frontend config file contains following variables to be configured in `src/f
102102
- click the left panel --> Developer settings --> OAuth Apps
103103
- click the `Register a new application`, fill in the fields,
104104
note that the `Authorization callback URL` should be the deployed web site,
105-
for local deployment, it should be `http://topcoderx.topcoder.com`
105+
for local deployment, it should be `http://topcoderx.topcoder-dev.com`
106106
- after creating the OAuth app, you can see its client id and client secret,
107107
these should be set to GITHUB_CLIENT_ID and GITHUB_CLIENT_SECRET environment variables
108108

@@ -113,8 +113,8 @@ The frontend config file contains following variables to be configured in `src/f
113113
- click the `Applications` tab
114114
- enter application name, e.g. `Topcoder-x`
115115
- for Redirect URI, enter two callback URLs, one callback URL per line, so there are two lines:
116-
http://topcoderx.topcoder.com/api/v1/gitlab/owneruser/callback
117-
http://topcoderx.topcoder.com/api/v1/gitlab/normaluser/callback
116+
http://topcoderx.topcoder-dev.com/api/v1/gitlab/owneruser/callback
117+
http://topcoderx.topcoder-dev.com/api/v1/gitlab/normaluser/callback
118118
- for Scopes, check the `api` and `read_user`, the `api` is for owner user, the `read_user` is for normal user
119119
- finally click `Save application` to save the OAuth app, then you will see its generated Application Id and Secret,
120120
these should be set to GITLAB_CLIENT_ID and GITLAB_CLIENT_SECRET environment variables
@@ -134,12 +134,12 @@ Import docs/Ragnar.postman_collection.json and docs/Ragnar.postman_environment.j
134134
After admin login, the admin token is automatically set to ADMIN-TOKEN environment variable,
135135
then you may run the `Save GitHub User` and `Save GitLab User` tests to create owner user of your GitHub/GitLab usernames,
136136
note that you must modify the request body username to use your GitHub/GitLab user names.
137-
For the `Get User Mapping` test, you may quety mapping by providing either topcoderUsername, githubUsername or gitlabUsername.
137+
For the `Get User Mapping` test, you may query mapping by providing either topcoderUsername, githubUsername or gitlabUsername.
138138

139139
## Verification
140140

141141
- run `npm serve` to start the app
142-
- go to topcoderx.topcoder.com and it will redirect to Topcoder login page, after successful login it will redirect back to Topcoder x app.
142+
- go to topcoderx.topcoder-dev.com and it will redirect to Topcoder login page, after successful login it will redirect back to Topcoder x app.
143143
- go to settings by clicking username at top right corner
144144
- setup both git provider to authorize topcoder-x to manage your repo on behalf of you
145145
- go to project management and create/edit projects, create hook and label
@@ -149,10 +149,11 @@ For the `Get User Mapping` test, you may quety mapping by providing either topco
149149
## Heroku Deployment
150150
Follow the below steps to deploy the app to heroku
151151
1. `heroku login`
152-
2. `heroku create`
153-
3. `heroku config:set NPM_CONFIG_PRODUCTION=false` so that heroku will install dev dependencies
154-
5. `git push heroku master` or `git push heroku develop:master` to deploy develop branch
155-
6. `heroku open` to load the app on browser
152+
1. `heroku create`
153+
1. `heroku addons:create mongolab`
154+
1. `heroku config:set NPM_CONFIG_PRODUCTION=false` so that heroku will install dev dependencies
155+
1. `git push heroku master` or `git push heroku develop:master` to deploy develop branch
156+
1. `heroku open` to load the app on browser
156157

157158
NOTE: Once environment variable are changed in heroku please run
158159
`heroku run npm run build`

package.json

-2
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,12 @@
1515
"serve": "./node_modules/.bin/concurrently \"npm run start:be\" \"npm run start:fe\"",
1616
"start:be": "nodemon src/app.js",
1717
"start:fe": "gulp build:watch",
18-
"build:fe": "gulp build",
1918
"build": "gulp build",
2019
"test": "node ./node_modules/mocha/bin/mocha --recursive --timeout 999999 --colors tests/*.test.js --bail",
2120
"clean": "gulp clean",
2221
"publish": "gulp publish",
2322
"test:fe": "gulp protractor",
2423
"lint": "gulp lint",
25-
"serve:dist": "gulp serve:dist",
2624
"heroku-postbuild": "gulp build"
2725
},
2826
"dependencies": {

src/config.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ module.exports = {
2020
GITLAB_CLIENT_ID: process.env.GITLAB_CLIENT_ID || '',
2121
GITLAB_CLIENT_SECRET: process.env.GITLAB_CLIENT_SECRET || '',
2222
// used as base to construct various URLs
23-
WEBSITE: process.env.WEBSITE || 'http://topcoderx.topcoder.com',
23+
WEBSITE: process.env.WEBSITE || 'http://topcoderx.topcoder-dev.com',
2424

2525
GITHUB_OWNER_CALLBACK_URL: '/api/v1/github/owneruser/callback',
2626
GITLAB_OWNER_CALLBACK_URL: '/api/v1/gitlab/owneruser/callback',
@@ -29,9 +29,9 @@ module.exports = {
2929
USER_ADDED_TO_TEAM_SUCCESS_URL: '/#/app/members',
3030

3131
GITLAB_API_BASE_URL: process.env.GITLAB_API_BASE_URL || 'https://gitlab.com/api/v4',
32-
TC_LOGIN_URL: process.env.TC_LOGIN_URL || 'https://accounts.topcoder.com/member',
32+
TC_LOGIN_URL: process.env.TC_LOGIN_URL || 'https://accounts.topcoder-dev.com/member',
3333
TC_LOGIN_CALLBACK_URL: '/api/v1/tclogin',
34-
TC_USER_PROFILE_URL: process.env.TC_USER_PROFILE_URL || 'http://api.topcoder.com/v2/user/profile',
34+
TC_USER_PROFILE_URL: process.env.TC_USER_PROFILE_URL || 'http://api.topcoder-dev.com/v2/user/profile',
3535

3636
// kafka configuration
3737
TOPIC: process.env.TOPIC || 'tc-x-events',

0 commit comments

Comments
 (0)