From 8e382cd01ee30b6cf6710b8b87c10206866854d9 Mon Sep 17 00:00:00 2001 From: Template builder Date: Tue, 29 Mar 2016 23:07:55 -0400 Subject: [PATCH] Creating template --- .openshift/action_hooks/README.md | 3 + .openshift/config/modules/README | 18 + .openshift/config/standalone.xml | 529 ++++++++++++++++++++++ .openshift/cron/README.cron | 23 + .openshift/cron/daily/.gitignore | 0 .openshift/cron/hourly/.gitignore | 0 .openshift/cron/minutely/.gitignore | 0 .openshift/cron/monthly/.gitignore | 0 .openshift/cron/weekly/README | 16 + .openshift/cron/weekly/chrono.dat | 1 + .openshift/cron/weekly/chronograph | 3 + .openshift/cron/weekly/jobs.allow | 12 + .openshift/cron/weekly/jobs.deny | 7 + .openshift/markers/java8 | 0 README.md | 3 + deployments/.gitkeep | 0 pom.xml | 50 ++ src/main/java/.gitkeep | 0 src/main/resources/.gitkeep | 0 src/main/webapp/WEB-INF/web.xml | 11 + src/main/webapp/images/jbosscorp_logo.png | Bin 0 -> 1914 bytes src/main/webapp/index.html | 301 ++++++++++++ src/main/webapp/snoop.jsp | 283 ++++++++++++ 23 files changed, 1260 insertions(+) create mode 100644 .openshift/action_hooks/README.md create mode 100755 .openshift/config/modules/README create mode 100644 .openshift/config/standalone.xml create mode 100644 .openshift/cron/README.cron create mode 100644 .openshift/cron/daily/.gitignore create mode 100644 .openshift/cron/hourly/.gitignore create mode 100644 .openshift/cron/minutely/.gitignore create mode 100644 .openshift/cron/monthly/.gitignore create mode 100644 .openshift/cron/weekly/README create mode 100644 .openshift/cron/weekly/chrono.dat create mode 100755 .openshift/cron/weekly/chronograph create mode 100644 .openshift/cron/weekly/jobs.allow create mode 100644 .openshift/cron/weekly/jobs.deny create mode 100644 .openshift/markers/java8 create mode 100644 README.md create mode 100644 deployments/.gitkeep create mode 100644 pom.xml create mode 100644 src/main/java/.gitkeep create mode 100644 src/main/resources/.gitkeep create mode 100644 src/main/webapp/WEB-INF/web.xml create mode 100644 src/main/webapp/images/jbosscorp_logo.png create mode 100644 src/main/webapp/index.html create mode 100644 src/main/webapp/snoop.jsp diff --git a/.openshift/action_hooks/README.md b/.openshift/action_hooks/README.md new file mode 100644 index 0000000..2f33795 --- /dev/null +++ b/.openshift/action_hooks/README.md @@ -0,0 +1,3 @@ +For information about action hooks supported by OpenShift, consult the documentation: + +https://github.com/openshift/origin-server/tree/master/node/README.writing_applications.md#action-hooks diff --git a/.openshift/config/modules/README b/.openshift/config/modules/README new file mode 100755 index 0000000..fe11a3a --- /dev/null +++ b/.openshift/config/modules/README @@ -0,0 +1,18 @@ +Place your WildFly 10 modules in this directory. This directory is added to the +module path of the WildFly 10 server associated with your application. It has the +same structure as the standard WildFly 10 modules directory. + +The modules placed in this directory will be added to or override the default modules +provided by the OpenShift WildFly 10 cartridge. + +Scenarios: +1) Replace a default module with a new module that contains a bug fix or new feature +2) Add a module that does not exist in the base OpenShift WildFly 10 cartridge in order to add +a new component. Typically these new modules will need to be enabled and configured in +standalone.xml + +Unless one of the above scenarios is required there is no need to modify the +modules directory. + +NOTE: Replacing default modules as in scenario 1 can cause conflicts between modules so +should be done with caution and adequate testing. diff --git a/.openshift/config/standalone.xml b/.openshift/config/standalone.xml new file mode 100644 index 0000000..f60fa74 --- /dev/null +++ b/.openshift/config/standalone.xml @@ -0,0 +1,529 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE + h2 + + sa + sa + + + + jdbc:mysql://${env.OPENSHIFT_MYSQL_DB_HOST}:${env.OPENSHIFT_MYSQL_DB_PORT}/${env.OPENSHIFT_APP_NAME} + mysql + + ${env.OPENSHIFT_MYSQL_DB_USERNAME} + ${env.OPENSHIFT_MYSQL_DB_PASSWORD} + + + SELECT 1 + true + 60000 + + + + IdleConnections + + + + jdbc:postgresql://${env.OPENSHIFT_POSTGRESQL_DB_HOST}:${env.OPENSHIFT_POSTGRESQL_DB_PORT}/${env.OPENSHIFT_APP_NAME} + postgresql + + ${env.OPENSHIFT_POSTGRESQL_DB_USERNAME} + ${env.OPENSHIFT_POSTGRESQL_DB_PASSWORD} + + + SELECT 1 + true + 60000 + + + + IdleConnections + + + + + org.h2.jdbcx.JdbcDataSource + + + com.mysql.jdbc.jdbc2.optional.MysqlXADataSource + + + org.postgresql.xa.PGXADataSource + + + + + + + + + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ${env.OPENSHIFT_GEAR_DNS} + ${env.OPENSHIFT_WILDFLY_CLUSTER_PROXY_PORT} + ${env.OPENSHIFT_WILDFLY_CLUSTER_PORT} + ${env.OPENSHIFT_WILDFLY_IP} + true + + + ${env.OPENSHIFT_WILDFLY_CLUSTER} + 0 + + + + + + + + + org.jgroups.auth.MD5Token + SHA + ${env.OPENSHIFT_SECRET_TOKEN} + + + 30000 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ${jboss.bind.address:127.0.0.1} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.openshift/cron/README.cron b/.openshift/cron/README.cron new file mode 100644 index 0000000..9b31029 --- /dev/null +++ b/.openshift/cron/README.cron @@ -0,0 +1,23 @@ +Run scripts or jobs on a periodic basis +======================================= +Any scripts or jobs added to the minutely, hourly, daily, weekly or monthly +directories will be run on a scheduled basis (frequency is as indicated by the +name of the directory) using run-parts. + +run-parts ignores any files that are hidden or dotfiles (.*) or backup +files (*~ or *,) or named *.{rpmsave,rpmorig,rpmnew,swp,cfsaved} + +The presence of two specially named files jobs.deny and jobs.allow controls +how run-parts executes your scripts/jobs. + jobs.deny ===> Prevents specific scripts or jobs from being executed. + jobs.allow ===> Only execute the named scripts or jobs (all other/non-named + scripts that exist in this directory are ignored). + +The principles of jobs.deny and jobs.allow are the same as those of cron.deny +and cron.allow and are described in detail at: + http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Deployment_Guide/ch-Automating_System_Tasks.html#s2-autotasks-cron-access + +See: man crontab or above link for more details and see the the weekly/ + directory for an example. + +PLEASE NOTE: The Cron cartridge must be installed in order to run the configured jobs. diff --git a/.openshift/cron/daily/.gitignore b/.openshift/cron/daily/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/.openshift/cron/hourly/.gitignore b/.openshift/cron/hourly/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/.openshift/cron/minutely/.gitignore b/.openshift/cron/minutely/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/.openshift/cron/monthly/.gitignore b/.openshift/cron/monthly/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/.openshift/cron/weekly/README b/.openshift/cron/weekly/README new file mode 100644 index 0000000..7c3e659 --- /dev/null +++ b/.openshift/cron/weekly/README @@ -0,0 +1,16 @@ +Run scripts or jobs on a weekly basis +===================================== +Any scripts or jobs added to this directory will be run on a scheduled basis +(weekly) using run-parts. + +run-parts ignores any files that are hidden or dotfiles (.*) or backup +files (*~ or *,) or named *.{rpmsave,rpmorig,rpmnew,swp,cfsaved} and handles +the files named jobs.deny and jobs.allow specially. + +In this specific example, the chronograph script is the only script or job file +executed on a weekly basis (due to white-listing it in jobs.allow). And the +README and chrono.dat file are ignored either as a result of being black-listed +in jobs.deny or because they are NOT white-listed in the jobs.allow file. + +For more details, please see ../README.cron file. + diff --git a/.openshift/cron/weekly/chrono.dat b/.openshift/cron/weekly/chrono.dat new file mode 100644 index 0000000..fc4abb8 --- /dev/null +++ b/.openshift/cron/weekly/chrono.dat @@ -0,0 +1 @@ +Time And Relative D...n In Execution (Open)Shift! diff --git a/.openshift/cron/weekly/chronograph b/.openshift/cron/weekly/chronograph new file mode 100755 index 0000000..5b03fa8 --- /dev/null +++ b/.openshift/cron/weekly/chronograph @@ -0,0 +1,3 @@ +#!/bin/bash + +echo "$(date): $(cat $(dirname \"$0\")/chrono.dat)" diff --git a/.openshift/cron/weekly/jobs.allow b/.openshift/cron/weekly/jobs.allow new file mode 100644 index 0000000..8d32abc --- /dev/null +++ b/.openshift/cron/weekly/jobs.allow @@ -0,0 +1,12 @@ +# +# Script or job files listed in here (one entry per line) will be +# executed on a weekly-basis. +# +# Example: The chronograph script will be executed weekly but the README +# and chrono.dat files in this directory will be ignored. +# +# The README file is actually ignored due to the entry in the +# jobs.deny which is checked before jobs.allow (this file). +# +chronograph + diff --git a/.openshift/cron/weekly/jobs.deny b/.openshift/cron/weekly/jobs.deny new file mode 100644 index 0000000..73c9450 --- /dev/null +++ b/.openshift/cron/weekly/jobs.deny @@ -0,0 +1,7 @@ +# +# Any script or job files listed in here (one entry per line) will NOT be +# executed (read as ignored by run-parts). +# + +README + diff --git a/.openshift/markers/java8 b/.openshift/markers/java8 new file mode 100644 index 0000000..e69de29 diff --git a/README.md b/README.md new file mode 100644 index 0000000..7fe58e7 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +The OpenShift `jbossas` cartridge documentation can be found at: + +https://github.com/openshift/origin-server/tree/master/cartridges/openshift-origin-cartridge-jbossas/README.md diff --git a/deployments/.gitkeep b/deployments/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..57f212e --- /dev/null +++ b/pom.xml @@ -0,0 +1,50 @@ + + + 4.0.0 + + cardgame + cardgame + war + 1.0 + cardgame + + + UTF-8 + 1.8 + 1.8 + + + + + javax + javaee-api + 7.0 + provided + + + + + + + + + + openshift + + cardgame + + + org.apache.maven.plugins + maven-war-plugin + 2.3 + + false + deployments + ROOT + + + + + + + diff --git a/src/main/java/.gitkeep b/src/main/java/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/src/main/resources/.gitkeep b/src/main/resources/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/src/main/webapp/WEB-INF/web.xml b/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000..421eb46 --- /dev/null +++ b/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,11 @@ + + + + + + + diff --git a/src/main/webapp/images/jbosscorp_logo.png b/src/main/webapp/images/jbosscorp_logo.png new file mode 100644 index 0000000000000000000000000000000000000000..bfa0447f62e03a24f54f2e29b336056d97b68bd0 GIT binary patch literal 1914 zcmV-=2Zi{FP)T`2%VPRakxwqwif6^cz+)z-NnVFK3j`F|1?4O_FZ*Twq z|Mkz$*VoqBKtRtB5Qm3^=74~&udT$y!uj9d{O|A9FfiX>VCj#KYHDTgudnv@_2J>* z#l^jSeR-y)qs+|AjEscll$7FdaJssV>IRB3Hx05&f;FEBa0Z_)(-00vG;L_t(&fz6ufwxTc$fa^tBij|#$2uD1} z<^7*<+R~P`Y&u@N_Q%{Y0{KjnG>HQA(!x6%6sOnjd47R~_j8EVmj$3}_a`vWCaS}O ze0>Dn%Krey?^H*UCgd>3&%@w|>kdtrmG)^4h8srN7O_o-nY&hk*-044CAf3oavhdg zn4^S|mcS)(p=2eNS(sd~*lTH@g~7)#4EsEomDgZc26p_> z3*l~J`M+?4*V}YkFPEKiC17&dJG^}V+}b<>)I6GBfqDDHi0e3Q>-d*o-YmCb6sKq8 z{Tj?$0r-RB;DXM-2J@C_(k4TfCjD=i0}9GGUjs{4(p& zZh9R6Ia0y?9T@5}b!zqN(S7XTp~$R?GS;ptvf5h0_=<+PV_;#M=O&NLGa%x|Y1@IVPsyfHh!zg_(%3}X>Shyzq-+-2jq`+H%Jh=+T_caaAgu$6~8|7#hr$B0`$W>+^{C5PHF zVUW_rud7%T-I*x8bC|vI$hpL|bR1y*xp|}-juB@vWP}B)HZXO7JdzKz=PCgMCJMVH z4SNj~>k}&s{O89@14g98`q|y8M4%shM6<`sWS$WpCTB`qAs6Zl3lZHHT~xU;?EyY3 zQ=3{te>e++PGXN)Xox5kFoSp}w8FjR64{y^l&2&a>tat&!H9soreiQfwWn)NX{LVY zvOs~ESnws7khzJ+g|&o1G>p`!W{$JTTE%APr(q)YLY&T#2_p`tl3C`5OSxmj^0MY8 ztkEB#K`Sg?%_+vkY?ugLMsuvW^b%4_R%4i%5CyL(yFSs4x}N&oebY zoMvJ2q0W2?=7esRxhh%Uc;p!1un%sG%1u)dXs!yA@5zqX`$0W3I0LR|0_KVaM*#is zwGqQ)U7CTYsudVHV;yw1rLM9><1kToqh3U?jc81oY?$;aQ5^%7W#p(#B1I*AcLXLp zibGAUG2QOt)*4~ld5Ts{xP95#CknO(X9D&e7F0#)GnIa#Eg$N4TwI#Vs`z%7qWb2Y zJ7-Cy@Setu`|M@?g%n0DJZDRq)fX^|y{DVHbzqN@nNqdu6x zei??&ajgmZ7>v?n>ffjD#2e+CQ|K39^eRD`0r&MTuvc-X5txIXl0}56ETpzsW2;7B zb~;SN#d}?>ba8`e0?HwT1KZ^t|AGF&$}eHCymAD_tmV3E2gSJzw7?oXA{lXh#It)y zhqO>h^`V^FJ^|C+b~It+DK-W}M}9}+%lZF;F^X`2M-k=r5tx*YRBJZw==#}&Z6Y01 zlK^zc15P&Bn=o_$9p-2s+2ZFyBQS;y_zxj$6Gq+{SYF_gZuv~QAJ6My4y4)eBmY#C zBw3Us$#a;HaSFLB>AyKky0Y(3_3V9%9zX9GIErO0I;=i9!>G z9LG_}ObDi + + + + + Welcome to OpenShift + + + + + + +
+
+

Welcome to your WildFly 10 application on OpenShift

+
+ + +
+
+
+

Deploying code changes

+

OpenShift uses the Git version control system for your source code, and grants you access to it via the Secure Shell (SSH) protocol. In order to upload and download code to your application you need to give us your public SSH key. You can upload it within the web console or install the RHC command line tool and run rhc setup to generate and upload your key automatically.

+ +

Working in your local Git repository

+

If you created your application from the command line and uploaded your SSH key, rhc will automatically download a copy of that source code repository (Git calls this 'cloning') to your local system.

+ +

If you created the application from the web console, you'll need to manually clone the repository to your local system. Copy the application's source code Git URL and then run:

+ +
$ git clone <git_url> <directory_to_create>
+
+# Within your project directory
+# Commit your changes and push to OpenShift
+
+$ git commit -a -m 'Some commit message'
+$ git push
+ + +

Sample Applications

+ To get started you can either modify the default war or try one of these samples: + + +

Example usage

+
+cd kitchensink
+git remote add upstream -m master git://github.com/openshift/kitchensink-example.git
+git pull -s recursive -X theirs upstream master
+ +
+ + +
+
+ +

Managing your application

+ +

Web Console

+

You can use the OpenShift web console to enable additional capabilities via cartridges, add collaborator access authorizations, designate custom domain aliases, and manage domain memberships.

