forked from gvalkov/jenkins-webapi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
39 lines (32 loc) · 981 Bytes
/
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
39
SHELL := python
JENKINS_WAR_URL := http://mirrors.jenkins-ci.org/war/latest/jenkins.war
JENKINS_CLI_JAR := tests/tmp/latest/jenkins-cli.jar
JENKINS_DESTDIR := tests/tmp/latest
JENKINS_ADDR := localhost
JENKINS_PORT := 60888
JENKINS_CPORT := 60887
start-jenkins:
config = {
'url': '$(JENKINS_WAR_URL)',
'destdir': '$(JENKINS_DESTDIR)',
'addr': '$(JENKINS_ADDR)',
'port': $(JENKINS_PORT),
'cport': $(JENKINS_CPORT),
}
from tests.install import JenkinsInstall
ji = JenkinsInstall(**config)
ji.bootstrap() ; print()
ji.start() ; print()
ji.wait()
remove-jobs:
url = 'http://$(JENKINS_ADDR):$(JENKINS_PORT)'
from tests.refapi import JenkinsCLI
cli = JenkinsCLI(url, '$(JENKINS_CLI_JAR)')
for job in cli.list_jobs():
cli.delete_job(job)
stop-jenkins:
addr, port = '$(JENKINS_ADDR)', $(JENKINS_CPORT)
from subprocess import check_call as run
run('echo 0 | nc %s %s' % (addr, port), shell=True)
.ONESHELL:
.PHONY: run-latest-jenkink