1
0
mirror of https://github.com/cydrobolt/polr.git synced 2024-11-09 11:42:28 +01:00

Setup wording changes & new versioning script

This commit is contained in:
Chaoyi Zha 2016-08-14 22:50:55 -07:00
parent cf47e4d253
commit 556e8ead4a
5 changed files with 28 additions and 2 deletions

View File

@ -71,6 +71,7 @@ h4, p {
.setup-qmark {
width: 2em;
margin-left: 0.3em;
display: inline;
}

View File

@ -69,7 +69,7 @@ Setup
<p>
If public interface is hidden, redirect index page to:
<button data-content="Required if public interface is hidden. To use Polr, login by directly heading to example.com/login first." type="button" class="btn btn-xs btn-default setup-qmark" data-toggle="popover">?</button>
<button data-content="Required if public interface is hidden. To use Polr, login by directly heading to yoursite.com/login first." type="button" class="btn btn-xs btn-default setup-qmark" data-toggle="popover">?</button>
</p>
<input type='text' class='form-control' name='setting:index_redirect' placeholder='http://your-main-site.com'>
<p class='text-muted'>

View File

@ -1,3 +1,3 @@
mv .env .env.bak
wget https://raw.githubusercontent.com/cydrobolt/polr/2.0-dev/.env
wget https://raw.githubusercontent.com/cydrobolt/polr/master/.env.setup
echo "Done!"

25
util/version.py Normal file
View File

@ -0,0 +1,25 @@
import re, datetime, string, random
print "New version name (e.g 2.0.0):"
new_version = raw_input()
with open('.env.setup', 'r+') as setup_env:
setup_env_lines = setup_env.read()
now = datetime.datetime.now()
new_setup_key = ''.join(random.SystemRandom().choice(string.ascii_letters + string.digits + string.punctuation) for _ in range(32))
# Update setup key
setup_env_lines = re.sub(r'(?is)APP_KEY=[^\n]+', 'APP_KEY={}'.format(new_setup_key), setup_env_lines)
# Update date and release in setup env
setup_env_lines = re.sub(r'(?is)VERSION=[0-9a-zA-Z\.]+', 'VERSION={}'.format(new_version), setup_env_lines)
setup_env_lines = re.sub(r'(?is)VERSION_RELMONTH=\w+', 'VERSION_RELMONTH={}'.format(now.strftime('%B')), setup_env_lines)
setup_env_lines = re.sub(r'(?is)VERSION_RELDAY=\w+', 'VERSION_RELDAY={}'.format(now.day), setup_env_lines)
setup_env_lines = re.sub(r'(?is)VERSION_RELYEAR=\w+', 'VERSION_RELYEAR={}'.format(now.year), setup_env_lines)
# Overwite existing file
setup_env.seek(0)
setup_env.write(setup_env_lines)
setup_env.truncate()
print "Done!"

View File