|
| 1 | +## Build LDAP Image |
| 2 | +Use an existing docker file on [GitHub](https://github.com/appirio-tech/tc-common-tutorials/tree/master/docker) (use commit hash cfc5b80ead7f83a7d592e406ef3bd160889683c1). |
| 3 | +The README contains instructions on how to build the docker image. |
| 4 | + |
| 5 | +The image is referenced in the provided docker-compose.yml file. |
| 6 | + |
| 7 | +## Docker Images for tc-website |
| 8 | +The following docker images are defined: |
| 9 | +* base - located in base sub-directory, used as the base image for build and run images below. |
| 10 | +* build - located in build sub-directory, used to create the jboss and tc website wars ready for deployment. |
| 11 | +* run - located in run sub-directory used to run the jboss created by the build image to run the tc website. |
| 12 | + |
| 13 | +You need to run the following commands to build these images first: |
| 14 | +``` |
| 15 | +# Go to the directory extracting this submission |
| 16 | +
|
| 17 | +docker build -t tc-website:base base |
| 18 | +docker build -t tc-website:build build |
| 19 | +docker build -t tc-website:run run |
| 20 | +``` |
| 21 | + |
| 22 | +## Prepare tc-website Codebase |
| 23 | +Pull following repos into a directory (e.g. tc-platform): |
| 24 | +https://github.com/topcoder-platform/tc-website (with commit hash: f5e9ec2e9e7d99f012e308b530947ab034948ad6) |
| 25 | +https://github.com/topcoder-platform/tc-website-external-artifacts (with commit hash: 33100ff8b102ee8a386c4200d571b6c31c33fad1) |
| 26 | +https://github.com/topcoder-platform/tc-website-glue (with commit hash: 61849f3601a25efc40390a59eedd8d1dc92eb4ef) |
| 27 | +https://github.com/topcoder-platform/tc-website-shared (with commit hash: fbbc0e49893bf972e46d7c73192a5592e39dab3b) |
| 28 | +https://github.com/topcoder-platform/tc-website-static (with commit hash: fc26666a6ee3a323cdd8de9e849a2e576352a656) |
| 29 | + |
| 30 | +Then rename the folders in tc-platform as below: |
| 31 | +tc-platform |
| 32 | +- tc-website - corresponding to tc-website repo (no renaming needed) |
| 33 | +- external-artifacts - corresponding to tc-website-external-artifacts repo |
| 34 | +- glue - corresponding to tc-website-glue repo |
| 35 | +- shared - corresponding to tc-website-shared repo |
| 36 | +- static - corresponding to tc-website-static repo |
| 37 | + |
| 38 | +## Deployment |
| 39 | +Update the configuration values in env.sh file from the submission: |
| 40 | +* TC_PLATFORM_SRC_ROOT - the root directory of the tc-platform codebase, point to the tc-platform directory above |
| 41 | +* DEPLOYMENT_DIR - the directory to put the jboss and the created wars. |
| 42 | + |
| 43 | +Run `source env.sh` to create the environment variables. |
| 44 | + |
| 45 | +Then run `docker-compose up build-tc-website` to build the code and create jboss and tc-website wars. |
| 46 | +Finally run `docker-compose up run-tc-website` to run the jboss created above and setup apache. |
| 47 | + |
| 48 | +The console is like this: http://take.ms/wPZwi when it's ready to access the tc-website. |
| 49 | + |
| 50 | +## Verification |
| 51 | +Add the following entries to your hosts file: |
| 52 | +docker-ip local.tc.cloud.topcoder.com |
| 53 | + |
| 54 | +Where docker-ip is the ip address of your docker box. It should be 127.0.0.1 on Linux. |
| 55 | + |
| 56 | +Open: https://local.tc.cloud.topcoder.com/tc, the page is like: http://take.ms/r5A9U |
| 57 | +Open: https://local.tc.cloud.topcoder.com/tc?module=Login, the page is like http://take.ms/uxt4K |
| 58 | + |
| 59 | +Login with: heffan/password, and after logged-in successfully, it will redirect user to page like: http://take.ms/O3AaE |
| 60 | +and finally to the official topcoder.com page. |
| 61 | + |
| 62 | +You can now try the following pages: |
| 63 | +TC WAR: |
| 64 | +* Open https://local.tc.cloud.topcoder.com/tc?module=MyHome, the page is like: http://take.ms/TYP9F |
| 65 | +* Open https://local.tc.cloud.topcoder.com/tc?module=EditTheme, change to use old theme, the page is like: http://take.ms/efKBr |
| 66 | +* Open https://local.tc.cloud.topcoder.com/tc?module=ActiveContests&pt=39 (code active contests), the page is like: http://take.ms/RxSWZ |
| 67 | + |
| 68 | +Note that the links like https://local.tc.cloud.topcoder.com/challenges/design/active won't work. |
| 69 | + |
| 70 | +Query WAR: |
| 71 | +* Open https://local.tc.cloud.topcoder.com/query/query, the page is like: http://take.ms/UvcrU |
| 72 | + |
| 73 | +Admin WAR: |
| 74 | +* Open https://local.tc.cloud.topcoder.com/admin/, the page is like: http://take.ms/nygny |
| 75 | +* Open https://local.tc.cloud.topcoder.com/admin/?module=TermsList, the page is like: http://take.ms/P061N |
| 76 | + |
| 77 | +CORP WAR: |
| 78 | +* Open https://local.tc.cloud.topcoder.com/corp/, the page is like: http://take.ms/d6tMF |
| 79 | + |
| 80 | +Email WAR: |
| 81 | +* Open https://local.tc.cloud.topcoder.com/email/, the page is like: http://take.ms/BNbd5 |
| 82 | + |
| 83 | +Reg WAR: |
| 84 | +* Open https://local.tc.cloud.topcoder.com/reg/, the page is like: http://take.ms/jkbVm |
| 85 | + |
| 86 | +EP WAR: |
| 87 | +* Open https://local.tc.cloud.topcoder.com/ep, the page is like: http://take.ms/Nw1bV |
| 88 | + |
| 89 | +Private Label WAR: |
| 90 | +* Open https://local.tc.cloud.topcoder.com/pl/, the page is like: http://take.ms/x3pr5 |
| 91 | + |
| 92 | +Note that you may receive HTTPS certificate warnings, just ignore it and proceed. |
| 93 | +And you can click around to try the other pages. |
0 commit comments