Add Cloud9 to slaprunner recipe

parent c6c1f956
...@@ -46,6 +46,5 @@ commit = 3136abc5c6b3ed332c4700ece24450fada63639b ...@@ -46,6 +46,5 @@ commit = 3136abc5c6b3ed332c4700ece24450fada63639b
origin = https://github.com/isaacs/npm.git origin = https://github.com/isaacs/npm.git
git-bin = ${git:location}/bin/git git-bin = ${git:location}/bin/git
node-bin = ${nodejs-0.4:location}/bin/node node-bin = ${nodejs-0.4:location}/bin/node
command = (GIT_SSL_NO_VERIFY=true ${:git-bin} clone --quiet ${:origin} ${:location} && cd ${:location} && ${:git-bin} reset --hard ${:commit} && ${:location}/configure --prefix=${:location} && GIT_SSL_NO_VERIFY=true ${:git-bin} submodule update --init --recursive && ${:node_bin} cli.js install npm@1.0.106 -g -f) || (rm -fr ${:location}; exit 1) command = (GIT_SSL_NO_VERIFY=true ${:git-bin} clone --quiet ${:origin} ${:location} && cd ${:location} && ${:git-bin} reset --hard ${:commit} && ${:location}/configure --prefix=${:location} && GIT_SSL_NO_VERIFY=true ${:git-bin} submodule update --init --recursive && ${:node-bin} cli.js install npm@1.0.106 -g -f) || (rm -fr ${:location}; exit 1)
update-command = update-command =
...@@ -40,6 +40,7 @@ class Recipe(BaseSlapRecipe): ...@@ -40,6 +40,7 @@ class Recipe(BaseSlapRecipe):
ipv6 = self.getGlobalIPv6Address() ipv6 = self.getGlobalIPv6Address()
proxy_port = '50000' proxy_port = '50000'
runner_port = '50000' runner_port = '50000'
cloud9_port = '30000'
workdir = self.createDataDirectory('runner') workdir = self.createDataDirectory('runner')
software_root = os.path.join(workdir, 'software') software_root = os.path.join(workdir, 'software')
instance_root = os.path.join(workdir, 'instance') instance_root = os.path.join(workdir, 'instance')
...@@ -64,22 +65,33 @@ class Recipe(BaseSlapRecipe): ...@@ -64,22 +65,33 @@ class Recipe(BaseSlapRecipe):
proxy_port=proxy_port, proxy_port=proxy_port,
proxy_database=os.path.join(workdir, 'proxy.db'), proxy_database=os.path.join(workdir, 'proxy.db'),
git=self.options['git'], git=self.options['git'],
cloud9_url='http://[%s]:%s' % (ipv6, cloud9_port),
ssh_client=self.options['ssh_client'], ssh_client=self.options['ssh_client'],
public_key=self.options['public_key'], public_key=self.options['public_key'],
private_key=self.options['private_key'] private_key=self.options['private_key'],
) )
config_file = self.createConfigurationFile('slapos.cfg', config_file = self.createConfigurationFile('slapos.cfg',
self.substituteTemplate(pkg_resources.resource_filename(__name__, self.substituteTemplate(pkg_resources.resource_filename(__name__,
'template/slapos.cfg.in'), configuration)) 'template/slapos.cfg.in'), configuration))
self.path_list.append(config_file) self.path_list.append(config_file)
environment = dict( environment = dict(
PATH=os.path.dirname(self.options['git']) + ':' + os.environ['PATH'], PATH=os.path.dirname(self.options['git']) + ':' + os.environ['PATH'],
GIT_SSH=self.options['ssh_client'] GIT_SSH=self.options['ssh_client']
) )
workdir = os.path.join(workdir, 'project')
if not os.path.exists(workdir):
os.mkdir(workdir)
launch_args = [self.options['slaprunner'].strip(), config_file, '--debug'] launch_args = [self.options['slaprunner'].strip(), config_file, '--debug']
cloud9_args = [self.options['node-bin'].strip(), self.options['cloud9'].strip(),
'-l', ipv6, '-p', cloud9_port, '-w', workdir]
self.path_list.extend(zc.buildout.easy_install.scripts([('slaprunner', self.path_list.extend(zc.buildout.easy_install.scripts([('slaprunner',
'slapos.recipe.librecipe.execute', 'executee')], self.ws, sys.executable, 'slapos.recipe.librecipe.execute', 'executee')], self.ws, sys.executable,
self.wrapper_directory, arguments=[launch_args, environment])) self.wrapper_directory, arguments=[launch_args, environment]))
self.setConnectionDict(dict(url='http://[%s]:%s' % (ipv6, runner_port))) self.path_list.extend(zc.buildout.easy_install.scripts([('cloud9IDE',
return self.path_list 'slapos.recipe.librecipe.execute', 'executee')], self.ws, sys.executable,
self.wrapper_directory, arguments=[cloud9_args, environment]))
self.setConnectionDict(dict(slaprunner_url='http://[%s]:%s' % (ipv6, runner_port),
cloud9_url='http://[%s]:%s' % (ipv6, cloud9_port)))
return self.path_list
\ No newline at end of file
...@@ -31,3 +31,6 @@ private_key = %(private_key)s ...@@ -31,3 +31,6 @@ private_key = %(private_key)s
[gitclient] [gitclient]
git = %(git)s git = %(git)s
[cloud9_IDE]
cloud9 = %(cloud9_url)s
\ No newline at end of file
...@@ -16,6 +16,8 @@ slapgrid_cp = ${buildout:directory}/bin/slapgrid-cp ...@@ -16,6 +16,8 @@ slapgrid_cp = ${buildout:directory}/bin/slapgrid-cp
slapproxy = ${buildout:directory}/bin/slapproxy slapproxy = ${buildout:directory}/bin/slapproxy
supervisor = ${buildout:directory}/bin/slapgrid-supervisorctl supervisor = ${buildout:directory}/bin/slapgrid-supervisorctl
git = ${git:location}/bin/git git = ${git:location}/bin/git
node-bin = ${nodejs-0.4:location}/bin/node
cloud9 = ${cloud9:location}/bin/cloud9.js
ssh_client = $${sshkeys-dropbear:wrapper} ssh_client = $${sshkeys-dropbear:wrapper}
public_key = $${sshkeys-dropbear:public-key} public_key = $${sshkeys-dropbear:public-key}
private_key = $${sshkeys-dropbear:private-key} private_key = $${sshkeys-dropbear:private-key}
...@@ -62,4 +64,4 @@ bin = $${buildout:directory}/bin/ ...@@ -62,4 +64,4 @@ bin = $${buildout:directory}/bin/
recipe = slapos.cookbook:mkdirectory recipe = slapos.cookbook:mkdirectory
sshkeys = $${rootdirectory:srv}/sshkeys sshkeys = $${rootdirectory:srv}/sshkeys
services = $${rootdirectory:etc}/run/ services = $${rootdirectory:etc}/run/
ssh = $${rootdirectory:etc}/ssh/ ssh = $${rootdirectory:etc}/ssh/
\ No newline at end of file
...@@ -8,6 +8,7 @@ extends = ...@@ -8,6 +8,7 @@ extends =
../../stack/shacache-client.cfg ../../stack/shacache-client.cfg
../../component/dropbear/buildout.cfg ../../component/dropbear/buildout.cfg
../../component/git/buildout.cfg ../../component/git/buildout.cfg
../../component/cloud9/buildout.cfg
parts = parts =
template template
...@@ -31,7 +32,7 @@ recipe = slapos.recipe.template ...@@ -31,7 +32,7 @@ recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance.cfg url = ${:_profile_base_location_}/instance.cfg
output = ${buildout:directory}/template.cfg output = ${buildout:directory}/template.cfg
mode = 0644 mode = 0644
md5sum = cd69efd5c3a7e9adca7387b9a401590a md5sum = 93a0a6a814ff3de691ccdbef65371dc7
[eggs] [eggs]
eggs += eggs +=
...@@ -59,4 +60,4 @@ signature-certificate-list = ...@@ -59,4 +60,4 @@ signature-certificate-list =
[versions] [versions]
# Use SlapOS patched zc.buildout # Use SlapOS patched zc.buildout
zc.buildout = 1.6.0-dev-SlapOS-003 zc.buildout = 1.6.0-dev-SlapOS-003
\ No newline at end of file
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