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

Commit 2f2c52e

Browse files
authored
Merge pull request #569 from xxcxy/dev-maven
Dev maven
2 parents 5331dbe + f2dc360 commit 2f2c52e

File tree

6,949 files changed

+46742
-29331
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

6,949 files changed

+46742
-29331
lines changed

Dockerfile

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
FROM openjdk:7-alpine3.7
2+
3+
RUN apk add --update bash unzip tar wget
4+
5+
WORKDIR /data
6+
7+
RUN ["wget", "-O", "/data/jboss-4.2.3.zip", "http://downloads.sourceforge.net/project/jboss/JBoss/JBoss-4.2.3.GA/jboss-4.2.3.GA.zip?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fjboss%2Ffiles%2FJBoss%2FJBoss-4.2.3.GA"]
8+
9+
RUN ["unzip", "/data/jboss-4.2.3.zip"]
10+
11+
ENV JBOSS_HOME /data/jboss-4.2.3.GA
12+
13+
ADD ./jboss_files/myserver.keystore /data/jboss-4.2.3.GA/server/default/conf/
14+
ADD ./jboss_files/run.conf /data/jboss-4.2.3.GA/bin/
15+
ADD ./jboss_files/server.xml /data/jboss-4.2.3.GA/server/default/deploy/jboss-web.deployer/
16+
17+
ADD ./ear-web/target/direct /data/jboss-4.2.3.GA/server/default/deploy/direct.ear/
18+
ADD ./ear-web/target/conf/ /data/jboss-4.2.3.GA/server/default/conf/
19+
ADD ./ear-web/target/direct-ds.xml /data/jboss-4.2.3.GA/server/default/deploy/
20+
ADD ./jboss_files/lib /data/jboss-4.2.3.GA/server/default/lib
21+
ADD ./lib/third_party/jwt/commons-codec-1.9.jar /data/jboss-4.2.3.GA/server/default/lib/commons-codec.jar
22+
23+
ADD ./lib/third_party/aws-java-sdk/aws-java-sdk-1.0.004.jar /data/jboss-4.2.3.GA/server/default/lib/
24+
ADD ./lib/third_party/informix/ifxjdbc.jar /data/jboss-4.2.3.GA/server/default/lib/
25+
ADD ./lib/third_party/informix/ifxjdbcx.jar /data/jboss-4.2.3.GA/server/default/lib/
26+
ADD ./lib/third_party/jboss-cache/jboss-cache-jdk50.jar /data/jboss-4.2.3.GA/server/default/lib/
27+
ADD ./lib/third_party/jboss-cache/jgroups.jar /data/jboss-4.2.3.GA/server/default/lib/
28+
29+
ADD ./jboss_files/deploy/static.ear /data/jboss-4.2.3.GA/server/default/deploy/static.ear/
30+
ADD ./ear-web/target/static.war /data/jboss-4.2.3.GA/server/default/deploy/static.ear/static.war
31+
32+
ADD ./lib/tcs/security.ear /data/
33+
RUN ["unzip", "/data/security.ear", "-d", "/data/jboss-4.2.3.GA/server/default/deploy/security.ear"]
34+
35+
RUN mkdir /data/temp_files
36+
RUN rm /data/jboss-4.2.3.zip
37+
RUN rm /data/security.ear
38+
39+
CMD ["/data/jboss-4.2.3.GA/bin/run.sh", "-b0.0.0.0", "-Djboss.remoting.version=1"]

README.md

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,13 @@ direct-app
22
==========
33

44
## building
5-
To build, download the docker build container that has all of the build dependencies. You can then run the container to build your local source code.
5+
To build, you should have installed jdk7 and maven3
66

7-
1. Clone the github source directory
7+
1. Run `./install-third-dep.sh` to install all dependence
88
2. Rename `token.properties.docker` to `token.properties` in the source directory
9-
3. Rename `topcoder_global.properties.docker` to `topcoder_global.properties`
10-
4. Unzip [jboss-4.2.3.zip](http://downloads.sourceforge.net/project/jboss/JBoss/JBoss-4.2.3.GA/jboss-4.2.3.GA.zip?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fjboss%2Ffiles%2FJBoss%2FJBoss-4.2.3.GA%2F) in your root source directory. The build will place jboss deployment files here. It also needs some of its libraries for the build itself.
11-
5. Run the docker container to execute a build. The format of the command is `docker run --rm=true -v <source dir>:/data -t appiriodevops/tc-direct-app-build <ant target(s)>`.
9+
3. Run `mvn clean package -DskipTests=true` to build ear package
1210

13-
For example, `docker run --rm=true -v /Users/james/dev/topcoder/direct-app:/data -t appiriodevops/tc-direct-app-build clean package-direct deploy-prod`
14-
15-
> NOTE: the source directory should be writeable to Docker so use a directory under `/Users/<username>`
11+
> NOTE: the ear file is in the ear-web/target/
1612
1713
## running locally
1814
In this configuration, we'll run the direct app in a docker container locally but it unfortunately requires many dependencies so we'll need to run several containers and connect to the dev database. To run, follow these steps.
@@ -23,10 +19,10 @@ In this configuration, we'll run the direct app in a docker container locally bu
2319
2. Set the following environment variables:
2420
* TC_DEV_NAT_DIR : Local directory containing the pem file for accessing the dev NAT instance (used to create a tunnel to the dev informix instances)
2521
* TC_DIRECT_SRC_HOME : Local directory for the root direct-app directory
26-
3. Run `docker-compose up` from the `docker` subdirectory containing the `docker-compose.yml` file
22+
3. Run `docker-compose up` from the `root dir` containing the `docker-compose.yml` file
2723

2824

29-
This will start the app with an endpoint available on port 443. You can now go to https://docker.topcoder-dev.com/direct/enterpriseDashboard/activeContests.action
25+
This will start the app with an endpoint available on port 443. You can now go to https://docker.topcoder-dev.com/direct/allProjects.action
3026

3127
> NOTE: the SSL certificate is self-signed as will generate a warning/error when you access the site for the first time. Just accept it and continue.
3228
@@ -52,4 +48,13 @@ Deploy:
5248
* simply run 'ant deploy' to build all the components and the direct and deploy the direct to jboss
5349

5450

51+
## Summary of the changes for maven
52+
53+
1. Change `src/java/main` to `src/main/java`, `src/java/test` to `src/test/java` for all java modules
54+
2. Add `install-third-dep.sh` to install all dependence
55+
3. Add `pom.xml` to every java module
56+
4. Using `maven build` and `maven-resources-plugin` to build target file
57+
5. Move `root/src` to `root/app/src` to build `direct.war` file
58+
6. Add `ear-web` to build `direct.ear` and other packages that need to move to jboss
59+
7. Add `Dockerfile`, `docker-compose.yml` to root dir
5560

0 commit comments

Comments
 (0)