Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Lu Xu
slapos
Commits
5d42da92
Commit
5d42da92
authored
Oct 10, 2012
by
Viktor Horvath
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Makefiles partially working (createdb, dropdb, psql)
but no Perl DBI yet.
parent
85676999
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
27 deletions
+39
-27
slapos/recipe/mioga/instantiate.py
slapos/recipe/mioga/instantiate.py
+22
-17
software/mioga/instance-apacheperl.cfg
software/mioga/instance-apacheperl.cfg
+3
-1
software/mioga/mioga-patch
software/mioga/mioga-patch
+14
-9
No files found.
slapos/recipe/mioga/instantiate.py
View file @
5d42da92
...
@@ -28,6 +28,7 @@
...
@@ -28,6 +28,7 @@
import
os
import
os
import
pprint
import
pprint
import
re
import
re
import
stat
import
subprocess
import
subprocess
from
slapos.recipe.librecipe
import
GenericBaseRecipe
from
slapos.recipe.librecipe
import
GenericBaseRecipe
...
@@ -62,35 +63,39 @@ class Recipe(GenericBaseRecipe):
...
@@ -62,35 +63,39 @@ class Recipe(GenericBaseRecipe):
fm
.
modify
(
'dbi_passwd'
,
self
.
options
[
'db_password'
])
fm
.
modify
(
'dbi_passwd'
,
self
.
options
[
'db_password'
])
fm
.
modify
(
'db_host'
,
self
.
options
[
'db_host'
])
fm
.
modify
(
'db_host'
,
self
.
options
[
'db_host'
])
fm
.
modify
(
'db_port'
,
self
.
options
[
'db_port'
])
fm
.
modify
(
'db_port'
,
self
.
options
[
'db_port'
])
#
TODO: Mioga must be able to use an external Postgres server! IPv6 address!
#
db_name, dbi_login are standard
fm
.
save
()
fm
.
save
()
os
.
remove
(
"config.mk"
)
# otherwise we don't see the values in the Makefiles
if
os
.
path
.
isfile
(
"config.mk"
):
os
.
remove
(
"config.mk"
)
# otherwise we don't see the values in the Makefiles
environ
=
os
.
environ
environ
=
os
.
environ
environ
[
'PATH'
]
=
self
.
options
[
'mioga_add_to_path'
]
+
':'
+
environ
[
'PATH'
]
environ
[
'PATH'
]
=
':'
.
join
([
self
.
options
[
'perl_bin'
],
# priority!
self
.
options
[
'mioga_add_to_path'
],
self
.
options
[
'postgres_bin'
],
environ
[
'PATH'
]
])
# Write the Postgres password file
pgpassfilepath
=
os
.
path
.
join
(
self
.
options
[
'instance_root'
],
'.pgpass'
)
pgpassfile
=
open
(
pgpassfilepath
,
'w'
)
pgpassfile
.
write
(
':'
.
join
([
re
.
sub
(
r':'
,
r'\
:
', self.options['
db_host
']),
self.options['
db_port
'],
'
*
', # could be self.options['
db_dbname
'] or '
postgres
'
self.options['
db_username
'],
self.options['
db_password
'] ]) + "
\
n
")
pgpassfile.close()
os.chmod(pgpassfilepath, stat.S_IRUSR | stat.S_IWUSR)
environ['
PGPASSFILE
'] = pgpassfilepath
# environ = self.options['
mioga_compile_env
']
# environ = self.options['
mioga_compile_env
']
print pprint.pformat(environ)
print pprint.pformat(environ)
# We must call "make installall" in the SAME environment that
# We must call "make installall" in the SAME environment that
# "perl Makefile.PL" left!
# "perl Makefile.PL" left!
cmd
=
subprocess
.
Popen
(
self
.
options
[
'perl_bin
ary'
]
+
'
Makefile.PL'
cmd = subprocess.Popen(self.options['
perl_bin
'] + '
/
perl
Makefile
.
PL
'
+ '
&&
make
installall
',
+ '
&&
make
installall
',
env=environ, shell=True)
env=environ, shell=True)
cmd.communicate()
cmd.communicate()
# cmd_configure = subprocess.Popen([ self.options['perl_binary'],
# 'Makefile.PL' ],
# env=environ)
# cmd_configure.communicate()
# if cmd_configure.returncode == 0:
# # TODO: no "make" on SlapOS ?
# cmd_make = subprocess.Popen(['make', 'installall'],
# env=environ)
# cmd_make.communicate()
# else:
# print "Mioga instantiate.py::install: Configure failed."
os.chdir(former_directory)
os.chdir(former_directory)
print "Mioga instantiate.py::install finished!"
print "Mioga instantiate.py::install finished!"
...
...
software/mioga/instance-apacheperl.cfg
View file @
5d42da92
...
@@ -75,7 +75,9 @@ mioga_compile_dir = ${template-apacheperl:compile-directory}
...
@@ -75,7 +75,9 @@ mioga_compile_dir = ${template-apacheperl:compile-directory}
# mioga_compile_env = ${mioga:environment}
# mioga_compile_env = ${mioga:environment}
mioga_add_to_path = ${libxslt:location}/bin:${libxml2:location}/bin
mioga_add_to_path = ${libxslt:location}/bin:${libxml2:location}/bin
var_directory = $${rootdirectory:var}
var_directory = $${rootdirectory:var}
perl_binary = ${perl:location}/bin/perl
instance_root = $${buildout:directory}
perl_bin = ${perl:location}/bin
postgres_bin = ${postgresql:location}/bin
htdocs = $${apacheperl-instance:htdocs}
htdocs = $${apacheperl-instance:htdocs}
db_host = $${postgres-urlparse:host}
db_host = $${postgres-urlparse:host}
db_port = $${postgres-urlparse:port}
db_port = $${postgres-urlparse:port}
...
...
software/mioga/mioga-patch
View file @
5d42da92
diff -r c0f4c1b8b448 Makefile.PL
diff -r c0f4c1b8b448 Makefile.PL
--- a/Makefile.PL Sat Oct 06 16:15:43 2012 +0200
--- a/Makefile.PL Sat Oct 06 16:15:43 2012 +0200
+++ b/Makefile.PL
Tue Oct 09 16:40:31
2012 +0200
+++ b/Makefile.PL
Wed Oct 10 01:19:50
2012 +0200
@@ -115,7 +115,7 @@
@@ -115,7 +115,7 @@
# ----------------------------------------------------------------------------
# ----------------------------------------------------------------------------
sub MY::processPL {
sub MY::processPL {
...
@@ -24,7 +24,7 @@ diff -r c0f4c1b8b448 Makefile.PL
...
@@ -24,7 +24,7 @@ diff -r c0f4c1b8b448 Makefile.PL
fi \
fi \
diff -r c0f4c1b8b448 conf/Config.xml
diff -r c0f4c1b8b448 conf/Config.xml
--- a/conf/Config.xml Sat Oct 06 16:15:43 2012 +0200
--- a/conf/Config.xml Sat Oct 06 16:15:43 2012 +0200
+++ b/conf/Config.xml
Tue Oct 09 16:40:31
2012 +0200
+++ b/conf/Config.xml
Wed Oct 10 01:19:50
2012 +0200
@@ -37,6 +37,12 @@
@@ -37,6 +37,12 @@
xpath="/authentication"/>
xpath="/authentication"/>
...
@@ -40,7 +40,7 @@ diff -r c0f4c1b8b448 conf/Config.xml
...
@@ -40,7 +40,7 @@ diff -r c0f4c1b8b448 conf/Config.xml
xpath="/database/DBname"/>
xpath="/database/DBname"/>
diff -r c0f4c1b8b448 lib/MiogaConf.pm
diff -r c0f4c1b8b448 lib/MiogaConf.pm
--- a/lib/MiogaConf.pm Sat Oct 06 16:15:43 2012 +0200
--- a/lib/MiogaConf.pm Sat Oct 06 16:15:43 2012 +0200
+++ b/lib/MiogaConf.pm
Tue Oct 09 16:40:31
2012 +0200
+++ b/lib/MiogaConf.pm
Wed Oct 10 01:19:50
2012 +0200
@@ -811,6 +811,10 @@
@@ -811,6 +811,10 @@
my @missing;
my @missing;
my @missing_clib;
my @missing_clib;
...
@@ -62,12 +62,17 @@ diff -r c0f4c1b8b448 lib/MiogaConf.pm
...
@@ -62,12 +62,17 @@ diff -r c0f4c1b8b448 lib/MiogaConf.pm
my $version;
my $version;
diff -r c0f4c1b8b448 sql/Makefile
diff -r c0f4c1b8b448 sql/Makefile
--- a/sql/Makefile Sat Oct 06 16:15:43 2012 +0200
--- a/sql/Makefile Sat Oct 06 16:15:43 2012 +0200
+++ b/sql/Makefile
Tue Oct 09 16:40:31
2012 +0200
+++ b/sql/Makefile
Wed Oct 10 01:19:50
2012 +0200
@@ -18,
6 +18,7
@@
@@ -18,
9 +18,9
@@
if [ $(INIT_SQL) = 'yes' ] ; \
if [ $(INIT_SQL) = 'yes' ] ; \
then \
then \
echo "Initialize database"; \
echo "Initialize database"; \
+ echo "Database server will be: $(DBI_LOGIN) on $(DB_HOST) : $(DB_PORT)" \
- su - $(POSTGRES_USER) -c "dropdb $(DB_NAME)" ; \
su - $(POSTGRES_USER) -c "dropdb $(DB_NAME)" ; \
- su - $(POSTGRES_USER) -c "createdb --encoding UTF8 $(DB_NAME)" && \
su - $(POSTGRES_USER) -c "createdb --encoding UTF8 $(DB_NAME)" && \
- su $(POSTGRES_USER) -c "psql $(DB_NAME) < create_lang.sql" && \
su $(POSTGRES_USER) -c "psql $(DB_NAME) < create_lang.sql" && \
+ dropdb -h $(DB_HOST) -p $(DB_PORT) -U $(DBI_LOGIN) $(DB_NAME) ; \
+ createdb --encoding UTF8 -h $(DB_HOST) -p $(DB_PORT) -U $(DBI_LOGIN) $(DB_NAME) && \
+ psql -h $(DB_HOST) -p $(DB_PORT) -U $(DBI_LOGIN) $(DB_NAME) < create_lang.sql && \
perl -w -I../lib initdb.pl ; \
elif [ $(INIT_SQL) != 'noupdate' ]; then \
echo "Update database"; \
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment