Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable support for systemd #13

Merged
merged 3 commits into from
Oct 2, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@
---
language: python
python: "3.5"
python: "2.7"

# Use Ubunt 14.04
sudo: required
dist: trusty
matrix:
include:
- os: linux
sudo: required
dist: trusty
- os: linux
sudo: required
dist: xenial

# Install pip
addons:
apt:
packages:
- python-pip

before_install:
# Make sure everything's up to date.
- sudo apt-get update -qq

install:
# Install ansible
- pip2 install ansible
Expand Down
10 changes: 9 additions & 1 deletion tasks/teamcity-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,19 @@
dest: "/etc/default/teamcity-server"
mode: 0644

- name: "Put TeamCity service file"
- name: "Put TeamCity service file (sysv)"
template:
src: "teamcity-server.conf.j2"
dest: "/etc/init/teamcity-server.conf"
mode: 0644
when: "ansible_service_mgr != 'systemd'"

- name: "Put TeamCity service file (systemd)"
template:
src: "teamcity-agent.service.j2"
dest: "/lib/systemd/system/teamcity-server.service"
mode: 0644
when: "ansible_service_mgr == 'systemd'"

- name: "Stop TeamCity Server before upgrade"
service:
Expand Down
13 changes: 13 additions & 0 deletions templates/teamcity-server.service.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#/lib/systemd/system
[Unit]
Description="TeamCity Server"

[Service]
Type=forking
User={{ teamcity_server_user_name }}
PIDFile={{ teamcity_server_dir }}/logs/teamcity-server.pid
ExecStart={{ teamcity_server_dir }}/bin/teamcity-server.sh start
ExecStop={{ teamcity_server_dir }}/bin/teamcity-server.sh stop

[Install]
WantedBy=multi-user.target