-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathbuild-documentation.xml
49 lines (41 loc) · 1.78 KB
/
build-documentation.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
<?xml version="1.0" encoding="utf-8"?>
<project name="documentation" basedir=".">
<property name="documentation" location=".\dist\docs"/>
<property name="documentationZip" location=".\dist\docs\documentation.zip"/>
<property name="communityDocsBase" value="/data/nginx/wwwroot/ApiDocs/material"/>
<property name="communityDocsFolder" value="${communityDocsBase}/${releaseVersion}"/>
<target name="deployDocumentation">
<property name="sourceDocs" location="${documentation}\*"/>
<exec executable=".\tools\7z.exe" failonerror="true">
<arg value="a" />
<arg value="${documentationZip}" />
<arg value="${sourceDocs}" />
</exec>
<antcall target="executeCommandOnDocumentationServer">
<param name="command" value="mkdir ${communityDocsFolder}"/>
</antcall>
<scp todir="${communityUser}:${communityPass}@${communityHost}:${communityDocsFolder}"
trust="yes">
<fileset file="${documentationZip}"/>
</scp>
<antcall target="executeCommandOnDocumentationServer">
<param name="command" value="unzip ${communityDocsFolder}/documentation.zip -d ${communityDocsFolder}"/>
</antcall>
<antcall target="executeCommandOnDocumentationServer">
<param name="command" value="rm -rf ${communityDocsBase}/latest"/>
</antcall>
<antcall target="executeCommandOnDocumentationServer">
<param name="command" value="cp -r ${communityDocsFolder} ${communityDocsBase}/latest"/>
</antcall>
<antcall target="executeCommandOnDocumentationServer">
<param name="command" value="rm -rf ${communityDocsFolder}/documentation.zip"/>
</antcall>
</target>
<target name="executeCommandOnDocumentationServer">
<sshexec host="${communityHost}"
username="${communityUser}"
password="${communityPass}"
trust="yes"
command="${command}"/>
</target>
</project>