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
Show file tree
Hide file tree
Changes from all commits
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
12 changes: 12 additions & 0 deletions build/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# GP Connect Ant Build Script
There is a full environment and build process available to automate the setup of this project. Just clone [https://github.com/dbould/gpconnect-vagrant](https://github.com/dbould/gpconnect-vagrant) and follow the instructions

This build script can be run on it's own in a Linux environment, if the README from the root directory has been followed use

```ant build```

to import the SQL and build the JS dependencies and

```ant run```

to serve the project.
75 changes: 75 additions & 0 deletions build/build.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<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>

<path id="classpath">
<fileset dir="/usr/share/java">
<include name="*.jar" />
</fileset>
</path>

<target name="sql">
<exec executable="mysql" dir="./config/sql">
<arg value="-u${legacy.datasource.username}" />
<arg value="-p${legacy.datasource.password}" />
<arg value="-e source create_database.sql" />
</exec>
<exec executable="mysql" dir="./config/sql">
<arg value="-u${legacy.datasource.username}" />
<arg value="-p${legacy.datasource.password}" />
<arg value="-D${legacy.datasource.schema}" />
<arg value="-e source create_tables.sql" />
</exec>
<sql
driver="com.mysql.jdbc.Driver"
url="jdbc:mysql://${legacy.datasource.host}/${legacy.datasource.schema}"
userid="${legacy.datasource.username}"
password="${legacy.datasource.password}"
classpathref="classpath">
<path>
<fileset dir="./config/sql" casesensitive="yes">
<include name="**/*.sql"/>
<exclude name="**/*create*"/>
</fileset>
</path>
</sql>
</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>