Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Handle new VERSION.php file and new DB_VERSION variable
Browse files Browse the repository at this point in the history
  • Loading branch information
cdujeu committed Nov 29, 2014
1 parent 2223b32 commit 389a9bd
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 13 deletions.
3 changes: 3 additions & 0 deletions core/src/plugins/action.updater/class.AjaXplorerUpgrader.php
Expand Up @@ -367,6 +367,9 @@ protected function executeStepTrigger($stepName, $trigger = "pre")

public function updateVersion()
{
if(is_file($this->workingFolder."/conf/VERSION.php")){
copy($this->workingFolder."/conf/VERSION.php", $this->installPath."/conf/VERSION.php");
}
// Finally copy VERSION file
if (!is_file($this->workingFolder."/conf/VERSION")) {
return "<b>No VERSION file in archive</b>";
Expand Down
39 changes: 26 additions & 13 deletions dist/phing/build-pydio.xml
Expand Up @@ -124,7 +124,7 @@
<property name="package_name" value="pydio-${DSTAMP}-${LASTREVISION}"/>
</then>
<else>
<property name="package_name" value="pydio-core-${new_version}"/>
<property name="package_name" value="pydio-core-${build.version}"/>
</else>
</if>
<property name="INNER_DIRECTORY" value="${build.source_folder}/${package_name}"/>
Expand Down Expand Up @@ -156,7 +156,7 @@
<not><available type="dir" file="${build.working_folder}/upgrade"/></not>
<then><mkdir dir="${build.working_folder}/upgrade"/></then>
</if>
<property name="upgrade_export" value="${build.working_folder}/upgrade/export/pydio-core-upgrade-${previous_version}-${new_version}"/>
<property name="upgrade_export" value="${build.working_folder}/upgrade/export/pydio-core-upgrade-${previous_version}-${build.version}"/>
<mkdir dir="${upgrade_export}"/>
<mkdir dir="${upgrade_export}/UPGRADE"/>
<git_summarize
Expand All @@ -182,35 +182,46 @@
<filterchain>
<replacetokens begintoken="##" endtoken="##">
<token key="VERSION_NUMBER" value="${build.version}"/>
<token key="VERSION_DATE" value="${VERSION_DATE}"/>
<token key="DB_VERSION" value="${build.dbversion}"/>
<token key="VERSION_DATE" value="${VERSION_DATE}"/>
<token key="REVISION" value="${LASTREVISION}"/>
</replacetokens>
</filterchain>
</copy>
<copy file="${git.local_repository}/core/src/conf/VERSION.php" toFile="${upgrade_export}/conf/VERSION.php">
<filterchain>
<replacetokens begintoken="##" endtoken="##">
<token key="VERSION_NUMBER" value="${build.version}"/>
<token key="DB_VERSION" value="${build.dbversion}"/>
<token key="VERSION_DATE" value="${VERSION_DATE}"/>
<token key="REVISION" value="${LASTREVISION}"/>
</replacetokens>
</filterchain>
</copy>

<!-- ADDITIONAL UPGRADE SCRIPT -->
<if>
<available type="file" file="${git.local_repository}/dist/php/${new_version}.php"/>
<available type="file" file="${git.local_repository}/dist/php/${build.version}.php"/>
<then>
<copy file="${git.local_repository}/dist/php/${new_version}.php" toFile="${upgrade_export}/UPGRADE/PHP-SCRIPT"/>
<copy file="${git.local_repository}/dist/php/${build.version}.php" toFile="${upgrade_export}/UPGRADE/PHP-SCRIPT"/>
</then>
</if>

<if>
<available type="file" file="${git.local_repository}/dist/php/${new_version}.html"/>
<available type="file" file="${git.local_repository}/dist/php/${build.version}.html"/>
<then>
<copy file="${git.local_repository}/dist/php/${new_version}.html" toFile="${upgrade_export}/UPGRADE/NOTE-HTML"/>
<copy file="${git.local_repository}/dist/php/${build.version}.html" toFile="${upgrade_export}/UPGRADE/NOTE-HTML"/>
</then>
</if>

<if>
<available type="file" file="${git.local_repository}/dist/php/${new_version}.sql"/>
<available type="file" file="${git.local_repository}/dist/php/${build.version}.sql"/>
<then>
<copy file="${git.local_repository}/dist/php/${new_version}.sql" toFile="${upgrade_export}/UPGRADE/DB-UPGRADE.sql"/>
<copy file="${git.local_repository}/dist/php/${build.version}.sql" toFile="${upgrade_export}/UPGRADE/DB-UPGRADE.sql"/>
<if>
<available type="file" file="${git.local_repository}/dist/php/${new_version}.sqlite"/>
<available type="file" file="${git.local_repository}/dist/php/${build.version}.sqlite"/>
<then>
<copy file="${git.local_repository}/dist/php/${new_version}.sqlite" toFile="${upgrade_export}/UPGRADE/DB-UPGRADE.sqlite"/>
<copy file="${git.local_repository}/dist/php/${build.version}.sqlite" toFile="${upgrade_export}/UPGRADE/DB-UPGRADE.sqlite"/>
</then>
</if>
</then>
Expand All @@ -237,7 +248,7 @@
<property name="package_name" value="pydio-${DSTAMP}-${LASTREVISION}"/>
</then>
<else>
<property name="package_name" value="pydio-core-${new_version}"/>
<property name="package_name" value="pydio-core-${build.version}"/>
</else>
</if>
<property name="packaged_zip" value="${package_name}.zip"/>
Expand Down Expand Up @@ -283,7 +294,7 @@
<target name="zip_upgrade" description="Packaging upgrade">
<mkdir dir="${build.working_folder}/build" />
<mkdir dir="${build.working_folder}/build/upgrade" />
<property name="packaged_zip" value="pydio-core-upgrade-${previous_version}-${new_version}.zip"/>
<property name="packaged_zip" value="pydio-core-upgrade-${previous_version}-${build.version}.zip"/>
<zip
destfile="${build.working_folder}/build/upgrade/${packaged_zip}"
includeemptydirs="true"
Expand Down Expand Up @@ -482,12 +493,14 @@
<target name="replace_variables" description="Replace version, revision number, etc in files">
<reflexive>
<fileset dir="${passed_directory}">
<include pattern="conf/VERSION.php"/>
<include pattern="conf/VERSION"/>
<include pattern="conf/RELEASE_NOTE"/>
</fileset>
<filterchain>
<replacetokens begintoken="##" endtoken="##">
<token key="VERSION_NUMBER" value="${build.version}"/>
<token key="DB_VERSION" value="${build.dbversion}"/>
<token key="VERSION_DATE" value="${VERSION_DATE}"/>
<token key="REVISION" value="${LASTREVISION}"/>
</replacetokens>
Expand Down
1 change: 1 addition & 0 deletions dist/phing/build.properties.sample
Expand Up @@ -2,6 +2,7 @@ build.working_folder=/home/builder
build.repositories_folder=/home/builder/repositories
build.signing_key_id=
build.version=
build.dbversion=
git.local_repository=
git.remote_repository=
git.branch=master
Expand Down

0 comments on commit 389a9bd

Please sign in to comment.