2015-12-11 02:27:50 +01:00
|
|
|
JENKINS_HOME ?= /var/lib/jenkins
|
|
|
|
JENKINS_URL = http://mirrors.jenkins-ci.org/war/latest/jenkins.war
|
|
|
|
|
|
|
|
preinstall:
|
|
|
|
|
|
|
|
create_user:
|
|
|
|
-$(inroot) useradd --system \
|
|
|
|
--comment "Jenkins CI" \
|
|
|
|
--home-dir=$(JENKINS_HOME) \
|
|
|
|
--create-home \
|
|
|
|
jenkins
|
|
|
|
|
|
|
|
|
|
|
|
$(CHROOT)/$(JENKINS_HOME)/jenkins.war:
|
|
|
|
$(inroot) wget -O $(JENKINS_HOME)/jenkins.war $(JENKINS_URL)
|
|
|
|
|
|
|
|
|
|
|
|
install_jenkins:
|
|
|
|
$(MAKE) $(CHROOT)/$(JENKINS_HOME)/jenkins.war
|
|
|
|
|
|
|
|
|
|
|
|
postinstall: jenkins.service nginx.conf
|
|
|
|
$(MAKE) create_user
|
|
|
|
$(inroot) rm -rf $(JENKINS_HOME)
|
|
|
|
$(inroot) mkdir -p $(JENKINS_HOME)
|
|
|
|
$(MAKE) install_jenkins
|
|
|
|
$(inroot) chown -R jenkins:jenkins $(JENKINS_HOME)
|
2016-07-23 13:29:25 +02:00
|
|
|
cp jenkins.service $(CHROOT)/etc/systemd/system
|
2015-12-11 02:27:50 +01:00
|
|
|
$(inroot) systemctl enable jenkins.service
|
2016-07-23 13:29:25 +02:00
|
|
|
cp nginx.conf $(CHROOT)/etc/nginx/nginx.conf
|
2015-12-11 02:27:50 +01:00
|
|
|
$(inroot) systemctl enable nginx.service
|
|
|
|
|
|
|
|
clean:
|
|
|
|
|
|
|
|
|
|
|
|
.PHONY: create_user preinstall postinstall clean install_jenkins
|