Subversion Repositories oidplus

Compare Revisions

No changes between revisions

Regard whitespace Rev 1425 → Rev 1426

/trunk/dev/release.sh
0,0 → 1,112
#!/bin/bash
 
# OIDplus 2.0
# Copyright 2019 - 2023 Daniel Marschall, ViaThinkSoft
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
 
echo "==============================="
echo "PREPARE FOR NEW OIDPLUS VERSION"
echo "==============================="
echo ""
 
# TODO: Maybe we should also check for the word "SPONGE" and do not let commit if it is there (see TempleOS)
 
# Please make sure to do all these steps before committing ANYTHING:
 
DIR=$( dirname "$0" )
 
# 1. Recommended: Run dev/vendor_update.sh and make sure new/deleted files are added/deleted from the SVN/Git working copy
echo "1. Run composer vendor update? (Recommended to do regularly)"
select yn in "Yes" "No"; do
case $yn in
Yes ) "$DIR"/vendor_update.sh; break;;
No ) break;;
esac
done
 
# 2. Run dev/translation/message_regenerate.phps and translate things which are missing in plugins/viathinksoft/language/dede/messages.xml (search for "TODO")
echo "2. Checking translation..."
while true; do
"$DIR"/translation/message_regenerate.phps
cat "$DIR"/../plugins/viathinksoft/language/dede/messages.xml | grep TODO > /dev/null
if [ $? -eq 0 ]; then
echo "Problem: There are untranslated strings! Please translate them."
sleep 2
nano "$DIR"/../plugins/viathinksoft/language/dede/messages.xml
else
break
fi
done
 
# 3. Run phpstan
echo "3. Running PHPSTAN..."
cd "$DIR"/.. && phpstan
echo "Is PHPSTAN output OK?"
select yn in "Yes" "No"; do
case $yn in
Yes ) break;;
No ) echo "Please fix the issues and run release script again"; exit 1;;
esac
done
 
# 4. Make sure there are no unversioned files (otherwise systemfile check will generate wrong stuff)
# PLEASE MAKE SURE that the SVN/Git-Working copy has no unversioned files, otherwise they would be included in the checksum catalog
echo "4. Checking unversioned files"
if [ -d "$DIR"/../.svn ]; then
cd "$DIR"/.. && svn stat | grep "^?"
if [ $? -eq 0 ]; then
echo "STOP! There are unversioned files. Please add or remove them. (Otherwise systemfile check plugin will add these files)"
exit 1
fi
cd "$DIR"/.. && svn stat | grep "^!"
if [ $? -eq 0 ]; then
echo "STOP! There are missing files. Please fix this problem (remove them from the SVN)"
exit 1
fi
fi
if [ -d "$DIR"/../.git ]; then
cd "$DIR"/.. && git status
echo "Is everything OK? (All files committed, no unversioned stuff? Otherwise system file check plugin will not work correctly)"
select yn in "Yes" "No"; do
case $yn in
Yes ) break;;
No ) echo "Please fix the issue first"; exit 1;;
esac
done
fi
 
# 5. Only if you want to start a new release: Add new entry to the top of changelog.json.php
echo "5. Please edit changelog.json.php (add '-dev' for non-stable versions)"
sleep 2
nano "$DIR"/../changelog.json.php
 
# 6. Run plugins/viathinksoft/adminPages/902_systemfile_check/private/gen_serverside_v3
echo "6. Generate system file check checksum file..."
"$DIR"/../plugins/viathinksoft/adminPages/902_systemfile_check/private/gen_serverside_v3
 
# 7. Commit to SVN or GIT
if [ -d "$DIR"/../.svn ]; then
echo "7. Committing to SVN"
svn commit
elif [ -d "$DIR"/../.git ]; then
echo "7. ALL GOOD! PLEASE NOW COMMIT TO GIT"
else
echo "7. ALL GOOD! YOU CAN RELEASE IT"
fi
exit 0
 
# 8. (ViaThinkSoft internal / runs automatically) Sync SVN to GitHub
 
# 9. (ViaThinkSoft internal / runs automatically) Run plugins/viathinksoft/adminPages/900_software_update/private/gen_serverside_v3
 
Property changes:
Added: svn:executable
+*
\ No newline at end of property
Added: svn:mime-type
+text/x-sh
\ No newline at end of property
/trunk/dev/rewrite_changelog_from_svn
0,0 → 1,80
#!/usr/bin/php
<?php
 
/*
* OIDplus 2.0
* Copyright 2019 - 2023 Daniel Marschall, ViaThinkSoft
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
 
die("Please uncomment the die() statement if you want to use this script.\n"); // This script is only intended to run once during development of version 2.0.1.0 !
 
$ret = [];
 
#die(base64_encode("\"\n }\n]\n"));
$ret[] = ["dummy" => "<?php die(base64_decode('IgogICAgfQpdCg==')); /* for security reasons, do not show the current version @phpstan-ignore-line */ ?>" ];
 
if (!is_dir('/tmp/oidplus_git_a')) {
exec('git clone https://github.com/danielmarschall/oidplus /tmp/oidplus_git_a', $out, $ec);
if ($ec != 0) {
fwrite(STDERR, "GIT Clone failed\n");
exit(1);
}
}
 
$git_svn = [];
$ec = -1;
$out = array();
exec('cd /tmp/oidplus_git_a && git reset --hard && git checkout master && git pull && git log', $out, $ec);
if ($ec != 0) {
fwrite(STDERR, "GIT Log failed\n");
} else {
$cont = implode("\n", $out);
preg_match_all('%^commit (.+)\n.+trunk@(\d+) 02e%smU', $cont, $git_commits, PREG_SET_ORDER);
foreach ($git_commits as $git_commit) {
$git_svn[$git_commit[2]] = $git_commit[1];
}
}
 
$ec = -1;
$out = array();
exec('svn log https://svn.viathinksoft.com/svn/oidplus/trunk --xml', $out, $ec);
if ($ec != 0) {
fwrite(STDERR, "SVN Log failed\n");
} else {
$str = implode("\n",$out);
 
$xml = simplexml_load_string($str);
 
foreach ($xml as $a) {
$msg = trim((string)$a->msg);
assert(isset($git_svn[(string)$a->attributes()->revision]));
$ret[] = array(
'version' => '2.0.0.'.($a->attributes()->revision),
'date' => date('Y-m-d H:i:s O',strtotime((string)$a->date)),
# 'author' => (string)$a->author,
'author' => 'Daniel Marschall (ViaThinkSoft)',
'changes' => ($msg == '' ? [] : explode("\n",$msg)),
'sources' => [
'svn' => ['https://svn.viathinksoft.com/svn/oidplus/trunk@'.($a->attributes()->revision)],
'git' => ['https://github.com/danielmarschall/oidplus/tree/'.$git_svn[(string)$a->attributes()->revision]]
]
);
 
}
 
}
 
$output = json_encode($ret, JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES);
file_put_contents(__DIR__.'/../changelog.json.php', $output);
Property changes:
Added: svn:executable
+*
\ No newline at end of property