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

Dev maven #569

Merged
merged 21 commits into from
Jul 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
39 changes: 39 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
FROM openjdk:7-alpine3.7

RUN apk add --update bash unzip tar wget

WORKDIR /data

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"]

RUN ["unzip", "/data/jboss-4.2.3.zip"]

ENV JBOSS_HOME /data/jboss-4.2.3.GA

ADD ./jboss_files/myserver.keystore /data/jboss-4.2.3.GA/server/default/conf/
ADD ./jboss_files/run.conf /data/jboss-4.2.3.GA/bin/
ADD ./jboss_files/server.xml /data/jboss-4.2.3.GA/server/default/deploy/jboss-web.deployer/

ADD ./ear-web/target/direct /data/jboss-4.2.3.GA/server/default/deploy/direct.ear/
ADD ./ear-web/target/conf/ /data/jboss-4.2.3.GA/server/default/conf/
ADD ./ear-web/target/direct-ds.xml /data/jboss-4.2.3.GA/server/default/deploy/
ADD ./jboss_files/lib /data/jboss-4.2.3.GA/server/default/lib
ADD ./lib/third_party/jwt/commons-codec-1.9.jar /data/jboss-4.2.3.GA/server/default/lib/commons-codec.jar

ADD ./lib/third_party/aws-java-sdk/aws-java-sdk-1.0.004.jar /data/jboss-4.2.3.GA/server/default/lib/
ADD ./lib/third_party/informix/ifxjdbc.jar /data/jboss-4.2.3.GA/server/default/lib/
ADD ./lib/third_party/informix/ifxjdbcx.jar /data/jboss-4.2.3.GA/server/default/lib/
ADD ./lib/third_party/jboss-cache/jboss-cache-jdk50.jar /data/jboss-4.2.3.GA/server/default/lib/
ADD ./lib/third_party/jboss-cache/jgroups.jar /data/jboss-4.2.3.GA/server/default/lib/

ADD ./jboss_files/deploy/static.ear /data/jboss-4.2.3.GA/server/default/deploy/static.ear/
ADD ./ear-web/target/static.war /data/jboss-4.2.3.GA/server/default/deploy/static.ear/static.war

ADD ./lib/tcs/security.ear /data/
RUN ["unzip", "/data/security.ear", "-d", "/data/jboss-4.2.3.GA/server/default/deploy/security.ear"]

RUN mkdir /data/temp_files
RUN rm /data/jboss-4.2.3.zip
RUN rm /data/security.ear

CMD ["/data/jboss-4.2.3.GA/bin/run.sh", "-b0.0.0.0", "-Djboss.remoting.version=1"]
25 changes: 15 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,13 @@ direct-app
==========

## building
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.
To build, you should have installed jdk7 and maven3

1. Clone the github source directory
1. Run `./install-third-dep.sh` to install all dependence
2. Rename `token.properties.docker` to `token.properties` in the source directory
3. Rename `topcoder_global.properties.docker` to `topcoder_global.properties`
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.
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)>`.
3. Run `mvn clean package -DskipTests=true` to build ear package

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`

> NOTE: the source directory should be writeable to Docker so use a directory under `/Users/<username>`
> NOTE: the ear file is in the ear-web/target/

## running locally
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.
Expand All @@ -23,10 +19,10 @@ In this configuration, we'll run the direct app in a docker container locally bu
2. Set the following environment variables:
* 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)
* TC_DIRECT_SRC_HOME : Local directory for the root direct-app directory
3. Run `docker-compose up` from the `docker` subdirectory containing the `docker-compose.yml` file
3. Run `docker-compose up` from the `root dir` containing the `docker-compose.yml` file


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
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

> 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.

Expand All @@ -52,4 +48,13 @@ Deploy:
* simply run 'ant deploy' to build all the components and the direct and deploy the direct to jboss


## Summary of the changes for maven

1. Change `src/java/main` to `src/main/java`, `src/java/test` to `src/test/java` for all java modules
2. Add `install-third-dep.sh` to install all dependence
3. Add `pom.xml` to every java module
4. Using `maven build` and `maven-resources-plugin` to build target file
5. Move `root/src` to `root/app/src` to build `direct.war` file
6. Add `ear-web` to build `direct.ear` and other packages that need to move to jboss
7. Add `Dockerfile`, `docker-compose.yml` to root dir

Loading