Merge pull request #3 from charithag/build-pack

Include virtual agent to build pack & fix remote APIM connecting issue
application-manager-new
Charitha Goonetilleke 9 years ago
commit 8b422cb509

@ -325,6 +325,11 @@
dir="target/wso2carbon-core-${carbon.kernel.version}/samples/raspberrypi" dir="target/wso2carbon-core-${carbon.kernel.version}/samples/raspberrypi"
includes="build.xml"/> includes="build.xml"/>
</subant> </subant>
<subant target="deploy">
<fileset
dir="target/wso2carbon-core-${carbon.kernel.version}/samples/virtual_firealarm"
includes="build.xml"/>
</subant>
<copy todir="../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/conf/" <copy todir="../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/conf/"
overwrite="true"> overwrite="true">
<fileset <fileset

@ -23,7 +23,8 @@
<![CDATA[ <![CDATA[
<IotDeviceTypeConfig type="${sample_type}"> <IotDeviceTypeConfig type="${sample_type}">
<DatasourceName>jdbc/${data_source}</DatasourceName> <DatasourceName>jdbc/${data_source}</DatasourceName>
<ApiApplicationName>virtual_firealarm</ApiApplicationName> <!--TODO: Uncomment this to work with apim @ 192.168.67.21 -->
<!--ApiApplicationName>firealarm</ApiApplicationName-->
</IotDeviceTypeConfig> </IotDeviceTypeConfig>
]]> ]]>
</insert> </insert>
@ -62,7 +63,19 @@
</exec> </exec>
</target> </target>
<target name="deploy" depends="create-db,build"> <target name="build-agent">
<echo message="Downloading agent source...." />
<exec dir="." executable="sh">
<arg line="-c 'svn checkout https://github.com/wso2-incubator/iot-server-agents/trunk/FireAlarmVirtualAgent'" />
</exec>
<echo message="building agent from source" />
<exec dir="FireAlarmVirtualAgent" executable="sh">
<arg line="-c 'mvn clean install'" />
</exec>
<copy file="FireAlarmVirtualAgent/target/wso2-firealarm-virtual-agent.jar" todir="sketch"/>
</target>
<target name="deploy" depends="create-db,build-agent,build">
<copy toDir="${target.sketch.dir}/${sample_type}"> <copy toDir="${target.sketch.dir}/${sample_type}">
<fileset dir="sketch"/> <fileset dir="sketch"/>
</copy> </copy>
@ -84,6 +97,8 @@
<delete dir="${target.sketch.dir}/${sample_type}"/> <delete dir="${target.sketch.dir}/${sample_type}"/>
<delete file="${target.page.dir}/${sample_type}.hbs"/> <delete file="${target.page.dir}/${sample_type}.hbs"/>
<delete dir="${target.unit.dir}/${sample_type}"/> <delete dir="${target.unit.dir}/${sample_type}"/>
<delete file="${target.page.dir}/${sample_type}.hbs"/>
<delete dir="${target.unit.dir}/${sample_type}"/>
<xmltask source="${iot.conf}" dest="${iot.conf}" report="true"> <xmltask source="${iot.conf}" dest="${iot.conf}" report="true">
<remove path="/IoTDeviceTypeConfigManager/IotDeviceTypeConfig[type='${sample_type}']"/> <remove path="/IoTDeviceTypeConfigManager/IotDeviceTypeConfig[type='${sample_type}']"/>
</xmltask> </xmltask>

@ -1,2 +1,2 @@
templates=deviceConfig.properties templates=deviceConfig.properties
zipfilename=FireAlarmAgent.zip zipfilename=FireAlarmVirtualAgent.zip

@ -34,7 +34,7 @@ while true; do
done done
java -jar firealarm-virtual-agent-1.0-SNAPSHOT-jar-with-dependencies.jar java -jar wso2-firealarm-virtual-agent.jar
#while true; do #while true; do
# read -p "Do you wish to run 'apt-get update' and continue? [Yes/No] " yn # read -p "Do you wish to run 'apt-get update' and continue? [Yes/No] " yn

@ -292,7 +292,7 @@ public class VirtualFireAlarmManagerService {
//create new device id //create new device id
String deviceId = shortUUID(); String deviceId = shortUUID();
TokenClient accessTokenClient = new TokenClient("firealarm"); TokenClient accessTokenClient = new TokenClient(VirtualFireAlarmConstants.DEVICE_TYPE);
AccessTokenInfo accessTokenInfo = null; AccessTokenInfo accessTokenInfo = null;
accessTokenInfo = accessTokenClient.getAccessToken(owner, deviceId); accessTokenInfo = accessTokenClient.getAccessToken(owner, deviceId);

Loading…
Cancel
Save