Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
minerva
core
Commits
904dc7ed
Commit
904dc7ed
authored
5 years ago
by
Piotr Gawron
Browse files
Options
Downloads
Patches
Plain Diff
upgrade from version prior to 14 working (version without dbcommons-config)
parent
61409681
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!779
Resolve "Debian package: use dbconfig-common"
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
debian/create-debian-pkg.sh
+1
-0
1 addition, 0 deletions
debian/create-debian-pkg.sh
debian/template/config
+30
-0
30 additions, 0 deletions
debian/template/config
debian/template/postinst
+5
-1
5 additions, 1 deletion
debian/template/postinst
with
36 additions
and
1 deletion
debian/create-debian-pkg.sh
+
1
−
0
View file @
904dc7ed
...
@@ -98,6 +98,7 @@ sed -i "s/__DB_SCRIPT_DIR__/$DB_SCRIPT_DIR/g" common.sh
...
@@ -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
"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/postinst
sed
-i
-e
"1r common.sh"
debian/postrm
sed
-i
-e
"1r common.sh"
debian/postrm
sed
-i
-e
"1r common.sh"
debian/preinst
sed
-i
-e
"1r common.sh"
debian/preinst
...
...
This diff is collapsed.
Click to expand it.
debian/template/config
+
30
−
0
View file @
904dc7ed
#!/bin/sh
#!/bin/sh
log
"Running config"
$1
$2
;
set
-e
set
-e
.
/usr/share/debconf/confmodule
.
/usr/share/debconf/confmodule
db_version 2.0
db_version 2.0
if
[
!
-d
"/etc/minerva/"
]
then
mkdir
/etc/minerva/
fi
if
[
-f
/usr/share/dbconfig-common/dpkg/config.pgsql
]
;
then
if
[
-f
/usr/share/dbconfig-common/dpkg/config.pgsql
]
;
then
.
/usr/share/dbconfig-common/dpkg/config.pgsql
.
/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
$@
dbc_go minerva
$@
fi
fi
This diff is collapsed.
Click to expand it.
debian/template/postinst
+
5
−
1
View file @
904dc7ed
...
@@ -39,6 +39,8 @@ case "$1" in
...
@@ -39,6 +39,8 @@ case "$1" in
dbc_generate_include_owner
=
"root:root"
dbc_generate_include_owner
=
"root:root"
dbc_generate_include_perms
=
"0640"
dbc_generate_include_perms
=
"0640"
dbc_generate_include
=
sh:/etc/minerva/db.sh
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
# Need to start postgresql, so it doesn't fail on the installer
invoke-rc.d
--force
postgresql restart
||
true
invoke-rc.d
--force
postgresql restart
||
true
...
@@ -46,10 +48,11 @@ case "$1" in
...
@@ -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 there is a config file generated by db_config_common (on upgrade this file might not be generated)
if
[
-f
/etc/minerva/db.sh
]
if
[
-f
/etc/minerva/db.sh
]
then
.
/etc/minerva/db.sh
.
/etc/minerva/db.sh
# when configuration was cancelled don't create config file
# when configuration was cancelled don't create config file
if
[
-z
"
$dbuser
"
]
if
[
!
-z
"
$dbuser
"
]
then
then
if
[
-z
"
$dbport
"
]
if
[
-z
"
$dbport
"
]
then
then
...
@@ -64,6 +67,7 @@ case "$1" in
...
@@ -64,6 +67,7 @@ case "$1" in
fi
fi
rm
/etc/minerva/db.sh
rm
/etc/minerva/db.sh
fi
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
#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
#for instance in the new war file there was init script that uses some new database features, but they are not
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment