-
Notifications
You must be signed in to change notification settings - Fork 138
/
Makefile
90 lines (75 loc) · 3.36 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
SHELL := /bin/bash
test: filecheck bashate perlcheck rubycheck pythoncheck rounduptest flake8 python_unittest jjb_test
clean:
rm -f scripts/jenkins/jenkins-job-triggerc scripts/lib/libvirt/{net-configc,vm-startc,compute-configc,net-startc,admin-configc,cleanupc}
rm -rf __jjb_cache
find -name \*.pyc -print0 | xargs -0 rm -f
filecheck:
! git ls-tree -r HEAD --name-only | \
egrep -v 'Makefile|sample-logs/.*\.txt$$' | \
xargs grep $$'\t'
bashate:
for f in \
`find -name \*.sh` \
hostscripts/ci1/* \
hostscripts/clouddata/{syncSLErepos,syncgitrepos} \
hostscripts/gatehost/{sudo-freshadminvm,freshadminvm} \
hostscripts/nagios/ci-o-o \
mkcloudruns/*/[^R]*\
scripts/{mkcloud,mkchroot,repochecker} \
scripts/jenkins/update_automation \
scripts/mkcloudhost/{runtestn,mkcloud_free_pool,mkcloude,fixlibvirt,generate-radvd-conf} \
scripts/mkcloudhost/{runtestmulticloud,boot.local,boot.mkcloud,mkcloud_reserve_pool,runtestn} \
scripts/mkcloudhost/{routed.cloud,hacloud.common,cloudrc.host,cloudfunc} \
; \
do \
echo "checking $$f"; \
bash -n $$f || exit 3; \
bashate --ignore E006,E010,E011,E020,E042 $$f || exit 4; \
! grep $$'\t' $$f || exit 5; \
done
perlcheck:
cd scripts && \
for f in `find -name \*.pl` jenkins/{apicheck,grep,japi} mkcloudhost/{allocpool,correlatevirsh} ; \
do \
perl -wc $$f || exit 2; \
done
rubycheck:
for f in `find -name \*.rb` scripts/jenkins/jenkinslog; \
do \
ruby -wc $$f || exit 2; \
done
pythoncheck:
for f in `find -name \*.py` scripts/lib/libvirt/{admin-config,cleanup,compute-config,net-config,net-start,vm-start} scripts/jenkins/jenkins-job-trigger; \
do \
python2 -m py_compile $$f || exit 22; \
python3 -m py_compile $$f || exit 22; \
done
rounduptest:
cd scripts && roundup
cd scripts/jenkins && roundup
flake8:
flake8 .
python_unittest:
python2 -m unittest discover -v
python3 -m unittest discover -v
gerrit-project-regexp:
scripts/jenkins/cloud/gerrit/project-map2project-regexp.py master > jenkins/ci.suse.de/gerrit-project-regexp-cloud9.txt
scripts/jenkins/cloud/gerrit/project-map2project-regexp.py stable/pike > jenkins/ci.suse.de/gerrit-project-regexp-cloud8.txt
jjb_test: gerrit-project-regexp
# use a cache that is not shared between CI jobs so multiple jobs can run in parallel without tripping on each others cache lock files
XDG_CACHE_HOME=__jjb_cache jenkins-jobs --ignore-cache test jenkins/ci.suse.de:jenkins/ci.suse.de/templates/ cloud* openstack* > /dev/null
XDG_CACHE_HOME=__jjb_cache jenkins-jobs --ignore-cache test jenkins/ci.opensuse.org:jenkins/ci.opensuse.org/templates/ cloud* openstack* > /dev/null
cisd_deploy: gerrit-project-regexp
jenkins-jobs --conf /etc/jenkins_jobs/jenkins_jobs-cisd.ini update jenkins/ci.suse.de:jenkins/ci.suse.de/templates/ cloud\* openstack\* ardana\*
cioo_deploy:
jenkins-jobs --conf /etc/jenkins_jobs/jenkins_jobs-cioo.ini update jenkins/ci.opensuse.org:jenkins/ci.opensuse.org/templates/ openstack*
shellcheck:
shellcheck `grep -Erl '^#! ?/bin/b?a?sh'`
install:
sudo zypper install perl-JSON perl-JSON-XS perl-libxml-perl perl-libwww-perl python-pip python3-pip libvirt-python python3-libvirt-python python2-flake8-import-order python3-bashate python3-jenkins-job-builder
git clone https://github.com/SUSE-Cloud/roundup && \
cd roundup && \
./configure && \
make && \
sudo make install