Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 61 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,61 @@
This is an OpenShift DIY cartridge that sets up news.arc on a diy app.

Follow these instructions to install it, based on RayRacine's code at github.com/RayRacine/rackos

1. Create an account on OpenShift.
1. Use their console to create an application, say named "test".
* The console shows you that you have a git repo, and a URL for your app.
* e.g., git clone ssh://\<long number here>@test-\<namespace>.rhcloud.com/~/git/test.git/
* and http://test-\<namespace>.rhcloud.com
1. Clone your OpenShift repo on your laptop or whatever in say /code
* cd /code
* git clone ssh://\<long number here>@test-\<namespace>.rhcloud.com/~/git/test.git/
* cd /code/test
* Now in your locally cloned repo.
1. Add my repository with the scripts.
* git remote add rackos git://github.com/shader/arc-openshift.git
1. Fetch it down and merge it.
* git fetch arc-openshift
* git merge --ff arc-openshift/master
1. There is a hidden directory .openshift/action_hooks.
* 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.
* A key script is the pre_build which is called when a push to your remote OpenShift repo occurs.
* 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.
1. That's it. Test it by hitting it in your browser. Here is mine http://test-shader.rhcloud.com
1. Further reading of the OpenShift doc explains how to use your personal domain in lieu of the rhcloud.com domain.

## Next Steps.

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.
An OpenShift DIY cartridge that sets up news.arc on a diy app.

Quickstart
-
1. Create an account on [OpenShift](https://www.openshift.com/app/account/new) and install [the OpenShift Client Tools](https://developers.openshift.com/en/managing-client-tools.html).

2. ` rhc app-create arc diy-0.1 --from-code https://github.com/shader/arc-openshift `

Usage
-

1. Create an account and Add your account to admins.

```
rhc ssh arc
echo $your-username > app-root/repo/www/admins
```

2. Customize

```
vi app-root/data/arc/lib/news.arc
```

Or allow users open news in new tap. Just add one line:
```
(mac npage (title . body)
`(tag html
(tag head
(gen-css-url)
(prn "<link rel=\"shortcut icon\" href=\"" favicon-url* "\">")
(prn "<meta name=\"viewport\" content=\"width=device-width\">")
(prn "<base target=\"_blank\">") ;; <--- add this line
(tag script (pr votejs*))
(tag title (pr ,title)))
(tag body
(center
(tag (table border 0 cellpadding 0 cellspacing 0 width "85%"
bgcolor sand)
,@body)))))
```

3. Restart the server.

```
rhc app-force-stop arc && rhc app-start arc
```

Bugs
-
Please Submit [issues](https://github.com/shader/arc-openshift/issues/new).

Thanks to
-
[RayRacine](http://github.com/RayRacine/rackos)