diff --git a/component/golang/buildout.cfg b/component/golang/buildout.cfg new file mode 100644 index 0000000000000000000000000000000000000000..b9b74d4da72dbb5ce6bad949ef0bbee5a789e22e --- /dev/null +++ b/component/golang/buildout.cfg @@ -0,0 +1,34 @@ +# 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} diff --git a/component/helloweb/buildout.cfg b/component/helloweb/buildout.cfg index ba2b817b5b9e0e8364ed131bd81803f8a9ea3718..bab7aa893557d4aa1d9fdd020397f1ba9c91c2b9 100644 --- a/component/helloweb/buildout.cfg +++ b/component/helloweb/buildout.cfg @@ -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 diff --git a/software/helloworld/instance.cfg.in b/software/helloworld/instance.cfg.in index 0763eebfcf1847ac3afb28ede02727f8127bf82c..ca52ce3cc48b7e1702eddc0b602288c3671c681d 100644 --- a/software/helloworld/instance.cfg.in +++ b/software/helloworld/instance.cfg.in @@ -110,6 +110,7 @@ port = {{ port }} # services instantiation {{ hellowebsrv('python', 7777) }} {{ hellowebsrv('ruby', 7778) }} +{{ hellowebsrv('go', 7779) }} # register all services/promises to buildout parts diff --git a/software/helloworld/software.cfg b/software/helloworld/software.cfg index 9abc85b3831dcf2a0c93e90e9d16c43d52a948d6..de0d4d48b78e9c5917ac04fceee3ac1cf96aa849 100644 --- a/software/helloworld/software.cfg +++ b/software/helloworld/software.cfg @@ -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 =