blob: ffa6512ca78562e50d90ad4a7c4cd3f89a0c1840 [file] [log] [blame]
<?xml version="1.0" encoding="utf-8"?>
<project default="package">
<property name="web-dir" location="src/main/resources/META-INF/resources"/>
<target name="yarn" depends="yarn.check" if="yarn.run">
<exec executable="yarn" dir="${web-dir}">
<arg value="install"/>
</exec>
</target>
<target name="yarn.check">
<condition property="yarn.run">
<not>
<available file="${web-dir}/node_modules"/>
</not>
</condition>
</target>
<target name="snowpack" depends="snowpack.check,yarn" if="snowpack.run">
<exec executable="yarn" dir="${web-dir}">
<arg value="run"/>
<arg value="snowpack"/>
<arg value="--optimize"/>
</exec>
</target>
<target name="snowpack.check">
<condition property="snowpack.run">
<not>
<available file="${web-dir}/web_modules"/>
</not>
</condition>
</target>
<target name="parcel" depends="parcel.check,yarn" if="parcel.run">
<exec executable="yarn" dir="${web-dir}">
<arg value="parcel"/>
<arg value="build"/>
<arg value="lib.css"/>
<arg value="lib.js"/>
<arg value="web_modules/ContentTools.js"/>
<arg value="web_modules/ContentTools/build/content-tools.min.css"/>
</exec>
</target>
<target name="parcel.check">
<condition property="parcel.run">
<not>
<available file="${web-dir}/dist"/>
</not>
</condition>
</target>
<target name="flow" depends="snowpack">
<exec executable="yarn" dir="${web-dir}">
<arg value="run"/>
<arg value="flow"/>
<arg value="--color=always"/>
</exec>
</target>
<target name="eslint" depends="snowpack">
<exec executable="yarn" dir="${web-dir}">
<arg value="run"/>
<arg value="eslint"/>
<arg value="bookmarks"/>
<arg value="cms2"/>
<arg value="lazychat"/>
<arg value="posts"/>
<arg value="--color"/>
</exec>
</target>
<target name="web.resources" depends="snowpack" unless="skip-web"/>
<target name="web.check" unless="skip-web" depends="web.resources,flow,eslint"/>
<target name="web.bundle" unless="skip-web" depends="web.resources,parcel"/>
<target name="web" unless="skip-web" depends="web.resources,web.check,web.bundle" description="Generate web resources"/>
<target name="package" description="Create executable JAR">
<exec executable="./mvnw">
<arg value="package"/>
<arg value="-Dquarkus.container-image.push=false"/>
</exec>
</target>
<target name="deploy" description="Deploy JAR to Kubernetes">
<exec executable="./mvnw">
<arg value="package"/>
<arg value="-Dquarkus.container-image.build=true"/>
<arg value="-Dquarkus.container-image.push=true"/>
</exec>
<exec executable="kubectl">
<arg value="delete"/>
<arg value="pods"/>
<arg value="-lapp=mulkcms2"/>
</exec>
<exec executable="kubectl">
<arg value="get"/>
<arg value="pods"/>
<arg value="-lapp=mulkcms2"/>
<arg value="-w"/>
</exec>
</target>
<target name="clean">
<exec executable="./mvnw">
<arg value="clean"/>
</exec>
<delete dir="${web-dir}/node_modules"/>
<delete dir="${web-dir}/web_modules"/>
</target>
</project>