Matthias Andreas Benkard | 7f4dacc | 2020-04-13 11:25:19 +0200 | [diff] [blame] | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | |
| 3 | <project default="package"> |
| 4 | |
| 5 | <property name="web-dir" location="src/main/resources/META-INF/resources"/> |
| 6 | |
| 7 | <target name="yarn" depends="yarn.check" if="yarn.run"> |
| 8 | <exec executable="yarn" dir="${web-dir}"> |
| 9 | <arg value="install"/> |
| 10 | </exec> |
| 11 | </target> |
| 12 | |
| 13 | <target name="yarn.check"> |
| 14 | <condition property="yarn.run"> |
| 15 | <not> |
| 16 | <available file="${web-dir}/node_modules"/> |
| 17 | </not> |
| 18 | </condition> |
| 19 | </target> |
| 20 | |
| 21 | <target name="snowpack" depends="snowpack.check,yarn" if="snowpack.run"> |
| 22 | <exec executable="yarn" dir="${web-dir}"> |
| 23 | <arg value="run"/> |
| 24 | <arg value="snowpack"/> |
| 25 | <arg value="--optimize"/> |
| 26 | </exec> |
| 27 | </target> |
| 28 | |
| 29 | <target name="snowpack.check"> |
| 30 | <condition property="snowpack.run"> |
| 31 | <not> |
| 32 | <available file="${web-dir}/web_modules"/> |
| 33 | </not> |
| 34 | </condition> |
| 35 | </target> |
| 36 | |
| 37 | <target name="flow" depends="snowpack"> |
| 38 | <exec executable="yarn" dir="${web-dir}"> |
| 39 | <arg value="run"/> |
| 40 | <arg value="flow"/> |
| 41 | <arg value="--color=always"/> |
| 42 | </exec> |
| 43 | </target> |
| 44 | |
| 45 | <target name="eslint" depends="snowpack"> |
| 46 | <exec executable="yarn" dir="${web-dir}"> |
| 47 | <arg value="run"/> |
| 48 | <arg value="eslint"/> |
Matthias Andreas Benkard | 7f4dacc | 2020-04-13 11:25:19 +0200 | [diff] [blame] | 49 | <arg value="bookmarks"/> |
Matthias Andreas Benkard | e128d15 | 2020-04-19 19:40:59 +0200 | [diff] [blame] | 50 | <arg value="cms2"/> |
| 51 | <arg value="lazychat"/> |
| 52 | <arg value="posts"/> |
Matthias Andreas Benkard | 7f4dacc | 2020-04-13 11:25:19 +0200 | [diff] [blame] | 53 | <arg value="--color"/> |
| 54 | </exec> |
| 55 | </target> |
| 56 | |
| 57 | <target name="web.resources" depends="snowpack" unless="skip-web"/> |
| 58 | <target name="web.check" unless="skip-web" depends="web.resources,flow,eslint"/> |
Matthias Andreas Benkard | 96c61e4 | 2020-04-13 21:31:25 +0200 | [diff] [blame] | 59 | <target name="web" unless="skip-web" depends="web.resources,web.check" description="Generate web resources"/> |
Matthias Andreas Benkard | 7f4dacc | 2020-04-13 11:25:19 +0200 | [diff] [blame] | 60 | |
Matthias Andreas Benkard | 96c61e4 | 2020-04-13 21:31:25 +0200 | [diff] [blame] | 61 | <target name="package" description="Create executable JAR"> |
Matthias Andreas Benkard | 7f4dacc | 2020-04-13 11:25:19 +0200 | [diff] [blame] | 62 | <exec executable="./mvnw"> |
| 63 | <arg value="package"/> |
Matthias Andreas Benkard | 95d29a0 | 2020-04-24 16:07:49 +0200 | [diff] [blame] | 64 | <arg value="-Dquarkus.container-image.push=false"/> |
Matthias Andreas Benkard | 7f4dacc | 2020-04-13 11:25:19 +0200 | [diff] [blame] | 65 | </exec> |
| 66 | </target> |
| 67 | |
Matthias Andreas Benkard | 96c61e4 | 2020-04-13 21:31:25 +0200 | [diff] [blame] | 68 | <target name="deploy" description="Deploy JAR to Kubernetes"> |
Matthias Andreas Benkard | 77138fa | 2020-04-13 21:06:17 +0200 | [diff] [blame] | 69 | <exec executable="./mvnw"> |
Matthias Andreas Benkard | 95d29a0 | 2020-04-24 16:07:49 +0200 | [diff] [blame] | 70 | <arg value="package"/> |
| 71 | <arg value="-Dquarkus.container-image.push=true"/> |
Matthias Andreas Benkard | 77138fa | 2020-04-13 21:06:17 +0200 | [diff] [blame] | 72 | </exec> |
| 73 | <exec executable="kubectl"> |
| 74 | <arg value="delete"/> |
| 75 | <arg value="pods"/> |
| 76 | <arg value="-lapp=mulkcms2"/> |
| 77 | </exec> |
| 78 | <exec executable="kubectl"> |
| 79 | <arg value="get"/> |
| 80 | <arg value="pods"/> |
| 81 | <arg value="-lapp=mulkcms2"/> |
| 82 | <arg value="-w"/> |
| 83 | </exec> |
| 84 | </target> |
| 85 | |
Matthias Andreas Benkard | 7f4dacc | 2020-04-13 11:25:19 +0200 | [diff] [blame] | 86 | <target name="clean"> |
| 87 | <exec executable="./mvnw"> |
| 88 | <arg value="clean"/> |
| 89 | </exec> |
| 90 | <delete dir="${web-dir}/node_modules"/> |
| 91 | <delete dir="${web-dir}/web_modules"/> |
| 92 | </target> |
| 93 | |
| 94 | </project> |