Skip to content

Commit

Permalink
merging projects
Browse files Browse the repository at this point in the history
  • Loading branch information
tveronezi committed Oct 30, 2013
1 parent daf0afc commit 2d6fece
Show file tree
Hide file tree
Showing 67 changed files with 229 additions and 606 deletions.
4 changes: 1 addition & 3 deletions .gitignore
@@ -1,3 +1 @@
photodb-web/target/
photodb-gui/target/
photodb-resources/target/
target/
64 changes: 5 additions & 59 deletions Makefile
Expand Up @@ -12,67 +12,13 @@
# limitations under the License.
#

HOME_DIR=$(shell cd && pwd)
TOMEE_DIR=$(HOME_DIR)/TOMEE
PROJECT_NAME=photodb
TOMEE_ORIGINAL_DIR_NAME=apache-tomee-plus-1.6.0-SNAPSHOT

up-static:
rm -rf $(TOMEE_DIR)/tomee-runtime/webapps/$(PROJECT_NAME)/app
cp -r $(PROJECT_NAME)-gui/src/main/webapp/app $(TOMEE_DIR)/tomee-runtime/webapps/$(PROJECT_NAME)/
cp -r $(PROJECT_NAME)-gui/src/main/webapp/index.jsp $(TOMEE_DIR)/tomee-runtime/webapps/$(PROJECT_NAME)/index.jsp

up-war: kill-tomee clean-install
rm -f $(TOMEE_DIR)/tomee-runtime/webapps/$(PROJECT_NAME).war
rm -Rf $(TOMEE_DIR)/tomee-runtime/webapps/$(PROJECT_NAME)
cp ./$(PROJECT_NAME)-gui/target/$(PROJECT_NAME).war $(TOMEE_DIR)/tomee-runtime/webapps/

up-war-restart: up-war restart-tomee
rm -rf target/apache-tomee/webapps/photodb/app
cp -r src/main/webapp/app target/apache-tomee/webapps/photodb/

clean-start: start-tomee up-war

clean-install: kill-tomee
run:
mvn clean install -DskipTests=true
mvn tomee:run

unzip-tomee: kill-tomee clean-install
cd ./$(PROJECT_NAME)-resources/target && \
rm -Rf tomee-runtime && \
tar -xzf tomee-runtime.tar.gz && \
mv $(TOMEE_ORIGINAL_DIR_NAME) tomee-runtime
mkdir -p $(TOMEE_DIR)
rm -Rf $(TOMEE_DIR)/tomee-runtime
mv ./$(PROJECT_NAME)-resources/target/tomee-runtime $(TOMEE_DIR)/
cp ./$(PROJECT_NAME)-gui/target/$(PROJECT_NAME).war $(TOMEE_DIR)/tomee-runtime/webapps

kill-tomee:
@if test -f $(HOME_DIR)/tomee-pid.txt; then \
kill -9 `cat $(HOME_DIR)/tomee-pid.txt`; \
rm $(HOME_DIR)/tomee-pid.txt; \
fi

shutdown-tomee:
cd $(TOMEE_DIR)/tomee-runtime/ && \
./bin/shutdown.sh

start-tomee: unzip-tomee restart-tomee

tail:
tail -f $(TOMEE_DIR)/tomee-runtime/logs/catalina.out

restart-tomee: kill-tomee
cp -r ./src/main/config/localLoginScript.js $(TOMEE_DIR)/tomee-runtime/conf
export JPDA_SUSPEND=n && \
export CATALINA_PID=$(HOME_DIR)/tomee-pid.txt && \
export CATALINA_OPTS="-Djava.security.auth.login.config=$(shell pwd)/src/main/config/login.config" && \
cd $(TOMEE_DIR)/tomee-runtime/ && \
./bin/catalina.sh jpda start

run-jasmine:
cd ./$(PROJECT_NAME)-gui/ && mvn jasmine:bdd

run-lint:
cd ./$(PROJECT_NAME)-gui/ && mvn jslint4java:lint

.PHONY: up-war up-war-restart up-static clean-start clean-install unzip-tomee shutdown-tomee kill-tomee start-tomee \
restart-tomee run-jasmine run-lint tail
.PHONY: up-static run

22 changes: 3 additions & 19 deletions README.md
@@ -1,26 +1,10 @@
photodb
=======
=========

### Quick start ###

If you use a Unix-like OS with Makefile support, you can run the application by following these simple steps.
You can run the application by following these simple steps.

1. Checkout this source code
2. Go to the root of your application and run *make clean-start*
2. Go to the root of your application and run *mvn clean install tomee:run*
3. Open <http://localhost:8080/photodb>


### Makefile targets ###

* make up-static #It updates the "webapp/app" directory and the index.html/jsp file
* make up-war #It kills TomEE, rebuilds the application and installs the new application war file
* make up-war-restart #It calls "make up-war" followed by "make restart-tomee"
* make clean-install #Just an alias to mvn clean install -DskipTests=true
* make unzip-tomee #It unzips the latest TomEE installed in your mvn repository
* make start-tomee
* make kill-tomee #It calls kill -9 <TomEE process id>
* make clean-start #The same as "make clean-install" followed by "make start-tomee"
* make restart-tomee #It starts TomEE without a new build of your application
* make tail #It tails the catalina.out file
* make run-jasmine
* make run-lint #Please note that lint will run during the "mvn install" phase
148 changes: 0 additions & 148 deletions photodb-gui/pom.xml

This file was deleted.

29 changes: 0 additions & 29 deletions photodb-gui/src/test/javascript/test/I18N.js

This file was deleted.

45 changes: 0 additions & 45 deletions photodb-gui/src/test/resources/start.js

This file was deleted.

20 changes: 0 additions & 20 deletions photodb-gui/src/test/resources/test_config.js

This file was deleted.

0 comments on commit 2d6fece

Please sign in to comment.