-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
38 lines (30 loc) · 1.22 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
build:
@echo "******** Building Jenkins in Travis CI ********"
@docker-compose build
build-jenkins: clean
@echo "******** Building Jenkins ********"
@docker-compose build
run-jenkins: build-jenkins
@echo "******** Running Jenkins ********"
@echo "** this target creates the jenkins_home volume if not build before **"
@docker-compose up -d
stop-jenkins: backup-jenkins update-plugins
@docker-compose down
kill:
@docker-compose down
backup-jenkins:
@echo "******** Copying /var/jenkins_home to ./jenkins_home ********"
@rm -rf backup/jenkins_home
@docker cp jenkins:/var/jenkins_home/. backup/jenkins_home
update-plugins:
@echo "******** Backing up plugins to docker/jenkins/plugins.txt ********"
@chmod +x ./scripts/update-plugins.sh
@./scripts/update-plugins.sh
clean:
@echo "******** Deleting jenkins volume, image and container ********"
@docker container rm jenkins jenkins-slave && ([ $$? -eq 0 ] && echo "success") || echo "unable to complete"
@docker image rm jenkins jenkins-slave && ([ $$? -eq 0 ] && echo "success") || echo "unable to complete"
@docker volume rm nopipeline-containers_jenkins_home && ([ $$? -eq 0 ] && echo "success") || echo "unable to complete"
test: clean
docker-compose build
docker-compose up