Skip to content

Commit 054c07d

Browse files
committed
Added Travis deploy for OpenShift hot deploy.
Added OpenShift directory structure. Modified publish.sh to run when tags are created. Creating branch to reconcile detached HEAD instead of checking out master which doesn't exist for tags.
1 parent fb3d10e commit 054c07d

File tree

15 files changed

+99
-6
lines changed

15 files changed

+99
-6
lines changed

.openshift/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
For information about .openshift directory, consult the documentation:
2+
3+
http://openshift.github.io/documentation/oo_user_guide.html#the-openshift-directory

.openshift/action_hooks/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
For information about action hooks, consult the documentation:
2+
3+
http://openshift.github.io/documentation/oo_user_guide.html#action-hooks

.openshift/cron/README.cron

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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+
23+
PLEASE NOTE: The Cron cartridge must be installed in order to run the configured jobs.
24+
25+
For more information about cron, consult the documentation:
26+
http://openshift.github.io/documentation/oo_cartridge_guide.html#cron
27+
http://openshift.github.io/documentation/oo_user_guide.html#cron

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

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
For information about markers, consult the documentation:
2+
3+
http://openshift.github.io/documentation/oo_user_guide.html#markers
4+
5+
NOTE: To enable hot deploy, simpy create a file named hot_deploy.

.openshift/markers/hot_deploy

Whitespace-only changes.

.travis.yml

+14
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,26 @@
11
language: node_js
22
node_js:
33
- '0.10'
4+
45
before_install:
6+
- 'git checkout -B master' # Reconcile detached HEAD
57
- 'npm install -g bower grunt-cli'
8+
69
script:
710
- 'npm install'
811
- 'bower install'
912
- 'grunt'
1013
- 'grunt ngdocs:publish'
14+
1115
after_success:
1216
- sh -x ./publish.sh
17+
18+
deploy:
19+
provider: openshift
20+
user: "$OPENSHIFT_USER"
21+
password: "$OPENSHIFT_PWD"
22+
domain: "patternfly"
23+
app: angular
24+
skip_cleanup: true
25+
on:
26+
tags: true

publish.sh

+9-6
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22

33
set -o errexit -o nounset
44

5-
if [ "$TRAVIS_BRANCH" != "master" ]
5+
if [ -z "$TRAVIS_TAG" -a "$TRAVIS_BRANCH" != "master" ]
66
then
7-
echo "This commit was made against the $TRAVIS_BRANCH and not the master! Do not deploy!"
7+
echo "This commit was made against $TRAVIS_BRANCH and not the master or tag! Do not deploy!"
88
exit 0
99
fi
1010

11-
git checkout master
1211
# User info
1312
git config user.name "Admin"
14-
git config user.email "[email protected]"
13+
git config user.email "[email protected]"
14+
git config --global push.default simple
1515

1616
# Add upstream authentication token
1717
git remote add upstream https://$AUTH_TOKEN@github.com/patternfly/angular-patternfly.git
@@ -20,7 +20,10 @@ git remote add upstream https://[email protected]/patternfly/angular-patter
2020
git add dist --force
2121
git commit -m "Added files generated by Travis build"
2222

23-
# Push to remote branch
24-
git push upstream $TRAVIS_BRANCH:releases --force -v
23+
# Push to releases branch
24+
if [ -z "$TRAVIS_TAG" ]
25+
then
26+
git push upstream master:releases --force -v
27+
fi
2528

2629
exit $?

0 commit comments

Comments
 (0)