Skip to content

Commit 4ed37be

Browse files
committed
Update readme, add cd code and static files
1 parent e798d31 commit 4ed37be

File tree

10 files changed

+38
-336
lines changed

10 files changed

+38
-336
lines changed

.openshift/action_hooks/arc.rc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ DAEMON=${OPENSHIFT_REPO_DIR}.openshift/action_hooks/webserver.rc
1414
DAEMON_ARGS=""
1515
PIDFILE=${OPENSHIFT_TMP_DIR}arc.pid
1616
SCRIPTNAME=${OPENSHIFT_REPO_DIR}${NAME}
17+
CMD=${RACKET_HOME}/bin/racket
1718

1819
# Exit if the package is not installed
1920
[ -x "$DAEMON" ] || exit 0
2021

2122
do_start()
2223
{
23-
CMD=${RACKET_HOME}/bin/racket
2424
WSARG="-f ${ARC_HOME}/as.scm ${OPENSHIFT_REPO_DIR}diy/main.arc"
25-
nohup ${CMD} ${WSARG} ${DAEMON_ARGS} > /dev/null 2>${OPENSHIFT_DIY_LOG_DIR}/launch_errors.log &
25+
nohup ${CMD} ${WSARG} ${DAEMON_ARGS} >/dev/null 2>${OPENSHIFT_DIY_LOG_DIR}/launch_errors.log &
2626
echo $! >> ${PIDFILE}
2727
}
2828

@@ -31,7 +31,7 @@ do_start()
3131
#
3232
do_stop()
3333
{
34-
killall ${NAME}
34+
killall ${CMD}
3535
}
3636

3737
#

README

Lines changed: 0 additions & 52 deletions
This file was deleted.

README.md

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,29 @@
1-
The OpenShift `diy` cartridge documentation can be found at:
1+
This is an OpenShift DIY cartridge that sets up news.arc on a diy app.
22

3-
https://github.com/openshift/origin-server/tree/master/cartridges/openshift-origin-cartridge-diy/README.md
3+
Follow these instructions to install it, based on RayRacine's code at github.com/RayRacine/rackos
4+
5+
1. Create an account on OpenShift.
6+
1. Use their console to create an application, say named "test".
7+
* The console shows you that you have a git repo, and a URL for your app.
8+
* e.g., git clone ssh://\<long number here>@test-<namespace>.rhcloud.com/~/git/test.git/
9+
* and http://test-<namespace>.rhcloud.com
10+
1. Clone your OpenShift repo on your laptop or whatever in say /code
11+
* cd /code
12+
* git clone ssh://\<long number here>@test-<namespace>.rhcloud.com/~/git/test.git/
13+
* cd /code/test
14+
* Now in your locally cloned repo.
15+
1. Add my repository with the scripts.
16+
* git remote add rackos git://github.com/shader/arc-openshift.git
17+
1. Fetch it down and merge it.
18+
* git fetch arc-openshift
19+
* git merge --ff arc-openshift/master
20+
1. There is a hidden directory .openshift/action_hooks.
21+
* If you read the OpenShift docs or the README for this project you'll see that basically that these hooks scripts are what drives OpenShift's DIY cartridge.
22+
* A key script is the pre_build which is called when a push to your remote OpenShift repo occurs.
23+
* pre_build checks to see if local copies of Racket and anarki are installed. If not they will be download and installed in the data directory. The post-deploy hook then starts the news.arc server.
24+
1. That's it. Test it by hitting it in your browser. Here is mine http://test-shader.rhcloud.com
25+
1. Further reading of the OpenShift doc explains how to use your personal domain in lieu of the rhcloud.com domain.
26+
27+
## Next Steps.
28+
29+
Edit your code locally. Test run it locally or don't. When ready, commit and push it OpenShift and the scripts will automatically stop/start the server with the new changes.

diy/index.html

Lines changed: 0 additions & 279 deletions
This file was deleted.

diy/main.arc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
; Load news.arc on 8080 (OPENSHIFT_DIY_PORT)
22
(= getenv [$.getenv string._])
3+
(= root getenv!OPENSHIFT_REPO_DIR)
4+
(def cd ((o path nil))
5+
(if path
6+
($.current-directory path)
7+
($ (path->string (current-directory)))))
8+
9+
(cd root)
310

411
(nsv (list getenv!OPENSHIFT_DIY_IP 8080))

diy/static/arc.png

113 Bytes
Loading

diy/static/grayarrow.gif

111 Bytes
Loading

diy/static/graydown.gif

111 Bytes
Loading

diy/static/robots.txt

Whitespace-only changes.

diy/static/s.gif

43 Bytes
Loading

0 commit comments

Comments
 (0)