Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Devrim Gunyel
core
Commits
904dc7ed
Commit
904dc7ed
authored
May 20, 2019
by
Piotr Gawron
Browse files
upgrade from version prior to 14 working (version without dbcommons-config)
parent
61409681
Changes
3
Hide whitespace changes
Inline
Side-by-side
debian/create-debian-pkg.sh
View file @
904dc7ed
...
...
@@ -98,6 +98,7 @@ sed -i "s/__DB_SCRIPT_DIR__/$DB_SCRIPT_DIR/g" common.sh
sed
-i
"s/__MAX_DB_VERSION_FOR_MIGRTION__/
$MAX_DB_VERSION_FOR_MIGRTION
/g"
common.sh
sed
-i
-e
"1r common.sh"
debian/config
sed
-i
-e
"1r common.sh"
debian/postinst
sed
-i
-e
"1r common.sh"
debian/postrm
sed
-i
-e
"1r common.sh"
debian/preinst
...
...
debian/template/config
View file @
904dc7ed
#!/bin/sh
log
"Running config"
$1
$2
;
set
-e
.
/usr/share/debconf/confmodule
db_version 2.0
if
[
!
-d
"/etc/minerva/"
]
then
mkdir
/etc/minerva/
fi
if
[
-f
/usr/share/dbconfig-common/dpkg/config.pgsql
]
;
then
.
/usr/share/dbconfig-common/dpkg/config.pgsql
DB_HOST
=
"localhost"
DB_PORT
=
"5432"
DB_DATABASE_NAME
=
"map_viewer"
DB_USERNAME
=
"map_viewer"
DB_PASSWORD
=
"123qweasdzxc"
if
[
-f
/etc/minerva/db.properties
]
;
then
DB_PROPERTIES_FILE
=
"/etc/minerva/db.properties"
DB_HOST
=
`
cat
$DB_PROPERTIES_FILE
|grep
"uri"
|cut
-f3
-d
"/"
|cut
-f1
-d
":"
`
DB_PORT
=
`
cat
$DB_PROPERTIES_FILE
|grep
"uri"
|cut
-f3
-d
"/"
|cut
-f2
-d
":"
`
DB_DATABASE_NAME
=
`
cat
$DB_PROPERTIES_FILE
|grep
"uri"
|cut
-f4
-d
"/"
`
DB_USERNAME
=
`
cat
$DB_PROPERTIES_FILE
|grep
"username"
|cut
-f2
-d
"="
`
DB_PASSWORD
=
`
cat
$DB_PROPERTIES_FILE
|grep
"password"
|cut
-f2
-d
"="
`
fi
echo
"dbserver=
$DB_HOST
"
>
/etc/minerva/old.sh
echo
"dbport=
$DB_PORT
"
>>
/etc/minerva/old.sh
echo
"dbname=
$DB_DATABASE_NAME
"
>>
/etc/minerva/old.sh
echo
"dbuser=
$DB_USERNAME
"
>>
/etc/minerva/old.sh
echo
"dbpass=
$DB_PASSWORD
"
>>
/etc/minerva/old.sh
dbc_first_version
=
"14.0.0~alpha.0"
dbc_load_include
=
"sh:/etc/minerva/old.sh"
dbc_go minerva
$@
fi
debian/template/postinst
View file @
904dc7ed
...
...
@@ -39,6 +39,8 @@ case "$1" in
dbc_generate_include_owner
=
"root:root"
dbc_generate_include_perms
=
"0640"
dbc_generate_include
=
sh:/etc/minerva/db.sh
dbc_first_version
=
"14.0.0~alpha.0"
dbc_load_include
=
"sh:/etc/minerva/old.sh"
# Need to start postgresql, so it doesn't fail on the installer
invoke-rc.d
--force
postgresql restart
||
true
...
...
@@ -46,10 +48,11 @@ case "$1" in
# if there is a config file generated by db_config_common (on upgrade this file might not be generated)
if
[
-f
/etc/minerva/db.sh
]
then
.
/etc/minerva/db.sh
# when configuration was cancelled don't create config file
if
[
-z
"
$dbuser
"
]
if
[
!
-z
"
$dbuser
"
]
then
if
[
-z
"
$dbport
"
]
then
...
...
@@ -64,6 +67,7 @@ case "$1" in
fi
rm
/etc/minerva/db.sh
fi
rm
/etc/minerva/old.sh
#we have to restart tomcat, because application was started on the old database and it might crash during deployment
#for instance in the new war file there was init script that uses some new database features, but they are not
...
...
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