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

Commit 2bd80cb

Browse files
authored
Merge pull request #14 from deedee/svn2git
Rename tc-platform to tc-website and move httpd into its own image.
2 parents c154d50 + 6accd3c commit 2bd80cb

35 files changed

+2638
-129
lines changed

docker/tc-platform/docker-compose.yml

Lines changed: 0 additions & 43 deletions
This file was deleted.

docker/tc-platform/env.sh

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 43 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,68 @@
11
# Topcoder Website Local Deployment Using Docker
22

3-
## Build LDAP Image
4-
Use an existing docker file on [GitHub](https://github.com/appirio-tech/tc-common-tutorials/tree/master/docker) (use commit hash cfc5b80ead7f83a7d592e406ef3bd160889683c1).
5-
The README contains instructions on how to build the docker image.
6-
7-
The image is referenced in the provided docker-compose.yml file.
8-
93
## Docker Images for tc-website
104
The following docker images are defined:
11-
* base - located in base sub-directory, used as the base image for build and run images below.
5+
* base - located in base sub-directory, used as the base image forall images below.
126
* build - located in build sub-directory, used to create the jboss and tc website wars ready for deployment.
137
* run - located in run sub-directory used to run the jboss created by the build image to run the tc website.
8+
* httpd - located in httpd sub-directory used to create and run apache httpd server
149

1510
You need to run the following commands to build these images first:
1611
```
17-
# Go to the directory extracting this submission
12+
# Go to the directory *docker/tc-website* extracting this submission
1813
19-
docker build -t tc-website:base base
20-
docker build -t tc-website:build build
21-
docker build -t tc-website:run run
14+
docker build -t appiriodevops/tc-website:base base
15+
docker build -t appiriodevops/tc-website:build build
16+
docker build -t appiriodevops/tc-website:run run
17+
docker build -t appiriodevops/tc-website:httpd httpd
2218
```
2319

2420
## Prepare tc-website Codebase
2521
Pull following repos into a directory (e.g. tc-platform):
26-
- https://github.com/topcoder-platform/tc-website (with commit hash: f5e9ec2e9e7d99f012e308b530947ab034948ad6)
27-
- https://github.com/topcoder-platform/tc-website-external-artifacts (with commit hash: 33100ff8b102ee8a386c4200d571b6c31c33fad1)
28-
- https://github.com/topcoder-platform/tc-website-glue (with commit hash: 61849f3601a25efc40390a59eedd8d1dc92eb4ef)
29-
- https://github.com/topcoder-platform/tc-website-shared (with commit hash: fbbc0e49893bf972e46d7c73192a5592e39dab3b)
22+
- https://github.com/topcoder-platform/tc-website (with commit hash: f5e9ec2e9e7d99f012e308b530947ab034948ad6 branch: svn2git)
23+
- https://github.com/topcoder-platform/tc-website-external-artifacts (with commit hash: 33100ff8b102ee8a386c4200d571b6c31c33fad1 branch: svn2git)
24+
- https://github.com/topcoder-platform/tc-website-glue (with commit hash: 61849f3601a25efc40390a59eedd8d1dc92eb4ef branch: svn2git)
25+
- https://github.com/topcoder-platform/tc-website-shared (with commit hash: fbbc0e49893bf972e46d7c73192a5592e39dab3b branch: svn2git)
3026
- https://github.com/topcoder-platform/tc-website-static (with commit hash: fc26666a6ee3a323cdd8de9e849a2e576352a656)
27+
- https://github.com/appirio-tech/temp-maven-repo (with commit hash:
28+
ae8fe01f5b2f1aec9baa52dcff6d7bf02c5d93bf)
3129

32-
## Checkout tc-website
30+
## Checkout tc-website and all other repo
3331
```
34-
mkdir -p /home/tc/tc-platform
35-
cd /home/tc/tc-platform
32+
TC_WEBSITE_HOME=/home/tc/tc-platform
33+
mkdir -p $TC_WEBSITE_HOME
34+
cd $TC_WEBSITE_HOME
3635
git clone https://github.com/topcoder-platform/tc-website tc-website
3736
git clone https://github.com/topcoder-platform/tc-website-external-artifacts external-artifacts
3837
git clone https://github.com/topcoder-platform/tc-website-glue glue
3938
git clone https://github.com/topcoder-platform/tc-website-shared shared
40-
git clone https://github.com/topcoder-platform/tc-website-static static
39+
git clone https://github.com/topcoder-platform/tc-website-static
40+
git clone https://github.com/appirio-tech/temp-maven-repo
4141
```
4242

4343
## Deployment
4444
Update the configuration values in env.sh file from the submission:
45-
* TC_PLATFORM_SRC_ROOT - the root directory of the tc-platform codebase, point to the tc-platform directory above
46-
* DEPLOYMENT_DIR - the directory to put the jboss and the created wars.
45+
* TC_WEBSITE_HOME - the root directory of the tc-website codebase and all its required repos, point to the $TC_WEBSITE_HOME directory above
46+
* JBOSS_DEPLOYMENT_DIR - the directory to put the jboss and the created wars.
4747

4848
Run `source env.sh` to create the environment variables.
4949

5050
Then run `docker-compose up build-tc-website` to build the code and create jboss and tc-website wars.
5151

52-
Finally run `docker-compose up run-tc-website` to run the jboss created above and setup apache.
52+
Finally run `docker-compose up -d tc-httpd` to run the all required services. To view jboss log run
53+
`docker-compose logs -f run-tc-website`
54+
55+
> NOTE: docker-compose will create custom network with ip network is configurable on *networks* section on ```docker-compose.yml``` file
56+
> If you change this (subnet or gateway), make sure host ```env.topcoder.com``` on service ```run-tc-website``` point to ip address of gateway
57+
58+
## Setup circleci
59+
Grant circleci access to repo tc-website. If there are any specific configuration related to circleci put it under ```.deploy/circleci```. All files under that directory will be copied to tc-website root before testinf being executed.
5360

54-
The console is like this: http://take.ms/wPZwi when it's ready to access the tc-website.
61+
Any push action will trigger circleci build process.
5562

5663
## Verification
57-
Add the following entry to your hosts file:
58-
`<docker-ip> local.tc.cloud.topcoder.com`
64+
Add the following entry to your hosts file:
65+
`<docker-ip> local.tc.cloud.topcoder.com`
5966

6067
Where `<docker-ip>` is the ip address of your docker box. It should be set to `127.0.0.1` on Linux or `192.168.99.100` on Windows/macOS if you are using Docker Toolbox.
6168

@@ -67,34 +74,34 @@ Where `<docker-ip>` is the ip address of your docker box. It should be set to `1
6774
4. Now visit https://local.tc.cloud.topcoder.com/tc?module=MyHome - to switch from the main site back to docker.
6875

6976
You can now try the following pages:
70-
TC WAR:
77+
TC WAR:
7178
* Open https://local.tc.cloud.topcoder.com/tc?module=MyHome, the page is like: http://take.ms/TYP9F
7279
* Open https://local.tc.cloud.topcoder.com/tc?module=EditTheme, change to use old theme, the page is like: http://take.ms/efKBr
7380
* Open https://local.tc.cloud.topcoder.com/tc?module=ActiveContests&pt=39 (code active contests), the page is like: http://take.ms/RxSWZ
7481

75-
Note that the links like https://local.tc.cloud.topcoder.com/challenges/design/active won't work.
82+
Note that the links like https://local.tc.cloud.topcoder.com/challenges/design/active won't work.
7683

77-
Query WAR:
84+
Query WAR:
7885
* Open https://local.tc.cloud.topcoder.com/query/query, the page is like: http://take.ms/UvcrU
7986

80-
Admin WAR:
87+
Admin WAR:
8188
* Open https://local.tc.cloud.topcoder.com/admin/, the page is like: http://take.ms/nygny
8289
* Open https://local.tc.cloud.topcoder.com/admin/?module=TermsList, the page is like: http://take.ms/P061N
8390

84-
CORP WAR:
91+
CORP WAR:
8592
* Open https://local.tc.cloud.topcoder.com/corp/, the page is like: http://take.ms/d6tMF
8693

87-
Email WAR:
94+
Email WAR:
8895
* Open https://local.tc.cloud.topcoder.com/email/, the page is like: http://take.ms/BNbd5
8996

90-
Reg WAR:
97+
Reg WAR:
9198
* Open https://local.tc.cloud.topcoder.com/reg/, the page is like: http://take.ms/jkbVm
9299

93-
EP WAR:
100+
EP WAR:
94101
* Open https://local.tc.cloud.topcoder.com/ep, the page is like: http://take.ms/Nw1bV
95102

96-
Private Label WAR:
103+
Private Label WAR:
97104
* Open https://local.tc.cloud.topcoder.com/pl/, the page is like: http://take.ms/x3pr5
98105

99-
Note that you may receive HTTPS certificate warnings, just ignore it and proceed.
100-
And you can click around to try the other pages.
106+
Note that you may receive HTTPS certificate warnings, just ignore it and proceed.
107+
And you can click around to try the other pages.

docker/tc-platform/base/Dockerfile renamed to docker/tc-website/base/Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
FROM centos:6.8
22

33
# install tools
4-
RUN yum install -y unzip wget dos2unix
4+
RUN yum update -y && yum install -y unzip wget dos2unix
55

66
WORKDIR /root
77

@@ -22,9 +22,10 @@ ENV JAVA_HOME /usr/java/jdk1.7.0_79
2222
ENV ANT_HOME /root/apache-ant-1.7.1
2323
ENV PATH $JAVA_HOME/bin:$GRAILS_HOME/bin:$ANT_HOME/bin:$PATH
2424

25+
RUN chmod 701 /root
26+
2527
# remove useless files
2628
RUN rm /root/jdk-7u79-linux-x64.rpm
2729
RUN rm /root/apache-ant-1.7.1-bin.zip
2830
RUN rm /root/ant-contrib-1.0b2-bin.tar.gz
2931
RUN rm -rf /root/ant-contrib
30-

docker/tc-platform/build/Dockerfile renamed to docker/tc-website/build/Dockerfile

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM tc-website:base
1+
FROM appiriodevops/tc-website:base
22

33
WORKDIR /root
44

@@ -17,4 +17,16 @@ RUN chmod +x /root/build.sh
1717

1818
ENV JBOSS_HOME /root/deployment/jboss-4.0.4.GA
1919

20-
ENTRYPOINT ["/root/build.sh"]
20+
RUN mkdir -p /export/home/web
21+
RUN ln -s /root/tc-platform/tc-website /export/home/web/web
22+
23+
RUN mkdir -p /home/tc
24+
RUN ln -s /root/deployment/jboss-4.0.4.GA /home/tc/jboss-4.0.4.GA
25+
RUN ln -s /root/tc-platform/tc-website /home/tc/web
26+
27+
RUN mkdir -p /mnt/apache
28+
RUN ln -s /root/tc-platform/tc-website-static /mnt/apache/tcdocs
29+
30+
ENV SHARED_DIR /root/tc-platform/shared
31+
32+
ENTRYPOINT ["/root/build.sh"]

docker/tc-platform/build/build.sh renamed to docker/tc-website/build/build.sh

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
2+
set -e
33
# remove old jboss
44
rm -rf /root/deployment/jboss-4.0.4.GA
55

@@ -11,17 +11,12 @@ cp -f /root/files/jboss/jboss-service.xml $JBOSS_HOME/server/all/deploy/jbossweb
1111
cp -f /root/files/jboss/web.xml $JBOSS_HOME/server/all/deploy/jbossweb-tomcat55.sar/conf
1212

1313
cp -f /root/files/tc_informix-ds.xml $JBOSS_HOME/server/all/deploy
14-
cp -f /root/files/lib/ldap_sdk_interface.jar $JBOSS_HOME/server/all/lib
1514
cp -f /root/files/TC.prod.ldap.keystore $JBOSS_HOME/bin
1615
cp -f /root/files/resources/paymentRanges.xml $JBOSS_HOME/server/all/conf
1716

1817
# init code
1918
cp -f /root/files/resources/ApplicationServer.properties /root/tc-platform/tc-website/resources
20-
cp -f /root/files/resources/cache.properties /root/tc-platform/tc-website/resources
21-
cp -f /root/files/resources/LDAP.properties /root/tc-platform/tc-website/resources
2219
cp -f /root/files/distui/jboss-web.xml /root/tc-platform/tc-website/resources/distui
23-
cp -f /root/files/build_distui.xml /root/tc-platform/tc-website
24-
cp -f /root/files/build_tc.xml /root/tc-platform/tc-website
2520

2621
# deploy
2722
cd /root/tc-platform/tc-website

docker/tc-platform/build/files/resources/ApplicationServer.properties renamed to docker/tc-website/build/files/resources/ApplicationServer.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ FORUMS_SERVER_NAME=forums.dev.topcoder.com
1919
HOST_URL=localhost:1099
2020
FORUMS_HOST_URL=63.118.154.182:1099
2121
CONTEST_HOST_URL=63.118.154.180:10099
22-
BASE_DIR=/root/tc-platform/tc-website
22+
BASE_DIR=/export/home/web/web/
2323
XSL_CACHING=false
2424
SECURITY_PROVIDER_URL=localhost:1099
2525
TCS_APP_SERVER_URL=localhost:1299
2626
SESSION_ID_LENGTH=0
2727
FILE_CONVERSION_PROVIDER_URL=172.16.210.53:1099
2828
WEB_SERVER_ID=1
2929
JMS_HOST_URL=jnp://localhost:1699
30-
DISTRIBUTED_UI_SERVER_NAME = local.tc.cloud.topcoder.com
30+
DISTRIBUTED_UI_SERVER_NAME = local.tc.cloud.topcoder.com:8080
3131
OR_WEBSERVICES_SERVER_NAME = 63.118.154.186:8080
3232
WIKI_SERVER_NAME = local.tc.cloud.topcoder.com/wiki
3333
USER_SERVICES_HOST_URL=jnp://localhost:1099

0 commit comments

Comments
 (0)