This repository has been archived by the owner on Mar 10, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
113 lines (101 loc) · 3.51 KB
/
build.xml
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
<?xml version="1.0"?>
<project name="puppet-infra-project" default="test">
<!--
Main Buildfile used by jenkins to interact with the system.
-->
<!--
test the source code for any obvious errors
this only does a simple puppet parse for now
-->
<target name="test">
<exec executable="puppet" failonerror="true">
<arg value="parser"/>
<arg value="validate"/>
<arg value="site.pp"/>
<arg value="--mode"/>
<arg value="master"/>
</exec>
<!-- look into erb syntax -->
<!-- erb -x -T '-' modules/puppet/templates/puppet.conf.erb | ruby -c -->
<apply executable="./_scripts/erb-lint.sh" failonerror="true"
parallel="false">
<fileset dir=".">
<include name="modules/**/*.erb"/>
</fileset>
</apply>
</target>
<!--
Generate all sorts of documentation
For now all we have is one large html file built from markdown. I haven't decided how i would
like to do the documentation yet so this probably is subject to lots of changes.
-->
<target name="docs">
<mkdir dir="build/"/>
<delete dir="doc/rdoc"/>
<!-- need by builds manifestdir arg -->
<mkdir dir="manifests"/>
<copy file="README.rdoc" todir="manifests/"/>
<exec executable="touch">
<arg value="manifests/site.pp"/>
</exec>
<exec executable="puppet" failonerror="true">
<arg value="doc"/>
<arg value="--all"/>
<arg value="--mode"/>
<arg value="rdoc"/>
<arg value="--manifestdir"/>
<arg value="manifests/"/>
<arg value="--modulepath"/>
<arg value="modules/"/>
<arg value="--outputdir"/>
<arg value="doc/rdoc"/>
</exec>
</target>
<!--
Deploy on local machine
One instance this is used in is when jenkins updates himself
-->
<target name="deploy-local">
<exec executable="sudo" failonerror="true">
<arg value="/usr/sbin/jenkins-receive"/>
</exec>
<exec executable="sudo" failonerror="true">
<arg value="/usr/sbin/puppet-apply"/>
</exec>
</target>
<!--
Deploy to webhost dir
This is used for building further packages that get deployed
everywhere else
-->
<target name="deploy-web">
<exec executable="cat" outputproperty="version">
<arg value="VERSION"/>
</exec>
<exec executable="cp" failonerror="true">
<arg value="build/puppet-infra-project-${version}.tar.bz2"/>
<arg value="/var/www/distfile-repo.jenkins-01.hq.rabe.ch/htdocs/"/>
</exec>
</target>
<target name="pkg">
<exec executable="cat" outputproperty="version">
<arg value="VERSION"/>
</exec>
<tar destfile="build/puppet-infra-project-${version}.tar.bz2"
basedir="." compression="bzip2"
excludes="build/**,**/.git"/>
</target>
<target name="bump-version">
<exec executable="awk" failonerror="true" output="VERSION">
<arg value="-F." />
<arg value='1{$NF+=1; OFS="."; print $0}'/>
<arg value="VERSION"/>
</exec>
<exec executable="git" failonerror="true">
<arg value="commit"/>
<arg value="-m"/>
<arg value="version bump"/>
<arg value="VERSION"/>
</exec>
</target>
</project>