Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Environment and build script for GP Connect Demonstrator #11

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Added build.xml for Linux
Vagrant .box to go with this in progress
dbould committed Mar 27, 2017
commit 1d93c3b302e9cfc0b9739e179a3f3dd616cc121b
74 changes: 74 additions & 0 deletions build/build.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<project name="gpconnect" default="dist" basedir="../">
<property file="config/gpconnect-demonstrator-api.properties"/>

<target name="build" depends="sql, install-grunt, install-js-dependencies, build-java">
</target>

<target name="build-run" depends="build, run">
</target>

<property name="username" value="${legacy.datasource.username}" />
<property name="password" value="${legacy.datasource.password}" />
<property name="database" value="${legacy.datasource.schema}" />

<target name="sql">
<exec executable="mysql" dir="./config/sql">
<arg value="-u${username}" />
<arg value="-p${password}" />
<arg value="-D${database}" />
<arg value="-e source create_database.sql" />
</exec>
<exec executable="mysql" dir="./config/sql">
<arg value="-u${username}" />
<arg value="-p${password}" />
<arg value="-D${database}" />
<arg value="-e source create_tables.sql" />
</exec>

<apply executable="mysql" parallel="false">
<fileset dir="./config/sql" casesensitive="yes">
<include name="**/*.sql"/>
<exclude name="**/*create*"/>
</fileset>
<arg value="-u${username}" />
<arg value="-p${password}" />
<arg value="-D${database}" />
<arg value="-e source" />
<targetfile />
<mapper type="identity" />
</apply>
</target>

<target name="install-grunt">
<exec executable="sudo">
<arg line="npm install -g grunt-cli bower" />
</exec>
</target>

<target name="install-js-dependencies">
<exec executable="bower" dir="./webapp">
<arg line="install" />
</exec>
<exec executable="bower" dir="./webapp">
<arg line="update" />
</exec>
<exec executable="npm" dir="./webapp">
<arg line="update" />
</exec>
<exec executable="grunt" dir="./webapp">
<arg line="build" />
</exec>
</target>

<target name="build-java">
<exec executable="mvn">
<arg line="clean package" />
</exec>
</target>

<target name="run">
<exec executable="java">
<arg line="-jar gpconnect-demonstrator-api/target/gpconnect-demonstrator-api.war --server.port=19191 --config.path=config/" />
</exec>
</target>
</project>