Commit 7877599c authored by Free Ekanayaka's avatar Free Ekanayaka

Initial packaging

parent ca84022c
sudo: required
services:
- docker
env:
- TRAVIS_DEBIAN_AUTOPKGTEST=false
script:
- wget -O- http://travis.debian.net/script.sh | sh -
branches:
except:
- /^debian\/\d/
SystemD customization
=====================
To customize SystemD parameters like the command line used to start the
webhook service, create a file named /etc/systemd/system/webhook.service
with contents like:
[Service]
ExecStart=
ExecStart=/usr/bin/webhook -verbose -port 8000
User=my-user
Group=my-group
webhook (2.5.0-1) unstable; urgency=medium
* Initial release (Closes: #826748)
-- Free Ekanayaka <freee@debian.org> Fri, 21 Oct 2016 13:26:43 +0000
Source: webhook
Section: devel
Priority: extra
Maintainer: Debian Go Packaging Team <pkg-go-maintainers@lists.alioth.debian.org>
Uploaders: Free Ekanayaka <freee@debian.org>
Build-Depends: debhelper (>= 9),
dh-systemd (>= 1.5),
dh-golang,
golang-go,
golang-github-urfave-negroni-dev,
golang-github-gorilla-mux-dev,
golang-github-fsnotify-fsnotify-dev
Standards-Version: 3.9.8
Homepage: https://github.com/adnanh/webhook
Vcs-Browser: https://anonscm.debian.org/cgit/pkg-go/packages/webhook.git
Vcs-Git: https://anonscm.debian.org/git/pkg-go/packages/webhook.git
XS-Go-Import-Path: github.com/adnanh/webhook
Package: webhook
Architecture: any
Built-Using: ${misc:Built-Using}
Depends: ${shlibs:Depends},
${misc:Depends}
Description: Small server for creating HTTP endpoints (hooks)
Webhook is a lightweight configurable tool written in Go, that
allows you to easily create HTTP endpoints (hooks) on your
server, which you can use to execute configured commands. You
can also pass data from the HTTP request (such as headers,
payload or query variables) to your commands. webhook also
allows you to specify rules which have to be satisfied in
order for the hook to be triggered.
.
For example, if you're using Github or Bitbucket, you can
use webhook to set up a hook that runs a redeploy script
for your project on your staging server, whenever you push
changes to the master branch of your project.
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: webhook
Upstream-Contact: Adnan Hajdarevic <adnanh@gmail.com>
Source: https://github.com/adnanh/webhook
Files: *
Copyright: 2015 Adnan Hajdarevic <adnanh@gmail.com>
License: Expat
Files: debian/*
Copyright: 2016 Free Ekanayaka <freee@debian.org>
License: Expat
Comment: Debian packaging is licensed under the same terms as upstream
License: Expat
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
.
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
README.md
hooks.json.example
[DEFAULT]
pristine-tar = True
From: Free Ekanayaka <freee@debian.org>
Date: Fri, 21 Oct 2016 13:51:50 +0000
Subject: local-fsnotify
Use local fsnotify package and not the one from gopkg.in
---
webhook.go | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/webhook.go b/webhook.go
index 20ac190..e71a40e 100644
--- a/webhook.go
+++ b/webhook.go
@@ -14,10 +14,10 @@ import (
"github.com/adnanh/webhook/hook"
- "github.com/codegangsta/negroni"
+ "github.com/urfave/negroni"
"github.com/gorilla/mux"
- fsnotify "gopkg.in/fsnotify.v1"
+ "github.com/fsnotify/fsnotify"
)
const (
From: Free Ekanayaka <freee@debian.org>
Date: Wed, 26 Oct 2016 13:35:45 +0000
Subject: logger
Rename ALogger to Logger, since the API has changed in negroni.
---
webhook.go | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/webhook.go b/webhook.go
index e71a40e..8269845 100644
--- a/webhook.go
+++ b/webhook.go
@@ -111,10 +111,10 @@ func main() {
}
l := negroni.NewLogger()
- l.ALogger = log.New(os.Stderr, "[webhook] ", log.Ldate|log.Ltime)
+ l.Logger = log.New(os.Stderr, "[webhook] ", log.Ldate|log.Ltime)
negroniRecovery := &negroni.Recovery{
- Logger: l.ALogger,
+ Logger: l.Logger,
PrintStack: true,
StackAll: false,
StackSize: 1024 * 8,
0001-local-fsnotify.patch
0002-logger.patch
#!/usr/bin/make -f
export DH_GOLANG_INSTALL_EXTRA := \
test/hooks.json.tmpl \
hooks.json.example
export DH_GOLANG_EXCLUDES := test
%:
dh $@ --buildsystem=golang --with=golang --with systemd
override_dh_auto_install:
dh_auto_install -- --no-source
override_dh_installinit:
dh_systemd_enable -popenstack --name=openstack openstack.service
dh_installinit -popenstack --no-start --noscripts
dh_systemd_start -popenstack --no-restart-on-upgrade
extend-diff-ignore = "^\.travis\.yml$"
Tests: simple-webhook
Restrictions: needs-root, isolation-container
Depends: @,
systemd,
curl
#!/bin/sh -e
# Create our hook command
cat <<EOF > $AUTOPKGTEST_TMP/hello
#!/bin/sh
echo -n hello
EOF
chmod 755 $AUTOPKGTEST_TMP/hello
# Create the hooks file
cat <<EOF > /etc/webhook.conf
[
{
"id": "hello",
"include-command-output-in-response": true,
"execute-command": "$AUTOPKGTEST_TMP/hello"
}
]
EOF
systemctl restart webhook
sleep 2
if [ "$(curl --stderr /dev/null http://localhost:9000/hooks/hello)" != "hello" ]; then
echo "Unexpected hook output"
exit 1
fi
[Unit]
Description=Small server for creating HTTP endpoints (hooks)
Documentation=https://github.com/adnanh/webhook/
[Service]
ExecStart=/usr/bin/webhook -nopanic -hooks /etc/webhook.conf
[Install]
WantedBy=multi-user.target
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment