From 0b46187ac52d2d37daedcf7164430a9b557db05b Mon Sep 17 00:00:00 2001 From: Template builder Date: Mon, 15 Sep 2014 11:34:44 -0400 Subject: [PATCH 1/5] Creating template --- .openshift/README.md | 3 + .openshift/action_hooks/README.md | 3 + .openshift/action_hooks/stop | 1 - .openshift/cron/README.cron | 27 +++ .openshift/markers/README.md | 3 + README.md | 2 +- diy/index.html | 279 ++++++++++++++++++++++++++++++ diy/testrubyserver.rb | 14 ++ misc/.gitkeep | 0 9 files changed, 330 insertions(+), 2 deletions(-) create mode 100644 .openshift/README.md create mode 100644 .openshift/action_hooks/README.md create mode 100644 .openshift/cron/README.cron create mode 100644 .openshift/markers/README.md create mode 100644 diy/index.html create mode 100755 diy/testrubyserver.rb create mode 100644 misc/.gitkeep diff --git a/.openshift/README.md b/.openshift/README.md new file mode 100644 index 00000000..7ec66d79 --- /dev/null +++ b/.openshift/README.md @@ -0,0 +1,3 @@ +For information about .openshift directory, consult the documentation: + +http://openshift.github.io/documentation/oo_user_guide.html#the-openshift-directory diff --git a/.openshift/action_hooks/README.md b/.openshift/action_hooks/README.md new file mode 100644 index 00000000..54131958 --- /dev/null +++ b/.openshift/action_hooks/README.md @@ -0,0 +1,3 @@ +For information about action hooks, consult the documentation: + +http://openshift.github.io/documentation/oo_user_guide.html#action-hooks diff --git a/.openshift/action_hooks/stop b/.openshift/action_hooks/stop index c6bb29af..77d10b73 100755 --- a/.openshift/action_hooks/stop +++ b/.openshift/action_hooks/stop @@ -5,4 +5,3 @@ then client_result "Application is already stopped" else kill `ps -ef | grep commafeed | grep -v grep | awk '{ print $2 }'` > /dev/null 2>&1 -fi diff --git a/.openshift/cron/README.cron b/.openshift/cron/README.cron new file mode 100644 index 00000000..ac77f787 --- /dev/null +++ b/.openshift/cron/README.cron @@ -0,0 +1,27 @@ +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. + +For more information about cron, consult the documentation: +http://openshift.github.io/documentation/oo_cartridge_guide.html#cron +http://openshift.github.io/documentation/oo_user_guide.html#cron diff --git a/.openshift/markers/README.md b/.openshift/markers/README.md new file mode 100644 index 00000000..45814da3 --- /dev/null +++ b/.openshift/markers/README.md @@ -0,0 +1,3 @@ +For information about markers, consult the documentation: + +http://openshift.github.io/documentation/oo_user_guide.html#markers diff --git a/README.md b/README.md index 6d64d4ba..13016281 100644 --- a/README.md +++ b/README.md @@ -94,4 +94,4 @@ Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and -limitations under the License. \ No newline at end of file +limitations under the License. diff --git a/diy/index.html b/diy/index.html new file mode 100644 index 00000000..58caef0b --- /dev/null +++ b/diy/index.html @@ -0,0 +1,279 @@ + + + + + + Welcome to OpenShift + + + + +
+
+

Welcome to your Do-It-Yourself application on OpenShift

+
+

+ Do-It-Yourself is an experimental cartridge that provides a way to try unsupported languages, frameworks, and middleware on OpenShift. + To get started, add your framework of choice and modify .openshift/action_hooks/{start, stop} + to start and stop your application. + The only restriction is that your application should bind to $OPENSHIFT_DIY_IP:8080 + Don't forget to stop the existing server that is running before you push your stop file. +

+ +
+
+
+

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

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

+ + + +
+
+ + +
+ +
+
+ + + diff --git a/diy/testrubyserver.rb b/diy/testrubyserver.rb new file mode 100755 index 00000000..e9ef1156 --- /dev/null +++ b/diy/testrubyserver.rb @@ -0,0 +1,14 @@ +#!/usr/bin/env ruby +require 'webrick' +include WEBrick + +config = {} +config.update(:Port => 8080) +config.update(:BindAddress => ARGV[0]) +config.update(:DocumentRoot => ARGV[1]) +server = HTTPServer.new(config) +['INT', 'TERM'].each {|signal| + trap(signal) {server.shutdown} +} + +server.start diff --git a/misc/.gitkeep b/misc/.gitkeep new file mode 100644 index 00000000..e69de29b From a4cc65c6a4b169e5ba2f56c79a8f6cf7c8bd2150 Mon Sep 17 00:00:00 2001 From: fabianofranz Date: Wed, 17 Sep 2014 00:56:37 -0300 Subject: [PATCH 2/5] Removed parenthesis from counter labels --- src/main/app/js/directives.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/app/js/directives.js b/src/main/app/js/directives.js index 192f160f..a75871ce 100644 --- a/src/main/app/js/directives.js +++ b/src/main/app/js/directives.js @@ -193,7 +193,7 @@ module.directive('category', [function() { }); var label = ''; if (count > 0) { - label = '(' + count + ')'; + label = count; } return label; }; @@ -201,7 +201,7 @@ module.directive('category', [function() { $scope.feedCountLabel = function(feed) { var label = ''; if (feed.unread > 0) { - label = '(' + feed.unread + ')'; + label = feed.unread; } return label; }; @@ -358,4 +358,4 @@ module.directive('metricGauge', function() { restrict : 'E', templateUrl : 'templates/_metrics.gauge.html' }; -}); \ No newline at end of file +}); From 49b9e3f2784e9c090f7863727c1ed8988ac3e104 Mon Sep 17 00:00:00 2001 From: fabianofranz Date: Wed, 17 Sep 2014 13:14:25 -0300 Subject: [PATCH 3/5] Fixes OpenShift stop script which caused issues with git push --- .openshift/action_hooks/stop | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.openshift/action_hooks/stop b/.openshift/action_hooks/stop index 77d10b73..3cbaaff0 100755 --- a/.openshift/action_hooks/stop +++ b/.openshift/action_hooks/stop @@ -1,7 +1,8 @@ #!/bin/bash source $OPENSHIFT_CARTRIDGE_SDK_BASH -if [ -z "$(ps -ef | grep commafeed | grep -v grep)" ] +if [ -z "$(ps -ef | grep commafeed.jar | grep -v grep)" ] then client_result "Application is already stopped" else - kill `ps -ef | grep commafeed | grep -v grep | awk '{ print $2 }'` > /dev/null 2>&1 + kill `ps -ef | grep commafeed.jar | grep -v grep | awk '{ print $2 }'` > /dev/null 2>&1 +fi From 0ff630b8bd66c8f6e97de25a32bc18f79e72d1b0 Mon Sep 17 00:00:00 2001 From: fabianofranz Date: Wed, 17 Sep 2014 13:21:51 -0300 Subject: [PATCH 4/5] Parenthesis in unread-counter is now on CSS --- src/main/app/js/directives.js | 4 ++-- src/main/app/sass/components/_subscription-list.scss | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main/app/js/directives.js b/src/main/app/js/directives.js index a75871ce..463877c5 100644 --- a/src/main/app/js/directives.js +++ b/src/main/app/js/directives.js @@ -193,7 +193,7 @@ module.directive('category', [function() { }); var label = ''; if (count > 0) { - label = count; + label += count; } return label; }; @@ -201,7 +201,7 @@ module.directive('category', [function() { $scope.feedCountLabel = function(feed) { var label = ''; if (feed.unread > 0) { - label = feed.unread; + label += feed.unread; } return label; }; diff --git a/src/main/app/sass/components/_subscription-list.scss b/src/main/app/sass/components/_subscription-list.scss index 49283a0c..92df570d 100644 --- a/src/main/app/sass/components/_subscription-list.scss +++ b/src/main/app/sass/components/_subscription-list.scss @@ -101,6 +101,14 @@ font-size: 11px; } +.css-treeview .unread ~ .unread-counter::before { + content: '('; +} + +.css-treeview .unread ~ .unread-counter::after { + content: ')'; +} + .css-treeview a { cursor: pointer; color: black; From bf78a80f2908df6254409013a301ccf3ec2e653d Mon Sep 17 00:00:00 2001 From: fabianofranz Date: Wed, 1 Oct 2014 14:42:17 -0300 Subject: [PATCH 5/5] Fixes OpenShift build --- .openshift/action_hooks/build | 13 +- .openshift/cron/README.cron | 27 ---- diy/index.html | 279 ---------------------------------- diy/testrubyserver.rb | 14 -- misc/.gitkeep | 0 pom.xml | 2 +- 6 files changed, 13 insertions(+), 322 deletions(-) delete mode 100644 .openshift/cron/README.cron delete mode 100644 diy/index.html delete mode 100755 diy/testrubyserver.rb delete mode 100644 misc/.gitkeep diff --git a/.openshift/action_hooks/build b/.openshift/action_hooks/build index 01fb76b8..5d848806 100755 --- a/.openshift/action_hooks/build +++ b/.openshift/action_hooks/build @@ -1,11 +1,22 @@ #!/bin/bash cd $OPENSHIFT_REPO_DIR +rm -rf $OPENSHIFT_REPO_DIR/node +rm -rf $OPENSHIFT_REPO_DIR/node_modules +rm -rf $OPENSHIFT_TMP_DIR/npm +rm -rf $OPENSHIFT_TMP_DIR/npmrc +rm -rf $OPENSHIFT_TMP_DIR/m2 +rm -rf $OPENSHIFT_TMP_DIR/local + +export NPM_CONFIG_PREFIX="$OPENSHIFT_TMP_DIR/npm" +export NPM_CONFIG_USERCONFIG="$OPENSHIFT_TMP_DIR/npmrc" export NPM_CONFIG_CACHE="$OPENSHIFT_TMP_DIR/npm/cache" export MAVEN_OPTS="-Dmaven.repo.local=$OPENSHIFT_TMP_DIR/m2" export HOME="$OPENSHIFT_TMP_DIR/local" +export NPM_CONFIG_ARCH="x64" + npm install npm export PATH="$OPENSHIFT_REPO_DIR/node_modules/.bin:$PATH" -mvn clean package +mvn clean package -DskipTests -Dos.arch=x64 diff --git a/.openshift/cron/README.cron b/.openshift/cron/README.cron deleted file mode 100644 index ac77f787..00000000 --- a/.openshift/cron/README.cron +++ /dev/null @@ -1,27 +0,0 @@ -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. - -For more information about cron, consult the documentation: -http://openshift.github.io/documentation/oo_cartridge_guide.html#cron -http://openshift.github.io/documentation/oo_user_guide.html#cron diff --git a/diy/index.html b/diy/index.html deleted file mode 100644 index 58caef0b..00000000 --- a/diy/index.html +++ /dev/null @@ -1,279 +0,0 @@ - - - - - - Welcome to OpenShift - - - - -
-
-

