Skip to content

Commit 4b46d82

Browse files
committed
package update
1 parent abebc63 commit 4b46d82

15 files changed

+247
-162
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,5 @@
1919
/debian/cnb-cache-sqlite.substvars
2020
/debian/cnb-cache.postrm.debhelper
2121
/debian/tmp/composer.json
22+
/debian/cnb-cache-mysql.postrm.debhelper
23+
/debian/cnb-cache-sqlite.postrm.debhelper

Jenkinsfile

Lines changed: 0 additions & 89 deletions
This file was deleted.

debian/cnb-cache-mysql.config

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/sh
2+
3+
set -e
4+
5+
. /usr/share/debconf/confmodule
6+
7+
db_version 2.0
8+
9+
db_title Reconfigure webserever
10+
db_input high cnb-cache/reconfigure-webserver || true
11+
12+
db_go || true
13+
db_stop
14+
15+
if [ -f /usr/share/dbconfig-common/dpkg/config ]; then
16+
# source dbconfig-common stuff
17+
. /usr/share/dbconfig-common/dpkg/config
18+
19+
if [ -f /usr/share/dbconfig-common/dpkg/config.mysql ]; then
20+
. /usr/share/dbconfig-common/dpkg/config.mysql
21+
dbc_go cnb-cache "$@"
22+
fi
23+
fi

debian/cnb-cache-mysql.postinst

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
#!/bin/sh
2+
set -e
3+
set -x
4+
5+
6+
. /usr/share/debconf/confmodule
7+
8+
db_version 2.0
9+
10+
11+
12+
13+
14+
case "$1" in
15+
configure)
16+
17+
18+
if [ -f /usr/share/dbconfig-common/dpkg/postinst ]; then
19+
. /usr/share/dbconfig-common/dpkg/postinst
20+
# shellcheck disable=SC2034
21+
dbc_generate_include_args="-U -o template_infile=/usr/lib/cnb-cache/.env.template"
22+
# shellcheck disable=SC2034
23+
dbc_generate_include=template:/etc/cnb-cache/cnb-cache.env
24+
# shellcheck disable=SC2034
25+
dbc_generate_include_owner="root:www-data"
26+
# shellcheck disable=SC2034
27+
dbc_generate_include_perms="664"
28+
# shellcheck disable=SC2034
29+
dbc_dbfile_owner="www-data:www-data"
30+
# shellcheck disable=SC2034
31+
dbc_dbfile_perms="0664"
32+
# shellcheck disable=SC2034
33+
dbc_dbuser=cnb-cache
34+
# shellcheck disable=SC2034
35+
dbc_dbname=cnb-cache
36+
37+
dbc_go cnb-cache-mysql "$@"
38+
39+
echo "############################"
40+
cat /etc/cnb-cache/cnb-cache.env
41+
echo "############################"
42+
43+
phinx migrate -c /usr/lib/cnb-cache/phinx-adapter.php
44+
45+
if [ -f /var/lib/cnb-cache/cnb-cache ]; then
46+
chown root:www-data /var/lib/cnb-cache
47+
chmod ug+rw /var/lib/cnb-cache
48+
fi
49+
50+
fi
51+
52+
53+
;;
54+
55+
abort-upgrade|abort-remove|abort-deconfigure)
56+
;;
57+
58+
*)
59+
echo "postinst called with unknown argument \`$1'" >&2
60+
exit 1
61+
;;
62+
esac
63+
64+
65+
#DEBHELPER#
66+
67+
exit 0

debian/cnb-cache-mysql.postrm

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/sh
2+
set -e
3+
4+
case "$1" in
5+
purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
6+
7+
if [ "$1" = "purge" ]; then
8+
rm -f /etc/cnb-cache/cnb-cache.env
9+
if command -v ucf >/dev/null; then
10+
ucf --purge /etc/cnb-cache/cnb-cache.env
11+
ucfr --purge cnb-cache-mysql /etc/cnb-cache/cnb-cache.env
12+
fi
13+
fi
14+
15+
;;
16+
17+
*)
18+
echo "postrm called with unknown argument \`$1'" >&2
19+
exit 1
20+
;;
21+
esac
22+
23+
24+
#DEBHELPER#
25+
26+
exit 0

debian/cnb-cache-sqlite.config

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/sh
2+
3+
set -e
4+
5+
. /usr/share/debconf/confmodule
6+
7+
db_version 2.0
8+
9+
db_title Reconfigure webserever
10+
db_input high cnb-cache/reconfigure-webserver || true
11+
12+
db_go || true
13+
db_stop
14+
15+
if [ -f /usr/share/dbconfig-common/dpkg/config ]; then
16+
# source dbconfig-common stuff
17+
. /usr/share/dbconfig-common/dpkg/config
18+
19+
if [ -f /usr/share/dbconfig-common/dpkg/config.sqlite3 ]; then
20+
. /usr/share/dbconfig-common/dpkg/config.sqlite3
21+
dbc_go cnb-cache "$@"
22+
fi
23+
fi

debian/cnb-cache-sqlite.postinst

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
#!/bin/sh
2+
set -e
3+
set -x
4+
5+
6+
. /usr/share/debconf/confmodule
7+
8+
db_version 2.0
9+
10+
11+
12+
13+
14+
case "$1" in
15+
configure)
16+
17+
18+
if [ -f /usr/share/dbconfig-common/dpkg/postinst ]; then
19+
. /usr/share/dbconfig-common/dpkg/postinst
20+
# shellcheck disable=SC2034
21+
dbc_generate_include_args="-U -o template_infile=/usr/lib/cnb-cache/.env.template"
22+
# shellcheck disable=SC2034
23+
dbc_generate_include=template:/etc/cnb-cache/cnb-cache.env
24+
# shellcheck disable=SC2034
25+
dbc_generate_include_owner="root:www-data"
26+
# shellcheck disable=SC2034
27+
dbc_generate_include_perms="664"
28+
# shellcheck disable=SC2034
29+
dbc_dbfile_owner="www-data:www-data"
30+
# shellcheck disable=SC2034
31+
dbc_dbfile_perms="0664"
32+
# shellcheck disable=SC2034
33+
dbc_dbuser=cnb-cache
34+
# shellcheck disable=SC2034
35+
dbc_dbname=cnb-cache
36+
37+
dbc_go cnb-cache-sqlite "$@"
38+
39+
echo "############################"
40+
cat /etc/cnb-cache/cnb-cache.env
41+
echo "############################"
42+
43+
phinx migrate -c /usr/lib/cnb-cache/phinx-adapter.php
44+
45+
if [ -f /var/lib/cnb-cache/cnb-cache ]; then
46+
chown root:www-data /var/lib/cnb-cache
47+
chmod ug+rw /var/lib/cnb-cache
48+
fi
49+
50+
fi
51+
52+
53+
;;
54+
55+
abort-upgrade|abort-remove|abort-deconfigure)
56+
;;
57+
58+
*)
59+
echo "postinst called with unknown argument \`$1'" >&2
60+
exit 1
61+
;;
62+
esac
63+
64+
65+
#DEBHELPER#
66+
67+
exit 0

debian/cnb-cache-sqlite.postrm

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/sh
2+
set -e
3+
4+
case "$1" in
5+
purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
6+
7+
if [ "$1" = "purge" ]; then
8+
rm -f /etc/cnb-cache/cnb-cache.env
9+
if command -v ucf >/dev/null; then
10+
ucf --purge /etc/cnb-cache/cnb-cache.env
11+
ucfr --purge cnb-cache-sqlite /etc/cnb-cache/cnb-cache.env
12+
fi
13+
fi
14+
15+
;;
16+
17+
*)
18+
echo "postrm called with unknown argument \`$1'" >&2
19+
exit 1
20+
;;
21+
esac
22+
23+
24+
#DEBHELPER#
25+
26+
exit 0

debian/cnb-cache.config

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/sh
2+
3+
set -e
4+
5+
. /usr/share/debconf/confmodule
6+
7+
db_version 2.0
8+
9+
db_title Reconfigure webserever
10+
db_input high cnb-cache/reconfigure-webserver || true
11+
12+
db_go || true
13+
db_stop
File renamed without changes.

0 commit comments

Comments
 (0)