Skip to content

Commit

Permalink
Merge pull request #233 from turb/master
Browse files Browse the repository at this point in the history
Support systemd on Debian
  • Loading branch information
j1n6 committed Feb 17, 2017
2 parents 1eede2a + 239d6ce commit e21b258
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 6 deletions.
4 changes: 4 additions & 0 deletions builder/bamboo.default
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Bamboo default parameters
BAMBOO_CONFIG=/opt/bamboo/config/development.json
BAMBOO_LOG=/var/bamboo/log/bamboo.log

21 changes: 21 additions & 0 deletions builder/bamboo.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[Unit]
Description=MESOS Marathon Bamboo
Requires=network-online.target

[Install]
WantedBy=multi-user.target

[Service]
EnvironmentFile=/etc/default/bamboo
Type=simple
Restart=on-failure
RestartSec=15s
TimeoutSec=5min
IgnoreSIGPIPE=no
KillMode=process
PIDFile=/run/bamboo.pid
RemainAfterExit=no
User=bamboo
Group=bamboo
ExecStart=/opt/bamboo/bamboo -config $BAMBOO_CONFIG -log $BAMBOO_LOG

4 changes: 2 additions & 2 deletions builder/build.after-install
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ GROUP="bamboo"
SHELL="/bin/false"

case "$1" in
configure)
""|configure) # Work around https://github.com/jordansissel/fpm/issues/1272
if [ ! -d "${DATADIR}/log" ]; then
mkdir -p ${DATADIR}/log
fi
Expand Down Expand Up @@ -36,4 +36,4 @@ case "$1" in
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
esac
6 changes: 3 additions & 3 deletions builder/build.after-remove
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ SHELL="/bin/false"

set -e

if getent passwd | grep -q ${USER}; then
if getent passwd | grep -q "^${USER}:"; then
userdel ${USER}
fi

if getent group | grep -q ${GROUP}; then
if getent group | grep -q "^${GROUP}:"; then
groupdel ${GROUP}
fi
fi
4 changes: 3 additions & 1 deletion builder/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function build() {
cp ${origdir}/bamboo ${name}/${installdir}/bamboo/bamboo
chmod 755 ${name}/${installdir}/bamboo/bamboo

# Link default confiugration
# Link default configuration
cp -rp ${origdir}/config/* ${name}/${installdir}/bamboo/config/.

# Distribute UI webapp
Expand Down Expand Up @@ -65,6 +65,8 @@ function mkdeb() {
--before-remove ../../build.before-remove \
-m "${USER}@${HOSTNAME}" \
--deb-upstart ../../bamboo-server \
--deb-systemd ../../bamboo.service \
--deb-default ../../bamboo.default \
--license "${license}" \
--prefix=/ \
-s dir \
Expand Down

0 comments on commit e21b258

Please sign in to comment.