Skip to content

Commit 82f55d1

Browse files
author
mockbuild
committed
Creating template
0 parents  commit 82f55d1

File tree

21 files changed

+446
-0
lines changed

21 files changed

+446
-0
lines changed

.openshift/action_hooks/build

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
# This is a simple build script and will be executed on your CI system if
3+
# available. Otherwise it will execute while your application is stopped
4+
# before the deploy step. This script gets executed directly, so it
5+
# could be python, php, ruby, etc.

.openshift/action_hooks/deploy

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
# This deploy hook gets executed after dependencies are resolved and the
3+
# build hook has been run but before the application has been started back
4+
# up again. This script gets executed directly, so it could be python, php,
5+
# ruby, etc.

.openshift/action_hooks/post_deploy

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
# This is a simple post deploy hook executed after your application
3+
# is deployed and started. This script gets executed directly, so
4+
# it could be python, php, ruby, etc.

.openshift/action_hooks/pre_build

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
# This is a simple script and will be executed on your CI system if
3+
# available. Otherwise it will execute while your application is stopped
4+
# before the build step. This script gets executed directly, so it
5+
# could be python, php, ruby, etc.

.openshift/cron/README.cron

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
Run scripts or jobs on a periodic basis
2+
=======================================
3+
Any scripts or jobs added to the minutely, hourly, daily, weekly or monthly
4+
directories will be run on a scheduled basis (frequency is as indicated by the
5+
name of the directory) using run-parts.
6+
7+
run-parts ignores any files that are hidden or dotfiles (.*) or backup
8+
files (*~ or *,) or named *.{rpmsave,rpmorig,rpmnew,swp,cfsaved}
9+
10+
The presence of two specially named files jobs.deny and jobs.allow controls
11+
how run-parts executes your scripts/jobs.
12+
jobs.deny ===> Prevents specific scripts or jobs from being executed.
13+
jobs.allow ===> Only execute the named scripts or jobs (all other/non-named
14+
scripts that exist in this directory are ignored).
15+
16+
The principles of jobs.deny and jobs.allow are the same as those of cron.deny
17+
and cron.allow and are described in detail at:
18+
http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Deployment_Guide/ch-Automating_System_Tasks.html#s2-autotasks-cron-access
19+
20+
See: man crontab or above link for more details and see the the weekly/
21+
directory for an example.
22+

.openshift/cron/daily/.gitignore

Whitespace-only changes.

.openshift/cron/hourly/.gitignore

Whitespace-only changes.

.openshift/cron/minutely/.gitignore

Whitespace-only changes.

.openshift/cron/monthly/.gitignore

Whitespace-only changes.

.openshift/cron/weekly/README

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
Run scripts or jobs on a weekly basis
2+
=====================================
3+
Any scripts or jobs added to this directory will be run on a scheduled basis
4+
(weekly) using run-parts.
5+
6+
run-parts ignores any files that are hidden or dotfiles (.*) or backup
7+
files (*~ or *,) or named *.{rpmsave,rpmorig,rpmnew,swp,cfsaved} and handles
8+
the files named jobs.deny and jobs.allow specially.
9+
10+
In this specific example, the chronograph script is the only script or job file
11+
executed on a weekly basis (due to white-listing it in jobs.allow). And the
12+
README and chrono.dat file are ignored either as a result of being black-listed
13+
in jobs.deny or because they are NOT white-listed in the jobs.allow file.
14+
15+
For more details, please see ../README.cron file.
16+

.openshift/cron/weekly/chrono.dat

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Time And Relative D...n In Execution (Open)Shift!

.openshift/cron/weekly/chronograph

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
echo "`date`: `cat $(dirname \"$0\")/chrono.dat`"

.openshift/cron/weekly/jobs.allow

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#
2+
# Script or job files listed in here (one entry per line) will be
3+
# executed on a weekly-basis.
4+
#
5+
# Example: The chronograph script will be executed weekly but the README
6+
# and chrono.dat files in this directory will be ignored.
7+
#
8+
# The README file is actually ignored due to the entry in the
9+
# jobs.deny which is checked before jobs.allow (this file).
10+
#
11+
chronograph
12+

.openshift/cron/weekly/jobs.deny

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#
2+
# Any script or job files listed in here (one entry per line) will NOT be
3+
# executed (read as ignored by run-parts).
4+
#
5+
6+
README
7+

.openshift/markers/README

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Markers
2+
===========
3+
4+
Adding marker files to this directory will have the following effects:
5+
6+
force_clean_build - Will remove all previous php pears and start installing
7+
required pears from scratch

README

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
Feel free to change or remove this file, it is informational only.
2+
3+
Repo layout
4+
===========
5+
php/ - Externally exposed php code goes here
6+
libs/ - Additional libraries
7+
misc/ - For not-externally exposed php code
8+
../data - For persistent data (full path in environment var: OPENSHIFT_DATA_DIR)
9+
deplist.txt - list of pears to install
10+
.openshift/action_hooks/pre_build - Script that gets run every git push before the build
11+
.openshift/action_hooks/build - Script that gets run every git push as part of the build process (on the CI system if available)
12+
.openshift/action_hooks/deploy - Script that gets run every git push after build but before the app is restarted
13+
.openshift/action_hooks/post_deploy - Script that gets run every git push after the app is restarted
14+
15+
16+
Notes about layout
17+
==================
18+
Please leave php, libs and data directories but feel free to create additional
19+
directories if needed.
20+
21+
Note: Every time you push, everything in your remote repo dir gets recreated
22+
please store long term items (like an sqlite database) in ../data which will
23+
persist between pushes of your repo.
24+
25+
26+
Environment Variables
27+
=====================
28+
29+
OpenShift Express provides several environment variables to reference for ease
30+
of use. The following list are some common variables but far from exhaustive:
31+
32+
$_ENV['OPENSHIFT_APP_NAME'] - Application name
33+
$_ENV['OPENSHIFT_APP_DIR'] - Application dir
34+
$_ENV['OPENSHIFT_DATA_DIR'] - For persistent storage (between pushes)
35+
$_ENV['OPENSHIFT_TMP_DIR'] - Temp storage (unmodified files deleted after 10 days)
36+
37+
When embedding a database using 'rhc app cartridge add', you can reference environment
38+
variables for username, host and password:
39+
40+
$_ENV['OPENSHIFT_DB_HOST'] - DB host
41+
$_ENV['OPENSHIFT_DB_PORT'] - DB Port
42+
$_ENV['OPENSHIFT_DB_USERNAME'] - DB Username
43+
$_ENV['OPENSHIFT_DB_PASSWORD'] - DB Password
44+
45+
To get a full list of environment variables, simply add a line in your
46+
.openshift/action_hooks/build script that says "export" and push.
47+
48+
deplist.txt
49+
===========
50+
51+
A list of pears to install, line by line on the server. This will happen when
52+
the user git pushes.
53+
54+
55+
Additional information
56+
======================
57+
58+
Link to additional information will be here, when we have it :)

deplist.txt

Whitespace-only changes.

libs/.gitkeep

Whitespace-only changes.

misc/.gitkeep

Whitespace-only changes.

php/health_check.php

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<?php
2+
print 1;
3+
?>

0 commit comments

Comments
 (0)