-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
executable file
·52 lines (45 loc) · 2.78 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
<project name="object-repository" default="deploy" basedir=".">
<description>
Deployment of artifacts from our bamboo CI environment.
</description>
<!-- set global properties for this build -->
<property name="build" value="latestSuccessful"/>
<property name="bamboo"
value="https://bamboo.socialhistoryservices.org/browse"/>
<property name="version" value="1.0"/>
<property name="mount" value=""/>
<property name="dest.bin" value="${mount}/usr/bin/${ant.project.name}"/>
<property name="dest.opt" value="${mount}/opt/${ant.project.name}"/>
<property name="dest.conf" value="${mount}/etc/${ant.project.name}"/>
<property name="dest.log" value="${mount}/var/log/${ant.project.name}"/>
<property name="tmp" value="${mount}/tmp/${ant.project.name}"/>
<target name="deploy" description="download and installs all required files">
<mkdir dir="${dest.bin}"/>
<mkdir dir="${dest.conf}"/>
<mkdir dir="${dest.log}"/>
<mkdir dir="${dest.opt}/pmq-agents-enabled"/>
<delete dir="${tmp}"/>
<mkdir dir="${tmp}"/>
<get src="${bamboo}/OR-ADMIN/${build}/artifact/JOB1/admin.war/object-repository-admin-1.4.war" dest="${tmp}/object-repository-admin.war"/>
<get src="${bamboo}/OR-SERVICENODES/${build}/artifact/JOB1/pmq-agent/pmq-agent-${version}.jar" dest="${tmp}/pmq-agent.jar"/>
<get src="${bamboo}/OR-SERVICENODES/${build}/artifact/JOB1/orfiles/orfiles-${version}.jar" dest="${tmp}/orfiles.jar"/>
<get src="${bamboo}/OR-SERVICENODES/${build}/artifact/JOB1/instruction-manager/instruction-manager-${version}.jar" dest="${tmp}/instruction-manager.jar"/>
<get src="${bamboo}/OR-SCRIPTS/${build}/artifact/JOB1/scripts/scripts-${version}-src.tar.gz" dest="${tmp}/scripts-src.tar.gz"/>
<gunzip src="${tmp}/scripts-src.tar.gz" dest="${tmp}/scripts-src.tar"/>
<delete file="${tmp}/scripts-src.tar.gz"/>
<untar src="${tmp}/scripts-src.tar" dest="${tmp}/_scripts"/>
<delete file="${tmp}/scripts-src.tar"/>
<move file="${tmp}/_scripts/scripts-${version}" tofile="${tmp}/scripts"/>
<delete dir="${tmp}/_scripts"/>
<chmod perm="744">
<fileset dir="${tmp}/scripts" includes="**/*.sh"/>
</chmod>
<delete dir="${dest.bin}"/>
<move file="${tmp}" tofile="${dest.bin}"/>
<delete dir="${tmp}"/>
<symlink link="${dest.opt}/conf" resource="${dest.conf}" overwrite="yes"/>
<symlink link="${dest.opt}/log" resource="${dest.log}" overwrite="yes"/>
<symlink link="${dest.opt}/pmq-agents-available" resource="${dest.bin}/scripts/pmq-agents-available" overwrite="yes"/>
<symlink link="${dest.opt}/agent.sh" resource="${dest.bin}/scripts/agent.sh" overwrite="yes"/>
</target>
</project>