This repository has been archived by the owner on Jan 30, 2024. It is now read-only.
forked from OpenSKOS/OpenSKOS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
66 lines (57 loc) · 5.61 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?xml version="1.0" encoding="UTF-8"?>
<project name="openskos" default="install.dev" basedir="">
<property name="env" value="development"/>
<property file="./build/build.properties"/>
<property file="./build/build-${env}.properties" override="true"/>
<property name="environment" value="development"/>
<resolvepath propertyName="basedir" file="${project.basedir}/"/>
<target name="install.dev" description="Setup dev environment">
<exec passthru="true" checkReturn="true" command="composer install -o" />
<!--<phingcall target="solr.create.core" />-->
<phingcall target="config" />
</target>
<target name="config"
description="configure application for a specific environment">
<copy overwrite="true"
file="${basedir}/application/configs/application.ini.dist"
tofile="${basedir}/application/configs/application.ini">
<filterchain>
<replaceregexp>
<regexp pattern="solr\.host\s*=\s*.*" replace="solr.host=${solr.host}"/>
<regexp pattern="solr\.port\s*=\s*.*" replace="solr.port=${solr.port}"/>
<regexp pattern="solr\.context\s*=\s*.*" replace="solr.context=${solr.context}"/>
<regexp pattern="db\.params\.host\s*=\s*localhost" replace="db.params.host=${db.server}"/>
<regexp pattern="db\.params\.username\s*=\s*openskos" replace="db.params.username=${db.username}"/>
<regexp pattern="db\.params\.password\s*=\s*openskos" replace="db.params.password=${db.password}"/>
<regexp pattern="db\.params\.dbname\s*=\s*openskos" replace="db.params.dbname=${db.database}"/>
<regexp pattern="@google-client-id@" replace="${oAuth2.google.clintId}"/>
<regexp pattern="@google-client-secret@" replace="${oAuth2.google.clintSecret}"/>
<regexp pattern="@api-base-uri@" replace="${api.baseUri}"/>
<regexp pattern="@api-show-only-approved@" replace="${api.showOnlyApproved}"/>
<regexp pattern="@editor-allow-notation-edit@" replace="${editor.allowNotationEdit}"/>
<regexp pattern="sparql\.(query|update)Uri\s*=\s*.*?:3030/[^/]*/" replace="sparql.\1Uri=${jena.url}"/>
<regexp pattern="resources\.cachemanager\.general\.backend\.name\s*=\s*.*" replace="resources.cachemanager.general.backend.name=${resources.cachemanager.general.backend.name}"/>
<regexp pattern="resources\.cachemanager\.general\.backend\.options\.servers\.1\.host\s*=\s*.*" replace="resources.cachemanager.general.backend.options.servers.1.host=${resources.cachemanager.general.backend.options.servers.1.host}"/>
<regexp pattern="resources\.cachemanager\.general\.backend\.options\.servers\.1\.port\s*=\s*.*" replace="resources.cachemanager.general.backend.options.servers.1.port=${resources.cachemanager.general.backend.options.servers.1.port}"/>
<regexp pattern="resources\.cachemanager\.general\.backend\.options\.servers\.1\.persistent\s*=\s*.*" replace="resources.cachemanager.general.backend.options.servers.1.persistent=${resources.cachemanager.general.backend.options.servers.1.persistent}"/>
<regexp pattern="resources\.cachemanager\.general\.backend\.options\.servers\.1\.weight\s*=\s*.*" replace="resources.cachemanager.general.backend.options.servers.1.weight=${resources.cachemanager.general.backend.options.servers.1.weight}"/>
<regexp pattern="resources\.cachemanager\.general\.backend\.options\.servers\.1\.timeout\s*=\s*.*" replace="resources.cachemanager.general.backend.options.servers.1.timeout=${resources.cachemanager.general.backend.options.servers.1.timeout}"/>
<regexp pattern="resources\.cachemanager\.general\.backend\.options\.servers\.1\.retry_interval\s*=\s*.*" replace="resources.cachemanager.general.backend.options.servers.1.retry_interval=${resources.cachemanager.general.backend.options.servers.1.retry_interval}"/>
<regexp pattern="resources\.cachemanager\.general\.instance_uuid\s*=\s*.*" replace="resources.cachemanager.general.instance_uuid=${resources.cachemanager.general.instance_uuid}"/>
</replaceregexp>
</filterchain>
</copy>
</target>
<target name="solr.create.core" description="Creates solr development">
<property name="solr.docker.host" value="openskos-solr"/>
<property name="solr.core.path" value="docs/solr"/>
<property name="solr.core.name" value="openskos"/>
<property name="solr.url.admin" value="http://openskos-solr:8983/solr/admin"/>
<echo msg="docker cp ${solr.core.path} ${solr.docker.host}:/opt/solr/server/solr/${solr.core.name}" />
<exec command="docker cp ${solr.core.path} ${solr.docker.host}:/opt/solr/server/solr/${solr.core.name}" escape="false" logoutput="true" />
<echo msg="docker exec --user root -i -t ${solr.docker.host} chown -R solr:solr /opt/solr/server/solr/${solr.core.name}" />
<exec command="docker exec --user root -i -t ${solr.docker.host} chown -R solr:solr /opt/solr/server/solr/${solr.core.name}" escape="false" logoutput="true" />
<echo msg="${solr.url.admin}/cores?action=CREATE&name=${solr.core.name}&instanceDir=${solr.core.name}" />
<http-request url="${solr.url.admin}/cores?action=CREATE&name=${solr.core.name}&instanceDir=${solr.core.name}" verbose="true" />
</target>
</project>