Created
April 12, 2017 13:59
-
-
Save taksan/4872aece92ab9e14eeb7db33dcba3e3b to your computer and use it in GitHub Desktop.
This file contains hidden or 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
[Unit] | |
Description=Taskboard service | |
Requires=docker.service | |
[Service] | |
Type=simple | |
User=root | |
ExecStart=/etc/init.d/taskboard-service start | |
ExecStop=/etc/init.d/taskboard-service stop | |
[Install] | |
WantedBy=multi-user.target |
/etc/systemd/system/docker-iptables.service
[Unit]
Description=Fix to allow docker containers to connect to host ports
After=network.target
[Service]
Type=oneshot
ExecStart=iptables -I INPUT 4 -i docker0 -j ACCEPT
[Install]
WantedBy=default.target
/etc/init.d/dashboard-service
#! /bin/sh
do_start() {
iptables -I INPUT 4 -i docker0 -j ACCEPT
docker run --privileged=true -p 3030:3030 --name lf-smashing -v /opt/smashing-data:/opt/dashboard_config -t devopsobj/liferay-smashing
}
do_stop() {
docker stop lf-smashing
docker rm lf-smashing
}
case "$1" in
start)
do_start
;;
stop)
do_stop
;;
restart)
do_stop
do_start
;;
update)
do_stop
docker pull devopsobj/liferay-smashing
do_start
;;
*)
echo "Usage: /etc/init.d/dashboard-service {start|stop|restart|update}"
exit 1
;;
esac
exit 0
/etc/init.d/jenkins-service
#! /bin/sh
do_start() {
docker rm -f lf-jenkins2>/dev/null
docker run --privileged=true -p 8080:8080 --name lf-jenkins -v /opt/jenkins-data:/var/lib/jenkins/ -d -it devopsobj/liferay-jenkins
}
do_stop() {
docker stop lf-jenkins
docker rm -f lf-jenkins 2>/dev/null
}
case "$1" in
start)
do_start
;;
stop)
do_stop
;;
restart)
do_stop
do_start
;;
update)
do_stop
docker pull devopsobj/liferay-jenkins
do_start
;;
*)
echo "Usage: /etc/init.d/jenkins-service {start|stop|restart|update}"
exit 1
;;
esac
exit 0
To load the services, reload the daemon:
systemctl daemon-reload
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
/etc/systemd/system/jenkins.service
[Unit]
Description=Jenkins service
Requires=docker.service
After=docker.service
[Service]
Type=simple
ExecStart=/etc/init.d/jenkins-service start
ExecStop=/etc/init.d/jenkins-service stop
[Install]
WantedBy=multi-user.target