-
Notifications
You must be signed in to change notification settings - Fork 112
/
macros.yaml
1086 lines (972 loc) · 32 KB
/
macros.yaml
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
- builder:
name: contact
builders:
- shell: |
#!/bin/sh
echo "For problems with this job, contact {name} <{email}> freenode: {irc}"
- builder:
name: print-template-name
builders:
- shell: 'echo JJB template: {template-name}'
- builder:
name: zuul-git-prep
builders:
- shell: |
#!/bin/bash -xe
CLONEMAP=`mktemp`
function cleanup {
# In cases where zuul-cloner is aborted during a git
# clone operation, git will remove the git work tree in
# its cleanup. The work tree in these jobs is the
# workspace directory, which means that subsequent
# jenkins post-build actions can not run because the
# workspace has been removed.
# To reduce the likelihood of this having an impact,
# recreate the workspace directory if needed
mkdir -p $WORKSPACE
rm -f $CLONEMAP
}
trap cleanup EXIT
cat > $CLONEMAP << EOF
clonemap:
- name: $ZUUL_PROJECT
dest: .
EOF
/usr/zuul-env/bin/zuul-cloner -m $CLONEMAP --cache-dir /opt/git \
git://git.openstack.org $ZUUL_PROJECT
- builder:
name: zuul-git-prep-upper-constraints
builders:
- shell: |
#!/bin/bash -xe
CLONEMAP=`mktemp`
REQS_DIR=`mktemp -d`
function cleanup {
mkdir -p $WORKSPACE
rm -rf $CLONEMAP $REQS_DIR
}
trap cleanup EXIT
cat > $CLONEMAP << EOF
clonemap:
- name: $ZUUL_PROJECT
dest: .
EOF
# zuul cloner works poorly if there are 2 names that are the
# same in here.
if [[ "$ZUUL_PROJECT" != "openstack/requirements" ]]; then
cat >> $CLONEMAP << EOF
- name: openstack/requirements
dest: $REQS_DIR
EOF
fi
/usr/zuul-env/bin/zuul-cloner -m $CLONEMAP --cache-dir /opt/git \
git://git.openstack.org $ZUUL_PROJECT openstack/requirements
# REQS_DIR is not set for openstack/requirements and there's also
# no need to copy in this case.
if [[ "$ZUUL_PROJECT" != "openstack/requirements" ]]; then
cp $REQS_DIR/upper-constraints.txt ./
fi
- builder:
name: zuul-git-branch-prep-upper-constraints
builders:
- shell: |
#!/bin/bash -xe
export BRANCH={branch}
CLONEMAP=`mktemp`
REQS_DIR=`mktemp -d`
function cleanup {{
mkdir -p $WORKSPACE
rm -rf $CLONEMAP $REQS_DIR
}}
trap cleanup EXIT
cat > $CLONEMAP << EOF
clonemap:
- name: $ZUUL_PROJECT
dest: .
EOF
# zuul cloner works poorly if there are 2 names that are the
# same in here.
if [[ "$ZUUL_PROJECT" != "openstack/requirements" ]]; then
cat >> $CLONEMAP << EOF
- name: openstack/requirements
dest: $REQS_DIR
EOF
fi
/usr/zuul-env/bin/zuul-cloner -m $CLONEMAP --cache-dir /opt/git \
--branch=$BRANCH \
git://git.openstack.org $ZUUL_PROJECT openstack/requirements
# REQS_DIR is not set for openstack/requirements and there's also
# no need to copy in this case.
if [[ "$ZUUL_PROJECT" != "openstack/requirements" ]]; then
cp $REQS_DIR/upper-constraints.txt ./
fi
- builder:
name: zuul-git-prep-upper-constraints-cross
builders:
- shell: |
#!/bin/bash -xe
CLONEMAP=`mktemp`
REQS_DIR=`mktemp -d`
function cleanup {{
mkdir -p $WORKSPACE
rm -rf $CLONEMAP $REQS_DIR
}}
trap cleanup EXIT
cat > $CLONEMAP << EOF
clonemap:
- name: '{project}'
dest: .
EOF
# zuul cloner works poorly if there are 2 names that are the
# same in here.
if [[ "{project}" != "openstack/requirements" ]]; then
cat >> $CLONEMAP << EOF
- name: openstack/requirements
dest: $REQS_DIR
EOF
fi
/usr/zuul-env/bin/zuul-cloner -m $CLONEMAP --cache-dir /opt/git \
git://git.openstack.org {project} openstack/requirements
# REQS_DIR is not set for openstack/requirements and there's also
# no need to copy in this case.
if [[ "{project}" != "openstack/requirements" ]]; then
cp $REQS_DIR/upper-constraints.txt ./
fi
- builder:
name: zuul-git-prep-upper-constraints-api-ref
builders:
- shell: |
#!/bin/bash -xe
CLONEMAP=`mktemp`
REQS_DIR=`mktemp -d`
function cleanup {{
mkdir -p $WORKSPACE
rm -rf $CLONEMAP $REQS_DIR
}}
trap cleanup EXIT
cat > $CLONEMAP << EOF
clonemap:
- name: '{project}'
dest: .
EOF
# clone os-api-ref into a subdir of the main project, makes
# it easy to find later for installing.
cat >> $CLONEMAP << EOF
- name: openstack/os-api-ref
dest: os-api-ref
- name: openstack/requirements
dest: $REQS_DIR
EOF
/usr/zuul-env/bin/zuul-cloner -m $CLONEMAP --cache-dir /opt/git \
git://git.openstack.org '{project}' openstack/os-api-ref openstack/requirements
cp $REQS_DIR/upper-constraints.txt ./
- builder:
name: zuul-git-branch-prep
builders:
- shell: |
#!/bin/bash -xe
export BRANCH={branch}
CLONEMAP=`mktemp`
function cleanup {{
mkdir -p $WORKSPACE
rm -f $CLONEMAP
}}
trap cleanup EXIT
cat > $CLONEMAP << EOF
clonemap:
- name: $ZUUL_PROJECT
dest: .
EOF
/usr/zuul-env/bin/zuul-cloner -m $CLONEMAP --cache-dir /opt/git \
--branch=$BRANCH \
git://git.openstack.org $ZUUL_PROJECT
- builder:
# Use this macro in the release pipeline to get a tagged repo with
# tag checked out and requirements repo with the branch the tag is
# on.
# The macro also works in other pipelines.
name: zuul-release-git-prep-upper-constraints
builders:
- shell: |
#!/bin/bash -xe
function get_branch_tag {
BRANCHES=`git branch -a --contains $ZUUL_REFNAME`
TARGET_BRANCH=`echo "$BRANCHES"|grep '^ remotes/origin/stable'|cut -d/ -f3-|sort|head -n1`
if [ -z $TARGET_BRANCH ] ; then
TARGET_BRANCH=`echo "$BRANCHES"|grep '^ remotes/origin/'|cut -d/ -f3-|sort|grep -v ^HEAD|head -n1`
fi
# Nothing found.
# Note that zuul-cloner will also fallback to master if
# the TARGET_BRANCH does not exist.
if [ -z $TARGET_BRANCH ] ; then
echo "Tag not found, falling back to master"
TARGET_BRANCH=master
fi
}
CLONEMAP=`mktemp`
REQS_DIR=`mktemp -d`
function cleanup {
mkdir -p $WORKSPACE
rm -rf $CLONEMAP $REQS_DIR
}
trap cleanup EXIT
cat > $CLONEMAP << EOF
clonemap:
- name: $ZUUL_PROJECT
dest: .
EOF
/usr/zuul-env/bin/zuul-cloner -m $CLONEMAP --cache-dir /opt/git \
git://git.openstack.org $ZUUL_PROJECT
if [[ "$ZUUL_PROJECT" != "openstack/requirements" ]]; then
# Figure out branch for requirements checkout
if [[ "$ZUUL_REFNAME" =~ ^refs/tags/ ]] ; then
get_branch_tag
else
# ZUUL_REFNAME is only available in post jobs
TARGET_BRANCH=${ZUUL_REFNAME:-$ZUUL_REF}
fi
cat > $CLONEMAP << EOF
clonemap:
- name: openstack/requirements
dest: $REQS_DIR
EOF
/usr/zuul-env/bin/zuul-cloner -m $CLONEMAP --cache-dir /opt/git \
--branch $TARGET_BRANCH \
git://git.openstack.org openstack/requirements
cp $REQS_DIR/upper-constraints.txt ./
fi
- builder:
name: zuul-clone
builders:
- shell: |
#!/bin/bash
/usr/zuul-env/bin/zuul-cloner --cache-dir /opt/git \
git://git.openstack.org {project}
- builder:
name: zuul-clone-workspace
builders:
- shell: |
#!/bin/bash -xe
CLONEMAP=`mktemp`
function cleanup {{
# In cases where zuul-cloner is aborted during a git
# clone operation, git will remove the git work tree in
# its cleanup. The work tree in these jobs is the
# workspace directory, which means that subsequent
# jenkins post-build actions can not run because the
# workspace has been removed.
# To reduce the likelyhood of this having an impact,
# recreate the workspace directory if needed
mkdir -p $WORKSPACE
rm -f $CLONEMAP
}}
trap cleanup EXIT
cat > $CLONEMAP << EOF
clonemap:
- name: {project}
dest: .
EOF
/usr/zuul-env/bin/zuul-cloner -m $CLONEMAP --cache-dir /opt/git \
git://git.openstack.org {project}
- builder:
name: revoke-sudo
builders:
- shell: |
#!/bin/bash -x
sudo rm -f /etc/sudoers.d/jenkins-sudo
# Prove that general sudo access is actually revoked
! sudo -n true
- builder:
name: coverage
builders:
- shell: "/usr/local/jenkins/slave_scripts/run-cover.sh {env}"
- builder:
name: docs-env
builders:
- shell: "/usr/local/jenkins/slave_scripts/run-docs.sh {env}"
- builder:
name: docs-tags-only-env
builders:
- shell: "/usr/local/jenkins/slave_scripts/run-docs.sh {env} tags-only"
- builder:
name: docs
builders:
- docs-env:
env: venv
- builder:
name: add-docs-root-marker
builders:
- shell: |
#!/bin/bash -xe
MARKER_TEXT="Project: $ZUUL_PROJECT Ref: $ZUUL_REFNAME Build: $ZUUL_UUID Revision: $ZUUL_NEWREV"
echo $MARKER_TEXT > {docsrootdir}/.root-marker
- builder:
name: gerrit-package
builders:
- shell: "/usr/local/jenkins/slave_scripts/package-gerrit.sh"
- builder:
name: linters
builders:
- run-tox:
envlist: linters
- builder:
name: bashate
builders:
- run-tox:
envlist: bashate
- builder:
name: pep8
builders:
- shell: "/usr/local/jenkins/slave_scripts/run-pep8.sh {env}"
- builder:
name: pylint
builders:
- shell: "/usr/local/jenkins/slave_scripts/run-pylint.sh {env}"
- builder:
name: nodejs-install
builders:
- shell: |
#!/bin/bash -eux
# Prerequisites
sudo apt-get update
sudo apt-get install -y apt-transport-https lsb-release curl
DISTRO=$(lsb_release -c -s)
# Install via nodesource
curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | sudo apt-key add -
echo "deb https://deb.nodesource.com/node_{version}.x $DISTRO main" | sudo tee /etc/apt/sources.list.d/nodesource.list
echo "deb-src https://deb.nodesource.com/node_{version}.x $DISTRO main" | sudo tee -a /etc/apt/sources.list.d/nodesource.list
sudo apt-get update
sudo apt-get install -y nodejs
# Output to the log for debugging's sake.
node --version
npm --version
npm config set registry https://registry.npmjs.org/
- builder:
name: npm-run
builders:
- shell: |
#!/bin/bash -eux
export DISPLAY=:99
npm install --verbose
# Try running as a standard lifecycle script, otherwise try custom.
npm_lifecycle_phases="publish install version test stop start restart pack"
if [[ $npm_lifecycle_phases =~ (^| ){command}($| ) ]]; then
npm {command} --verbose
else
npm run {command} --verbose
fi
# If no shrinkwrap exists, generate it.
if [ ! -f ./npm-shrinkwrap.json ]; then
npm prune # https://github.com/npm/npm/issues/6298
npm shrinkwrap
fi
- builder:
name: npm-dsvm-run
builders:
- shell: |
#!/bin/bash -eux
export PYTHONUNBUFFERED=true
export DEVSTACK_GATE_TEMPEST=0
export DEVSTACK_GATE_EXERCISES=0
export DEVSTACK_GATE_INSTALL_TESTONLY=1
export DEVSTACK_GATE_NEUTRON=1
# Xvfb Buffer...
export DISPLAY=:99
npm install
npm_lifecycle_phases="publish install version test stop start restart pack"
# Run any custom devstack configuration required by the project
function pre_test_hook {{
# Try running as a standard lifecycle script, otherwise try custom.
if [[ $npm_lifecycle_phases =~ (^| ){pre_test_command}($| ) ]]; then
npm {pre_test_command} --silent
else
npm run {pre_test_command} --silent
fi
}}
export -f pre_test_hook
function post_test_hook {{
# If you need access to devstack's clouds.yaml file, it is available
# at its canonical location at /etc/openstack/clouds.yaml
# Try running as a standard lifecycle script, otherwise try custom.
if [[ $npm_lifecycle_phases =~ (^| ){post_test_command}($| ) ]]; then
npm {post_test_command} --silent
else
npm run {post_test_command} --silent
fi
}}
export -f post_test_hook
cp devstack-gate/devstack-vm-gate-wrap.sh ./safe-devstack-vm-gate-wrap.sh
./safe-devstack-vm-gate-wrap.sh
- builder:
name: local_conf
builders:
- shell: |
#!/bin/bash -xe
cat << 'EOF' >>"/tmp/dg-local.conf"
{conf}
EOF
- builder:
name: xvfb-start
builders:
- shell: |
DIMENSIONS='1280x1024x24'
/usr/bin/Xvfb :99 -screen 0 ${DIMENSIONS} -ac +extension GLX +render -noreset 2>&1 > /dev/null &
- builder:
name: xvfb-install
builders:
- shell: |
sudo apt-get update
sudo apt-get install -y xvfb
- builder:
name: firefox-install
builders:
- shell: |
sudo apt-get update
sudo apt-get install -y firefox dbus
- builder:
name: chrome-install
builders:
- shell: |
sudo apt-get update
sudo apt-get install -y chromium-browser
- builder:
name: diskimage-builder-install
builders:
- shell: |
sudo apt-get update
sudo apt-get install -y qemu kpartx debootstrap
sudo -H pip install dib-utils
sudo -H pip install diskimage-builder
- builder:
name: proposal-slave-cleanup
builders:
- shell: |
#!/bin/bash
cd /
rm -rf `dirname $WORKSPACE`/*
mkdir $WORKSPACE
cd $WORKSPACE
- builder:
name: puppet-agent-install
builders:
- shell: |
if [ -f /usr/bin/yum ]; then
sudo yum install -y https://yum.puppetlabs.com/puppetlabs-release-pc1-el-7.noarch.rpm
sudo yum install -y puppet-agent
elif [ -f /usr/bin/apt-get ]; then
wget https://apt.puppetlabs.com/puppetlabs-release-pc1-xenial.deb -O /tmp/puppet.deb
sudo dpkg -i /tmp/puppet.deb
sudo apt-get update
sudo apt-get install puppet-agent
rm -rf /tmp/puppet.deb
fi
- builder:
name: puppet-prepare-node
builders:
- shell: |
if [ -f /usr/bin/yum ]; then
sudo yum -y remove facter puppet hiera rdo-release "centos-release-openstack-*" "centos-release-ceph-*"
sudo yum -y install libxml2-devel libxslt-devel ruby-devel zlib-devel
sudo yum -y groupinstall "Development Tools"
# Uninstall python-requests from pip, since we install it in
# system-config/install_puppet.sh
sudo pip uninstall requests -y || true
elif [ -f /usr/bin/apt-get ]; then
sudo apt-get remove -y --purge facter puppet puppet-common hiera
sudo apt-get update
sudo apt-get install -y libxml2-dev libxslt-dev ruby-dev zlib1g-dev
# /etc/default/puppet is not purged when removing Puppet
# but need to be dropped if we want to re-install puppet-agent on Xenial
sudo rm -rf /etc/default/puppet
fi
- builder:
name: puppet-lint
builders:
- shell: |
if [ -f Modulefile -o -f metadata.json ]; then
if [ -f Modulefile ]; then
MODULE=$(awk '/^name/ {print $NF}' Modulefile |tr -d \"\')
elif [ -f metadata.json ]; then
MODULE=$(python -c 'import json;print json.load(open("metadata.json"))["name"]')
fi
if [ -z "$MODULE" ]; then
echo "Module name not defined in Modulefile or metadata.json"
else
mkdir -p "$MODULE"
rsync -a --exclude="$MODULE" --exclude ".*" . "$MODULE"
cd "$MODULE"
fi
fi
mkdir .bundled_gems
export GEM_HOME=`pwd`/.bundled_gems
if [ -f Gemfile ]; then
gem install bundler --no-rdoc --no-ri --verbose
$GEM_HOME/bin/bundle install --without system_tests
$GEM_HOME/bin/bundle exec rake lint 2>&1
else
gem install rake -n ./.bundled_gems/
gem install puppet-lint
gem install puppetlabs_spec_helper
./.bundled_gems/rake lint 2>&1
fi
- builder:
name: pin-pip
builders:
- shell: sudo pip install "pip<8" "virtualenv<14"
- builder:
name: ansible-prep
builders:
- shell: |
#!/bin/bash -xe
sudo -H pip install -U ansible
- builder:
name: ansible-syntax
builders:
- shell: |
#!/bin/bash -xe
cd tests
ansible-playbook --syntax-check -i inventory test.yml -e rolename=$(basename $(dirname $(pwd)))
- builder:
name: ansible-lint-prep
builders:
- shell: |
#!/bin/bash -xe
sudo -H pip install ansible-lint
- builder:
name: ansible-lint
builders:
- shell: |
#!/bin/bash -xe
ansible-lint **/*.yml
- builder:
name: chef-bootstrap
builders:
- shell: |
#!/bin/bash -x
./bootstrap.sh allinone
- builder:
name: chef-bootstrap-multinode
builders:
- shell: |
#!/bin/bash -x
./bootstrap.sh multinode
- builder:
name: chef-rake-test
builders:
- shell: |
#!/bin/bash -x
chef exec rake
- builder:
name: chef-rake-integration
builders:
- shell: |
#!/bin/bash -x
chef exec rake integration
- builder:
name: run-tests
builders:
- shell: "./run-tests.sh"
- builder:
name: selenium
builders:
- shell: "/usr/local/jenkins/slave_scripts/run-selenium.sh"
- builder:
name: js-build
builders:
- shell: "/usr/local/jenkins/slave_scripts/run-jsbuild.sh {command}"
- builder:
name: python27
builders:
- shell: "/usr/local/jenkins/slave_scripts/run-tox.sh py27"
- builder:
name: python34
builders:
- shell: "/usr/local/jenkins/slave_scripts/run-tox.sh py34"
- builder:
name: python35
builders:
- shell: "/usr/local/jenkins/slave_scripts/run-tox.sh py35"
- builder:
name: pypy
builders:
- shell: "/usr/local/jenkins/slave_scripts/run-tox.sh pypy"
- builder:
name: run-tox
builders:
- shell: "/usr/local/jenkins/slave_scripts/run-tox.sh {envlist}"
- builder:
name: tox-with-tmpdir-passed-in
builders:
- shell: |
#!/bin/bash -x
export TMPDIR={new_tmpdir_loc}
/usr/local/jenkins/slave_scripts/run-tox.sh {envlist}
- builder:
name: assert-no-extra-files
builders:
- shell: |
#!/bin/bash
OUT=`git ls-files --other --exclude-standard --directory`
if [ -z "$OUT" ]; then
echo "No extra files created during test."
exit 0
else
echo "The following un-ignored files were created during the test:"
echo "$OUT"
exit 0 # TODO: change to 1 to fail tests.
fi
- builder:
name: tarball
builders:
- shell: |
#!/bin/bash -xe
/usr/local/jenkins/slave_scripts/run-tarball.sh {env}
/usr/local/jenkins/slave_scripts/run-wheel.sh {env}
- builder:
name: devstack-checkout
builders:
- shell: |
#!/bin/bash -xe
cat > clonemap.yaml << EOF
clonemap:
- name: openstack-infra/devstack-gate
dest: devstack-gate
EOF
/usr/zuul-env/bin/zuul-cloner -m clonemap.yaml --cache-dir /opt/git \
git://git.openstack.org \
openstack-infra/devstack-gate
- builder:
name: link-logs
builders:
- shell: |
#!/bin/sh
echo "Detailed logs: http://logs.openstack.org/$LOG_PATH/"
- builder:
name: net-info
builders:
- shell: |
#!/bin/sh
export PATH=$PATH:/sbin:/usr/sbin
if [ -f /etc/dib-builddate.txt ]; then
echo "Image build date"
echo "================"
cat /etc/dib-builddate.txt
fi
echo "Host & kernel"
echo "============="
uname -a
echo "Network configuration data..."
[ -f /mnt/config/openstack/latest/network_info.json ] && python -mjson.tool /mnt/config/openstack/latest/network_info.json
[ -f /mnt/config/openstack/latest/network_data.json ] && python -mjson.tool /mnt/config/openstack/latest/network_data.json
[ -f /mnt/config/openstack/latest/vendor_data.json ] && python -mjson.tool /mnt/config/openstack/latest/vendor_data.json
echo "Network interface addresses..."
echo "=============================="
ip address show
echo "Network routing tables..."
echo "========================="
ip route show
ip -6 route show
echo "Network neighbors..."
echo "===================="
ip neighbor show
echo "Route to Git mirror..."
echo "======================"
traceroute6 -n git.openstack.org \
|| traceroute -n git.openstack.org \
|| true
- builder:
name: install-distro-packages
builders:
- shell: /usr/local/jenkins/slave_scripts/install-distro-packages.sh
- builder:
name: install-distro-packages-fallback-test
builders:
- shell: |
#!/bin/bash -xe
# use the fallback list instead of existing bindep.txt
export PACKAGES=/usr/local/jenkins/common_data/bindep-fallback.txt
if [ "$ZUUL_PROJECT" == "openstack-infra/bindep" ] ; then
# if testing a change to bindep, use its entrypoint
virtualenv bindep-env
bindep-env/bin/pip install -U .
export BINDEP=bindep-env/bin/bindep
elif [ "$ZUUL_PROJECT" == "openstack-infra/project-config" ] ; then
# if testing a change to project-config, use its fallback list
export PACKAGES=jenkins/data/bindep-fallback.txt
fi
/usr/local/jenkins/slave_scripts/install-distro-packages.sh
- builder:
name: static-publish-prep
# We want to publish to the docroot but the scp publisher cannot remove
# paths, so use a shell builder to move the content in the right place and
# publish from there.
builders:
- shell: |
#!/bin/bash -xe
rm -rf ,content
mv {source} ,content
rm -rf .[^.]* [^,]*
# Disable errexit here because there might not be any dotfiles.
set +e
mv ,content/.[^.]* ./
set -e
mv ,content/* ./
rm -r ,content
- builder:
name: install-buck
builders:
- shell: |
#!/bin/bash -xe
if [[ ! -d "buck" ]]
then
git clone https://gerrit.googlesource.com/buck
cd buck
ant
fi
- builder:
name: print-node-uuid
builders:
- shell: |
#!/bin/sh
[ -f /etc/nodepool/uuid ] && echo "Node UUID: $(cat /etc/nodepool/uuid)"
- builder:
name: bundle-install
builders:
- shell: |
mkdir .bundled_gems
export GEM_HOME=`pwd`/.bundled_gems
bundle install
- builder:
name: exec-rake
builders:
- shell: |
mkdir -p .bundled_gems
export GEM_HOME=`pwd`/.bundled_gems
bundle exec rake
# This builder runs tools/test-setup.sh if its exists. This allows
# projects to setup unit tests in a specific way.
- builder:
name: extra-test-setup
builders:
- shell: |
if [ -x tools/test-setup.sh ] ; then
tools/test-setup.sh
fi
- builder:
name: allow-local-ssh-root
builders:
- shell: |
#!/bin/bash
echo "" | sudo tee -a /etc/ssh/sshd_config
echo "Match address 127.0.0.1" | sudo tee -a /etc/ssh/sshd_config
echo " PermitRootLogin without-password" | sudo tee -a /etc/ssh/sshd_config
echo "" | sudo tee -a /etc/ssh/sshd_config
echo "Match address ::1" | sudo tee -a /etc/ssh/sshd_config
echo " PermitRootLogin without-password" | sudo tee -a /etc/ssh/sshd_config
mkdir -p .ssh
ssh-keygen -f ~/.ssh/id_rsa -b 2048 -P ""
sudo mkdir -p /root/.ssh
cat ~/.ssh/id_rsa.pub | sudo tee -a /root/.ssh/authorized_keys
if [ -f /usr/bin/yum ]; then
sudo systemctl reload sshd
elif [ -f /usr/bin/apt-get ]; then
sudo service ssh restart
fi
- builder:
name: mount-xfs-tmp-space
builders:
- shell: |
#!/bin/bash -xe
# create a large-ish file that we'll mount as a loopback
truncate -s 1GB {xfs_file}
# format the new file as xfs
/sbin/mkfs.xfs {xfs_file}
# loopback mount the file
mkdir -p {xfs_mount_point}
sudo mount -o loop,noatime,nodiratime {xfs_file} {xfs_mount_point}
sudo chmod 777 {xfs_mount_point}
# ======================================================================
- wrapper:
name: build-timeout
wrappers:
- timeout:
timeout: '{timeout}'
timeout-var: 'BUILD_TIMEOUT'
fail: true
# ======================================================================
- publisher:
name: tarball
publishers:
- scp:
site: tarballs.openstack.org
files:
- target: 'tarballs/{project}/'
source: 'dist/*.tar.gz'
- publisher:
name: deb-pkgs
publishers:
- scp:
site: 'tarballs.openstack.org'
files:
- target: 'tarballs/packaging-deb/{project}/'
source: 'uploads/**'
keep-hierarchy: true
- publisher:
name: wheel
publishers:
- scp:
site: tarballs.openstack.org
files:
- target: 'tarballs/{project}/'
source: 'dist/*.whl'
- publisher:
name: war
publishers:
- scp:
site: tarballs.openstack.org
files:
- target: '{target}'
source: '{warfile}'
- publisher:
name: console-log
publishers:
- scp:
site: 'static.openstack.org'
files:
- target: 'logs/$LOG_PATH'
copy-console: true
copy-after-failure: true
- publisher:
name: devstack-logs
publishers:
- scp:
site: 'static.openstack.org'
files:
- target: 'logs/$LOG_PATH'
source: 'logs/**'
keep-hierarchy: true
copy-after-failure: true
- publisher:
name: coverage-log
publishers:
- scp:
site: 'static.openstack.org'
files:
- target: 'logs/$LOG_PATH'
source: 'cover/**'
keep-hierarchy: true
copy-after-failure: true
- publisher:
name: coverage-log-ruby
publishers:
- scp:
site: 'static.openstack.org'
files:
- target: 'logs/$LOG_PATH'
source: 'coverage/**'
keep-hierarchy: true
copy-after-failure: true
- publisher:
name: test-results
publishers:
- scp:
site: 'static.openstack.org'
files:
- target: 'logs/$LOG_PATH'
source: '**/*nose_results.html'
keep-hierarchy: false
copy-after-failure: true
- target: 'logs/$LOG_PATH'
source: '**/*testr_results.html.gz'
keep-hierarchy: false
copy-after-failure: true
- target: 'logs/$LOG_PATH'
source: '.testrepository/tmp*'
keep-hierarchy: false
copy-after-failure: true
- target: 'logs/$LOG_PATH'
source: '**/*testrepository.subunit.gz'
keep-hierarchy: false
copy-after-failure: true
- target: 'logs/$LOG_PATH/tox'
source: '.tox/*/log/*'
keep-hierarchy: false
copy-after-failure: true