+ +

Command Line Tools

+

Installing the OpenShift RHC client tools allows you complete control of your cloud environment. Read more on how to manage your application from the command line in our User Guide. +

+ +

Development Resources

+

JBoss Developer Studio

+

+ The JBoss Developer Studio is a full featured IDE with OpenShift integration built in. + It gives you the ability to create, edit and deploy applications without having to + leave the IDE. Links to download, install and use the JBoss Developer Studio for Linux, + Mac OS X, or Windows can be found on the + JBoss Developer Studio tools page. +

+

Debugging

+

View debugging information about the server environment including memory pools.

+ + + + + + +
+
+ +
+ +
+
+ + + + diff --git a/src/main/webapp/snoop.jsp b/src/main/webapp/snoop.jsp new file mode 100644 index 0000000..bb37d8f --- /dev/null +++ b/src/main/webapp/snoop.jsp @@ -0,0 +1,283 @@ + + + JBossAS7 JSP snoop page + <%@ page import="javax.servlet.http.HttpUtils,java.util.Enumeration" %> + <%@ page import="java.lang.management.*" %> + <%@ page import="java.util.*" %> + + + +

WebApp JSP Snoop page

+ + +

JVM Memory Monitor

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

Memory MXBean

+
Heap Memory Usage +<%=ManagementFactory.getMemoryMXBean().getHeapMemoryUsage()%> +
Non-Heap Memory Usage +<%=ManagementFactory.getMemoryMXBean().getNonHeapMemoryUsage()%> +
+

