Commit 24e82414 authored by Kirill Smelkov's avatar Kirill Smelkov

helloworld & helloweb: Go version

We added support for Go in the previous patch. Let's now illustrate how
to use the toolchain and build simple service based on it.

/cc @gabriel, @Camata
parent f7db20a7
......@@ -3,10 +3,12 @@
extends =
../git/buildout.cfg
../ruby/buildout.cfg
../golang/buildout.cfg
parts =
helloweb-python
helloweb-ruby
helloweb-go
# repository with examples
......@@ -14,7 +16,7 @@ parts =
recipe = slapos.recipe.build:gitclone
git-executable = ${git:location}/bin/git
repository = https://lab.nexedi.com/nexedi/helloweb.git
revision = 7f5e49a541ae7b51da034dcdf20b91b64f4fb0e9
revision = 0487fa7bc88e83ce8b97d784ab11354aa8fac603
location = ${buildout:parts-directory}/helloweb
......@@ -78,3 +80,17 @@ environment =
BUNDLE_GEMFILE = ${helloweb-ruby-bundle:path}/Gemfile
command-line =
${bundler:bundle} exec sh -c 'helloweb.rb "$@"' ${:_buildout_section_name_}
# -*- go -*-
[helloweb-go]
recipe = slapos.recipe.cmmi
path = ${helloweb-repository:location}/go/
go = ${golang15:location}/bin/go
configure-command = :
make-binary =
make-targets= cd ${:path} &&
${:go} build
-o ${buildout:bin-directory}/${:_buildout_section_name_}
helloweb.go
......@@ -110,6 +110,7 @@ port = {{ port }}
# services instantiation
{{ hellowebsrv('python', 7777) }}
{{ hellowebsrv('ruby', 7778) }}
{{ hellowebsrv('go', 7779) }}
# register all services/promises to buildout parts
......
......@@ -22,6 +22,7 @@ parts =
# build helloweb programs
helloweb-python
helloweb-ruby
helloweb-go
# Download instance.cfg.in (buildout profile used to deployment of instance),
......@@ -32,7 +33,7 @@ recipe = slapos.recipe.template:jinja2
template = ${:_profile_base_location_}/instance.cfg.in
rendered = ${buildout:directory}/instance.cfg
# MD5 checksum can be skipped for development (easier to develop), but must be filled for production
md5sum = be7f930921376b3c8eb51c975e24721f
md5sum = 6567f8dedb5cdd93542dc29e96edb547
mode = 0644
extensions = jinja2.ext.do
context =
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment