-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Structure to build a Debian package (#7)
* Structure to build a Debian package * Fix reference to GH issue * Add missing .PHONY target * Bring back (un)install targets
- Loading branch information
1 parent
1500d9a
commit cd1bd87
Showing
16 changed files
with
201 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,3 +34,6 @@ pgdoctor_test | |
|
||
# IDEs | ||
.idea | ||
|
||
debian/pgdoctor | ||
debian/pgdoctor.debhelper.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
pgdoctor (0.2.0) unstable; urgency=medium | ||
|
||
* Initial Release. Closes: #4 | ||
|
||
-- Marco Almeida <mfa@thumbtack.com> Thu, 23 Nov 2017 21:45:40 -0800 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Source: pgdoctor | ||
Section: Databases | ||
Priority: optional | ||
Maintainer: Marco Almeida <mfa@thumbtack.com> | ||
Build-Depends: debhelper (>= 9), libpq-dev (>= 9.4), libmicrohttpd-dev | ||
Standards-Version: 3.9.8 | ||
Homepage: https://github.com/thumbtack/pgdoctor | ||
Vcs-Git: https://github.com/thumbtack/pgdoctor.git | ||
|
||
Package: pgdoctor | ||
Architecture: any | ||
Depends: ${shlibs:Depends}, ${misc:Depends}, postgresql-9.4 | postgresql-9.6 | ||
Description: Custom health checks for PostgreSQL | ||
pgDoctor is a simple, lightweight, web service used to define and run custom | ||
health checks on PostgreSQL instances. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ | ||
Upstream-Name: pgdoctor | ||
Source: https://github.com/thumbtack/pgdoctor | ||
|
||
Files: * | ||
Copyright: 2014-2017 Marco Almeida <mfa@thumbtack.com> | ||
License: Apache-2.0 | ||
|
||
License: Apache-2.0 | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
. | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
. | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
. | ||
On Debian systems, the complete text of the Apache License, Version 2.0 | ||
can be found in "/usr/share/common-licenses/Apache-2.0". |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
pgdoctor-dbgsym_0.2.0_amd64.ddeb debug extra | ||
pgdoctor_0.2.0_amd64.buildinfo Databases optional | ||
pgdoctor_0.2.0_amd64.deb Databases optional |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
pgdoctor usr/bin/ | ||
pgdoctor.cfg etc/ | ||
pgdoctor.service etc/systemd/system/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
.\" Hey, EMACS: -*- nroff -*- | ||
.\" (C) Copyright 2014-2017 Marco Almeida <mfa@thumbtack.com>, | ||
.\" | ||
.\" First parameter, NAME, should be all caps | ||
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection | ||
.\" other parameters are allowed: see man(7), man(1) | ||
.TH pgDoctor 1 "2017" | ||
.\" Please adjust this date whenever revising the manpage. | ||
.\" | ||
.\" Some roff macros, for reference: | ||
.\" .nh disable hyphenation | ||
.\" .hy enable hyphenation | ||
.\" .ad l left justify | ||
.\" .ad b justify to both left and right margins | ||
.\" .nf disable filling | ||
.\" .fi enable filling | ||
.\" .br insert line break | ||
.\" .sp <n> insert n+1 empty lines | ||
.\" for manpage-specific macros, see man(7) | ||
.SH NAME | ||
pgdoctor \- Custom health checks for PostgreSQL | ||
.SH SYNOPSIS | ||
.B pgdoctor | ||
.RI [ filename ] | ||
.SH DESCRIPTION | ||
This manual page documents briefly the | ||
.B pgdoctor | ||
service. | ||
.PP | ||
.\" TeX users may be more comfortable with the \fB<whatever>\fP and | ||
.\" \fI<whatever>\fP escape sequences to invode bold face and italics, | ||
.\" respectively. | ||
\fBpgdoctor\fP is a simple, lightweight, web service used to define | ||
and run custom health checks on PostgreSQL instances. | ||
.SH FILES | ||
The only (optional) argument \fBpgdoctor\fP accepts if the | ||
configuration file for runtime configuration options. It defaults to | ||
\fB/etc/pgdoctor.cfg\fP. | ||
.SH RUNTIME CONFIGURATION | ||
.TP | ||
.B http_port | ||
Port to listen on; defaults to \fI8071\fP | ||
.TP | ||
.B syslog_facility | ||
Syslog facility (local) to messages log to; defaults to \fIlocal7\fP | ||
.TP | ||
.B pg_host | ||
Host name of the instance \fBpgDoctor\fP will connect to; defaults to | ||
\fIlocalhost\fP | ||
.TP | ||
.B pg_gport | ||
Port on which the target server is listening; defaults to \fI5432\fP | ||
.TP | ||
.B pg_user | ||
User to connect with; defaults to \fIpostgres\fP | ||
.TP | ||
.B pg_password | ||
Password to use with pg_user; defaults to \fIempty\fP | ||
.TP | ||
.B pg_database | ||
Name of the database to connect to; defaults to \fIpostgres\fP | ||
.TP | ||
.B pg_connection_timeout | ||
Timeout (seconds) when connecting to PostgreSQL; defaults by \fI3\fP | ||
.TP | ||
.B pg_max_replication_lag | ||
Maximum acceptable delay (seconds) on streaming replication; defaults | ||
to \fI-1\fP (disabled) | ||
.SH EXAMPLES \(em CUSTOM HEALTH CHECKS | ||
Each of the following two SQL queries defines a custom health check | ||
that will succeed if and only if it is executed without any errors | ||
(notice the mandatory double quotes): | ||
.IP | ||
.nf | ||
"SELECT 1" | ||
.fi | ||
.IP | ||
.nf | ||
"SELECT NOW()" | ||
.fi | ||
.P | ||
The next one, more complex, custom health check includes a condition | ||
on the result of the SQL query (which must be exactly \fIone\fP | ||
field): | ||
.IP | ||
.nf | ||
"SELECT on_rotation FROM maintenance WHERE hostname = 'production-replica3'" = "1" | ||
.fi | ||
.P | ||
This check will succeed if and only if the value of the returned field | ||
\fBon_rotation\fP equals \fB1\fP. | ||
.SH SEE ALSO | ||
.BR https://github.com/thumbtack/pgdoctor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
debian/pgdoctor.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
shlibs:Depends=libc6 (>= 2.4), libmicrohttpd12 (>= 0.9.50), libpq5 | ||
misc:Depends= | ||
misc:Pre-Depends= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/make -f | ||
# See debhelper(7) (uncomment to enable) | ||
# output every command that modifies files on the build system. | ||
#export DH_VERBOSE = 1 | ||
|
||
|
||
# see FEATURE AREAS in dpkg-buildflags(1) | ||
#export DEB_BUILD_MAINT_OPTIONS = hardening=+all | ||
|
||
# see ENVIRONMENT in dpkg-buildflags(1) | ||
# package maintainers to append CFLAGS | ||
#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic | ||
# package maintainers to append LDFLAGS | ||
#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed | ||
|
||
|
||
%: | ||
dh $@ | ||
|
||
|
||
# dh_make generated override targets | ||
# This is example for Cmake (See https://bugs.debian.org/641051 ) | ||
#override_dh_auto_configure: | ||
# dh_auto_configure -- # -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3.0 (native) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[Unit] | ||
Description=Unit for pgDoctor | ||
After=postgresql.service | ||
Requires=postgresql.service | ||
|
||
[Service] | ||
TimeoutStartSec=0 | ||
Type=simple | ||
ExecStart=/usr/bin/pgdoctor | ||
|
||
[Install] | ||
WantedBy=multi-user.target |