Memory Pool MXBeans

+
+<% +Iterator iter = ManagementFactory.getMemoryPoolMXBeans().iterator(); +while (iter.hasNext()) { +MemoryPoolMXBean item = (MemoryPoolMXBean) iter.next(); +%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
<%= item.getName() %>
Type<%= item.getType() %>
Usage<%= item.getUsage() %>
Peak Usage<%= item.getPeakUsage() %>
Collection Usage<%= item.getCollectionUsage() %>
+ + +<% +} +%> + +

Request information

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Requested URL:<%= HttpUtils.getRequestURL(request) %>
Request method:<%= request.getMethod() %>
Request URI:<%= request.getRequestURI() %>
Request protocol:<%= request.getProtocol() %>
Servlet path:<%= request.getServletPath() %>
Path info:<%= request.getPathInfo() %>
Path translated:<%= request.getPathTranslated() %>
Query string:<% if(request.getQueryString()!=null) out.write(request.getQueryString().replaceAll("<", "<").replaceAll(">",">")); %>
Content length:<%= request.getContentLength() %>
Content type:<%= request.getContentType() %>
Server name:<%= request.getServerName() %>
Server port:<%= request.getServerPort() %>
Remote user:<%= request.getRemoteUser() %>
Remote address:<%= request.getRemoteAddr() %>
Remote host:<%= request.getRemoteHost() %>
Authorization scheme:<%= request.getAuthType() %>
+ +<% + Enumeration e = request.getHeaderNames(); + if(e != null && e.hasMoreElements()) { +%> +

Request headers

+ + + + + + +<% + while(e.hasMoreElements()) { + String k = (String) e.nextElement(); +%> + + + + +<% + } +%> +
Header:Value:
<%= k %><%= request.getHeader(k) %>
+<% + } +%> + + +<% + e = request.getParameterNames(); + if(e != null && e.hasMoreElements()) { +%> +

Request parameters

+ + + + + + +<% + while(e.hasMoreElements()) { + String k = (String) e.nextElement(); + String val = request.getParameter(k); + String vals[] = request.getParameterValues(k); +%> + + + + + +<% + } +%> +
Parameter:Value:Multiple values:
<%= k.replaceAll("<", "<").replaceAll(">",">") %><%= val.replaceAll("<", "<").replaceAll(">",">") %><% + for(int i = 0; i < vals.length; i++) { + if(i > 0) + out.print("
"); + out.print(vals[i].replaceAll("<", "<").replaceAll(">",">")); + } + %>
+<% + } +%> + + +<% + e = request.getAttributeNames(); + if(e != null && e.hasMoreElements()) { +%> +

Request Attributes

+ + + + + +<% + while(e.hasMoreElements()) { + String k = (String) e.nextElement(); + Object val = request.getAttribute(k); +%> + + + + +<% + } +%> +
Attribute:Value:
<%= k.replaceAll("<", "<").replaceAll(">",">") %><%= val.toString().replaceAll("<", "<").replaceAll(">",">") %>
+<% + } +%> + + +<% + e = getServletConfig().getInitParameterNames(); + if(e != null && e.hasMoreElements()) { +%> +

Init parameters

+ + + + + +<% + while(e.hasMoreElements()) { + String k = (String) e.nextElement(); + String val = getServletConfig().getInitParameter(k); +%> + + + + +<% + } +%> +
Parameter:Value:
<%= k %><%= val %>
+<% + } +%> + + + +