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 | |
Matthias Andreas Benkard | 813e597 | 2020-06-14 19:27:42 +0200 | [diff] [blame] | 37 | <target name="parcel" depends="parcel.check,yarn" if="parcel.run"> |
| 38 | <exec executable="yarn" dir="${web-dir}"> |
| 39 | <arg value="parcel"/> |
| 40 | <arg value="build"/> |
| 41 | <arg value="lib.css"/> |
| 42 | <arg value="lib.js"/> |
Matthias Andreas Benkard | 813e597 | 2020-06-14 19:27:42 +0200 | [diff] [blame] | 43 | <arg value="web_modules/ContentTools.js"/> |
| 44 | <arg value="web_modules/ContentTools/build/content-tools.min.css"/> |
| 45 | </exec> |
| 46 | </target> |
| 47 | |
| 48 | <target name="parcel.check"> |
| 49 | <condition property="parcel.run"> |
| 50 | <not> |
| 51 | <available file="${web-dir}/dist"/> |
| 52 | </not> |
| 53 | </condition> |
| 54 | </target> |
| 55 | |
Matthias Andreas Benkard | 7f4dacc | 2020-04-13 11:25:19 +0200 | [diff] [blame] | 56 | <target name="flow" depends="snowpack"> |
| 57 | <exec executable="yarn" dir="${web-dir}"> |
| 58 | <arg value="run"/> |
| 59 | <arg value="flow"/> |
| 60 | <arg value="--color=always"/> |
| 61 | </exec> |
| 62 | </target> |
| 63 | |
| 64 | <target name="eslint" depends="snowpack"> |
| 65 | <exec executable="yarn" dir="${web-dir}"> |
| 66 | <arg value="run"/> |
| 67 | <arg value="eslint"/> |
Matthias Andreas Benkard | 7f4dacc | 2020-04-13 11:25:19 +0200 | [diff] [blame] | 68 | <arg value="bookmarks"/> |
Matthias Andreas Benkard | e128d15 | 2020-04-19 19:40:59 +0200 | [diff] [blame] | 69 | <arg value="cms2"/> |
| 70 | <arg value="lazychat"/> |
| 71 | <arg value="posts"/> |
Matthias Andreas Benkard | 7f4dacc | 2020-04-13 11:25:19 +0200 | [diff] [blame] | 72 | <arg value="--color"/> |
| 73 | </exec> |
| 74 | </target> |
| 75 | |
| 76 | <target name="web.resources" depends="snowpack" unless="skip-web"/> |
| 77 | <target name="web.check" unless="skip-web" depends="web.resources,flow,eslint"/> |
Matthias Andreas Benkard | 813e597 | 2020-06-14 19:27:42 +0200 | [diff] [blame] | 78 | <target name="web.bundle" unless="skip-web" depends="web.resources,parcel"/> |
| 79 | <target name="web" unless="skip-web" depends="web.resources,web.check,web.bundle" description="Generate web resources"/> |
Matthias Andreas Benkard | 7f4dacc | 2020-04-13 11:25:19 +0200 | [diff] [blame] | 80 | |
Matthias Andreas Benkard | 96c61e4 | 2020-04-13 21:31:25 +0200 | [diff] [blame] | 81 | <target name="package" description="Create executable JAR"> |
Matthias Andreas Benkard | 7f4dacc | 2020-04-13 11:25:19 +0200 | [diff] [blame] | 82 | <exec executable="./mvnw"> |
| 83 | <arg value="package"/> |
Matthias Andreas Benkard | 95d29a0 | 2020-04-24 16:07:49 +0200 | [diff] [blame] | 84 | <arg value="-Dquarkus.container-image.push=false"/> |
Matthias Andreas Benkard | 7f4dacc | 2020-04-13 11:25:19 +0200 | [diff] [blame] | 85 | </exec> |
| 86 | </target> |
| 87 | |
Matthias Andreas Benkard | 96c61e4 | 2020-04-13 21:31:25 +0200 | [diff] [blame] | 88 | <target name="deploy" description="Deploy JAR to Kubernetes"> |
Matthias Andreas Benkard | 77138fa | 2020-04-13 21:06:17 +0200 | [diff] [blame] | 89 | <exec executable="./mvnw"> |
Matthias Andreas Benkard | 95d29a0 | 2020-04-24 16:07:49 +0200 | [diff] [blame] | 90 | <arg value="package"/> |
Matthias Andreas Benkard | e2d42e9 | 2020-06-16 21:08:30 +0200 | [diff] [blame] | 91 | <arg value="-Dquarkus.container-image.build=true"/> |
Matthias Andreas Benkard | 95d29a0 | 2020-04-24 16:07:49 +0200 | [diff] [blame] | 92 | <arg value="-Dquarkus.container-image.push=true"/> |
Matthias Andreas Benkard | 77138fa | 2020-04-13 21:06:17 +0200 | [diff] [blame] | 93 | </exec> |
| 94 | <exec executable="kubectl"> |
| 95 | <arg value="delete"/> |
| 96 | <arg value="pods"/> |
| 97 | <arg value="-lapp=mulkcms2"/> |
| 98 | </exec> |
| 99 | <exec executable="kubectl"> |
| 100 | <arg value="get"/> |
| 101 | <arg value="pods"/> |
| 102 | <arg value="-lapp=mulkcms2"/> |
| 103 | <arg value="-w"/> |
| 104 | </exec> |
| 105 | </target> |
| 106 | |
Matthias Andreas Benkard | 7f4dacc | 2020-04-13 11:25:19 +0200 | [diff] [blame] | 107 | <target name="clean"> |
| 108 | <exec executable="./mvnw"> |
| 109 | <arg value="clean"/> |
| 110 | </exec> |
| 111 | <delete dir="${web-dir}/node_modules"/> |
| 112 | <delete dir="${web-dir}/web_modules"/> |
| 113 | </target> |
| 114 | |
| 115 | </project> |