add update task

This commit is contained in:
Uwe Steinmann 2025-09-25 10:31:23 +02:00
parent 8e95df660b
commit 8c55c64b40
2 changed files with 37 additions and 5 deletions

View File

@ -39,6 +39,9 @@ quickstart-dev:
install:
php vendor/bin/phing -Dversion=$(VERSION) -Dinstallpath=$(INSTALL_PATH) -Ddomain=dms.seeddms.org install
update:
php vendor/bin/phing -Dversion=$(VERSION) -Dinstallpath=$(INSTALL_PATH) -Ddomain=dms.seeddms.org update
unittest:
vendor/bin/phing -Dversion=$(VERSION) phpunitfast

View File

@ -301,10 +301,17 @@
</target>
<target name="install" description="Install SeedDMS">
<phingcall target="package">
</phingcall>
<exec executable="tar" passthru="true" checkreturn="true" dir="${installpath}">
<arg line="-xzvf ${builddir}/packages/seeddms-quickstart-${version}.tar.gz ${shortversion} --strip-components=1" />
<if>
<equals arg1="" arg2="${installpath}" />
<then><fail msg="Pass install path as property 'installpath'. Ensure this directory exists and is writeable by the user running this build script." /></then>
</if>
<if>
<not><available file="${installpath}"/></not>
<then><fail msg="Install path '${installpath}' does not exist." /></then>
</if>
<phingcall target="package"></phingcall>
<exec executable="tar" passthru="false" checkreturn="true" dir="${installpath}">
<arg line="-xzvf ${builddir}/packages/seeddms-quickstart-${version}.tar.gz --strip-components=1" />
</exec>
<copy file="${srcdir}/conf/apache.virtualhost.template" tofile="${installpath}/conf/apache.virtualhost.conf">
<filterchain>
@ -314,11 +321,33 @@
</replaceregexp>
</filterchain>
</copy>
<exec executable="bash" passthru="true" dir="${installpath}">
<arg value="-c"/>
<arg line="'sudo chown www-data:www-data ${installpath}'" />
</exec>
<exec executable="bash" passthru="true" dir="${installpath}">
<arg value="-c"/>
<arg line="'sudo chown -R www-data:www-data ${installpath}/data ${installpath}/conf'" />
</exec>
<echo message="Create a link in /etc/apache2/sites-enabled/" />
<echo message="sudo -u www-data ln -s ${installpath}/conf/apache.virtualhost.conf /etc/apache2/sites-enabled/001-seeddms.conf" />
<echo message="sudo ln -s ${installpath}/conf/apache.virtualhost.conf /etc/apache2/sites-enabled/001-seeddms.conf" />
</target>
<target name="update" description="Update SeedDMS Installation">
<if>
<equals arg1="" arg2="${installpath}" />
<then><fail msg="Pass install path as property 'installpath'. Ensure this directory exists and is writeable by the user running this build script." /></then>
</if>
<if>
<not><available file="${installpath}"/></not>
<then><fail msg="Install path '${installpath}' does not exist." /></then>
</if>
<phingcall target="package"></phingcall>
<exec executable="tar" passthru="false" checkreturn="true" dir="${installpath}">
<arg line="-xzvf ${builddir}/packages/seeddms-quickstart-${version}.tar.gz --strip-components=1 ${shortversion}/vendor ${shortversion}/seeddms-${version}" />
</exec>
<!-- delete file="${installpath}/seeddms" / -->
<!-- symlink target="${installpath}/${shortversion}" link="${installpath}/seeddms" relative="true"/ -->
<echo message="If you have updated to a newer version of SeedDMS, you will have to adjust the link 'seeddms' pointing to 'seeddms-${version}' in '${installpath}'." />
</target>
</project>