Welcome to your Do-It-Yourself application on OpenShift

-
-

- Do-It-Yourself is an experimental cartridge that provides a way to try unsupported languages, frameworks, and middleware on OpenShift. - To get started, add your framework of choice and modify .openshift/action_hooks/{start, stop} - to start and stop your application. - The only restriction is that your application should bind to $OPENSHIFT_DIY_IP:8080 - Don't forget to stop the existing server that is running before you push your stop file. -

- -
-
-
-

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

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

- - - -
-
- - -
- -
-
- - - diff --git a/diy/testrubyserver.rb b/diy/testrubyserver.rb deleted file mode 100755 index e9ef1156..00000000 --- a/diy/testrubyserver.rb +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env ruby -require 'webrick' -include WEBrick - -config = {} -config.update(:Port => 8080) -config.update(:BindAddress => ARGV[0]) -config.update(:DocumentRoot => ARGV[1]) -server = HTTPServer.new(config) -['INT', 'TERM'].each {|signal| - trap(signal) {server.shutdown} -} - -server.start diff --git a/misc/.gitkeep b/misc/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/pom.xml b/pom.xml index f9b8feb2..d238050f 100644 --- a/pom.xml +++ b/pom.xml @@ -323,4 +323,4 @@ test - \ No newline at end of file +