Go on openshift

1,423 views
Skip to first unread message

rif

unread,
Dec 18, 2012, 5:28:54 PM12/18/12
to golan...@googlegroups.com
Openshift application gallery... go is there :)

https://openshift.redhat.com/community/application-gallery

Johann Höchtl

unread,
Dec 20, 2012, 6:50:45 AM12/20/12
to golan...@googlegroups.com
Great news! Is there a tutorial somewhere to get others going on Openshift as easlily as this tutorial for Go on Heroku?
https://gist.github.com/cbeb0c30b0eec13c0f06

Johann Höchtl

unread,
Dec 20, 2012, 6:54:28 AM12/20/12
to golan...@googlegroups.com


Am Donnerstag, 20. Dezember 2012 12:50:45 UTC+1 schrieb Johann Höchtl:
Great news! Is there a tutorial somewhere to get others going on Openshift as easlily as this tutorial for Go on Heroku?
https://gist.github.com/cbeb0c30b0eec13c0f06

I discovered
https://github.com/gcmurphy/golang-openshift
and
https://github.com/lkundrak/openshift-go-diy

but you may add more as your app is much jounger than  these two "howtos".

rif

unread,
Dec 20, 2012, 9:02:41 AM12/20/12
to golan...@googlegroups.com
This is what I do for deployment (you can can start from one of those two solutions you mentioned but you can strip them down):

- the server binary is bin/cmo and I compile it before deploy

cat /.openshift/action_hooks/start
#!/bin/bash
nohup ${OPENSHIFT_REPO_DIR}/bin/cmo >> ${OPENSHIFT_DIY_LOG_DIR}/cmo.log 2>&1 &

cat /.openshift/action_hooks/stop
#!/bin/bash
pkill cmo > /dev/null 2>&1
exit 0

I don't use any other action_hook.

I have three other directories in the repo (besides .openshift):

bin/  <--- contains the binary
tmpl/     <---- contains the templates
static/   <---- contains the static files (js,css,img) (maybe I will move demo on a CDN)

-rif

Mike Rosset

unread,
Dec 24, 2012, 9:26:18 AM12/24/12
to rif, golang-nuts
I hacked together a build hook for a diy container. will build/deploy
your go app on push.

see https://gist.github.com/4369378
> --
>
>

Steve Phillips

unread,
Jan 1, 2013, 9:53:09 AM1/1/13
to golang-nuts
I have forked Mike Rosset's gist and added a couple features, most
importantly -- automatic dependency installation.

Just name your main go file `goapp.go`, put these 3 files in the
designated place, and you should be good to go. I have an app up and
running now using exactly what is included here:

https://gist.github.com/4427866

--Steve Phillips / elimisteve


On Dec 24 2012, 6:26 am, Mike Rosset <mike.ros...@gmail.com> wrote:
> I hacked together a build hook for a diy container. will build/deploy
> your go app on push.
>
> seehttps://gist.github.com/4369378

Mike Rosset

unread,
Jan 2, 2013, 12:34:00 PM1/2/13
to Steve Phillips, golang-nuts
thanks for the changes . one thing I might suggest is since we are
abusing GOPATH we can have something more like

$OPENSHIFT_REPO_DIR/src/goapp/main.go
$OPENSHIFT_REPO_DIR/src/goapp/foo.go

imperative to have the src directory.

and then you can do


"$GO" install goapp


also you removed my shell quotes for paths, which is probably ok but
you never know ie /path/this is spaced/ could in theory break. just a
FYI here.
> --
>
>
Reply all
Reply to author
Forward
0 new messages