-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
112 lines (90 loc) · 3.38 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="docker-mcserver" default="build">
<property name="workspace" value="${basedir}" />
<property name="builddir" value="${workspace}/build" />
<property name="image" value="olafwal/mcserver" />
<target name="build" depends="prepare, download-mcserver, extract, plugins, prepare-config, build-image"/>
<target name="clean" description="Cleanup" depends="plugins-clean">
<delete dir="${builddir}"/>
</target>
<target name="prepare" depends="clean" description="Prepare">
<mkdir dir="${builddir}"/>
<mkdir dir="${builddir}/plugins"/>
</target>
<target name="download-mcserver" description="Get newest Version">
<exec dir="${builddir}" executable="wget">
<arg value="-q"/>
<arg value="http://builds.cuberite.org/job/MCServer%20Linux%20x64/lastSuccessfulBuild/artifact/MCServer.tar"/>
</exec>
</target>
<target name="extract" description="Get newest Version">
<exec dir="${builddir}" executable="tar">
<arg value="-xf"/>
<arg value="MCServer.tar"/>
</exec>
</target>
<target name="plugins-clean" description="remove downloads and extracted files">
<delete dir="${builddir}/plugins"/>
</target>
<target name="plugins" description="get Plugins" depends="plugins-clean">
<mkdir dir="${builddir}/plugins/"/>
<!-- WorldEdit -->
<exec dir="${builddir}/plugins" executable="wget">
<arg value="-q"/>
<arg value="-O"/>
<arg value="worldedit.zip"/>
<arg value="https://github.com/mc-server/WorldEdit/archive/master.zip"/>
</exec>
<exec dir="${builddir}/plugins" executable="unzip">
<arg value="worldedit.zip"/>
</exec>
<copy todir="${builddir}/MCServer/Plugins/WorldEdit">
<fileset dir="${builddir}/plugins/WorldEdit-master"/>
</copy>
<!-- Hunger Games -->
<exec dir="${builddir}/plugins" executable="wget">
<arg value="-q"/>
<arg value="-O"/>
<arg value="hungergames.zip"/>
<arg value="https://github.com/mc-server/HungerGames/archive/master.zip"/>
</exec>
<exec dir="${builddir}/plugins" executable="unzip">
<arg value="hungergames.zip"/>
</exec>
<copy todir="${builddir}/MCServer/Plugins/HungerGames">
<fileset dir="${builddir}/plugins/HungerGames-master"/>
</copy>
<!-- Chest Shop -->
<exec dir="${builddir}/plugins" executable="wget">
<arg value="-q"/>
<arg value="-O"/>
<arg value="chestshop.zip"/>
<arg value="https://github.com/mc-server/ChestShop/archive/master.zip"/>
</exec>
<exec dir="${builddir}/plugins" executable="unzip">
<arg value="chestshop.zip"/>
</exec>
<copy todir="${builddir}/MCServer/Plugins/ChestShop">
<fileset dir="${builddir}/plugins/ChestShop-master"/>
</copy>
</target>
<target name="prepare-config" description="Prepare config">
<copy todir="${builddir}/MCServer/">
<fileset dir="${workspace}/config"/>
</copy>
</target>
<target name="build-image" description="Build docker image">
<exec executable="docker">
<arg value="build"/>
<arg value="-t"/>
<arg value="olafwal/mcserver"/>
<arg value="."/>
</exec>
</target>
<target name="push" description="Push docker image">
<exec executable="docker">
<arg value="push"/>
<arg value="${image}"/>
</exec>
</target>
</project>