Commit 4b074dae authored by Kirill Smelkov's avatar Kirill Smelkov

Go support

For upcoming GitLab SR we need Go[1] language support, because one
GitLab service is written in this language:

    https://gitlab.com/gitlab-org/gitlab-workhorse

Here we provide golang component, and helloweb-go service integrated
into helloworld SR.

The patches are based on recent helloworld & helloweb restructuring (see !23).

/reviewed-by @jerome  (on !24)
/cc @kazuhiko, @rafael, @alain.takoudjou, @gabriel, @Camata

[1] http://golang.org
parents 590416af 24e82414
# Go language - https://golang.org/
[buildout]
parts = golang
[golang]
<= golang15
[golang-common]
recipe = slapos.recipe.cmmi
configure-command = :
location = ${buildout:parts-directory}/${:_buildout_section_name_}
make-binary =
make-targets= cd src && ./all.bash && cp -alf .. ${:location}
environment =
GOROOT_FINAL=${:location}
${:environment-extra}
[golang14]
<= golang-common
url = https://storage.googleapis.com/golang/go1.4.3.src.tar.gz
md5sum = dfb604511115dd402a77a553a5923a04
environment-extra =
[golang15]
<= golang-common
url = https://storage.googleapis.com/golang/go1.5.1.src.tar.gz
md5sum = 4adfbdfca523cc1c229be8a321f3602f
# go1.5 needs go1.4 to bootstrap
environment-extra =
GOROOT_BOOTSTRAP=${golang14:location}
......@@ -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